]> Zhao Yanbai Git Server - minix.git/commitdiff
disable interrupts if necessary in kernel debug code to dump all process
authorBen Gras <ben@minix3.org>
Thu, 29 Jan 2009 15:13:54 +0000 (15:13 +0000)
committerBen Gras <ben@minix3.org>
Thu, 29 Jan 2009 15:13:54 +0000 (15:13 +0000)
stacks.

kernel/arch/i386/system.c

index 00e6bde35a151853c899cb0ccd029168446a5766..6eaef954bd4ed70a72dbb6f2e60cc37ee60dc032 100644 (file)
@@ -156,6 +156,10 @@ PRIVATE void ser_debug(int c)
 PUBLIC void ser_dump_proc()
 {
        struct proc *pp;
+       int u = 0;
+
+       /* Disable interrupts so that we get a consistent state. */
+       if(!intr_disabled()) { lock; u = 1; };
 
        for (pp= BEG_PROC_ADDR; pp < END_PROC_ADDR; pp++)
        {
@@ -171,6 +175,8 @@ PUBLIC void ser_dump_proc()
                        pp->p_reg.pc);
                proc_stacktrace(pp);
        }
+
+       if(u) { unlock; }
 }
 
 PRIVATE void ser_dump_stats()