projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b504c4
)
Add volatile to asm statement in intr_get_level(),
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 10 Oct 2004 23:56:14 +0000
(23:56 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 10 Oct 2004 23:56:14 +0000
(23:56 +0000)
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
patch
|
blob
|
history
diff --git
a/src/threads/interrupt.c
b/src/threads/interrupt.c
index 8e7d575afe7928ac5f22c57c11719e2107dcae50..3637b0013edd9c92f347f23f60e230ec00efcfbc 100644
(file)
--- 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;
}