projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add volatile to asm statement in intr_get_level(),
[pintos-anon]
/
src
/
threads
/
interrupt.c
diff --git
a/src/threads/interrupt.c
b/src/threads/interrupt.c
index fca145e10b96244cd8ee2872f76f46c432528854..3637b0013edd9c92f347f23f60e230ec00efcfbc 100644
(file)
--- a/
src/threads/interrupt.c
+++ b/
src/threads/interrupt.c
@@
-3,6
+3,7
@@
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
+#include "threads/flags.h"
#include "threads/intr-stubs.h"
#include "threads/io.h"
#include "threads/mmu.h"
#include "threads/intr-stubs.h"
#include "threads/io.h"
#include "threads/mmu.h"
@@
-50,7
+51,7
@@
intr_get_level (void)
{
uint32_t flags;
{
uint32_t flags;
- asm ("pushfl; popl %0" : "=g" (flags));
+ asm
volatile
("pushfl; popl %0" : "=g" (flags));
return flags & FLAG_IF ? INTR_ON : INTR_OFF;
}
return flags & FLAG_IF ? INTR_ON : INTR_OFF;
}