Skip to content
Snippets Groups Projects
Commit 72fef4f8 authored by rsc's avatar rsc
Browse files

Don't kill process when inside kernel.

parent 4ed974f5
No related branches found
No related tags found
No related merge requests found
......@@ -70,11 +70,18 @@ trap(struct Trapframe *tf)
lapic_timerintr();
if(cpus[cpu()].nlock)
panic("timer interrupt while holding a lock");
if((read_eflags() & FL_IF) == 0)
panic("timer interrupt but interrupts now disabled");
if(cp){
if((read_eflags() & FL_IF) == 0)
panic("timer interrupt but interrupts now disabled");
if(cp->killed)
// Force process exit if it has been killed
// and the interrupt came from user space.
// (If the kernel was executing at time of interrupt,
// don't kill the process. Let the process get back
// out to its regular system call return.)
if((tf->tf_cs&3) == 3 && cp->killed)
proc_exit();
// Force process to give up CPU and let others run.
if(cp->state == RUNNING)
yield();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment