Fixed handling of appserver/interrupts
authorAndrew Waterman <waterman@s143.Millennium.Berkeley.EDU>
Sun, 25 Apr 2010 05:57:28 +0000 (22:57 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:44 +0000 (17:35 -0700)
Instead of toggling interrupts on and off, we assert that they
are enabled at the top of frontend_syscall.  This is because if
the programmer intended interrupts to be disabled, they had better
be disabled!

kern/src/frontend.c

index 6821806..1e336c7 100644 (file)
@@ -242,6 +242,10 @@ int32_t frontend_syscall(pid_t pid, int32_t syscall_num,
        return -1;
 #endif
 
+#ifdef __i386__
+       assert(irq_is_enabled());
+#endif
+
        static spinlock_t lock = SPINLOCK_INITIALIZER;
        int32_t ret;
 
@@ -261,11 +265,8 @@ int32_t frontend_syscall(pid_t pid, int32_t syscall_num,
        magic_mem[0] = 0x80;
 
        // wait for front-end response
-       int8_t irqsave = 0;
-       enable_irqsave(&irqsave);
        while(magic_mem[7] == 0)
                ;
-       disable_irqsave(&irqsave);
 
        ret = magic_mem[1];
        if(errno)