From 07af4666a5d90db8500abacfe73d6fc2aeb6a7b7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 10 Oct 2004 23:56:14 +0000 Subject: [PATCH] Add volatile to asm statement in intr_get_level(), otherwise GCC will assume that two calls to this function can be optimized into one, even across asm("sti") or asm("cli"). --- src/threads/interrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threads/interrupt.c b/src/threads/interrupt.c index 8e7d575..3637b00 100644 --- a/src/threads/interrupt.c +++ b/src/threads/interrupt.c @@ -51,7 +51,7 @@ intr_get_level (void) { uint32_t flags; - asm ("pushfl; popl %0" : "=g" (flags)); + asm volatile ("pushfl; popl %0" : "=g" (flags)); return flags & FLAG_IF ? INTR_ON : INTR_OFF; } -- 2.30.2