summaryrefslogtreecommitdiff
path: root/linux/dev/include/asm-i386/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'linux/dev/include/asm-i386/system.h')
-rw-r--r--linux/dev/include/asm-i386/system.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/dev/include/asm-i386/system.h b/linux/dev/include/asm-i386/system.h
index f26a33e7..41eb65a4 100644
--- a/linux/dev/include/asm-i386/system.h
+++ b/linux/dev/include/asm-i386/system.h
@@ -1,6 +1,8 @@
#ifndef __ASM_SYSTEM_H
#define __ASM_SYSTEM_H
+#include <i386/ipl.h> /* curr_ipl, splx */
+
#include <asm/segment.h>
/*
@@ -223,10 +225,8 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
#define mb() __asm__ __volatile__ ("" : : :"memory")
#define __sti() __asm__ __volatile__ ("sti": : :"memory")
#define __cli() __asm__ __volatile__ ("cli": : :"memory")
-#define __save_flags(x) \
-__asm__ __volatile__("pushf ; pop %0" : "=r" (x): /* no input */ :"memory")
-#define __restore_flags(x) \
-__asm__ __volatile__("push %0 ; popf": /* no output */ :"g" (x):"memory")
+#define __save_flags(x) (x = ((curr_ipl > 0) ? 0 : (1 << 9)))
+#define __restore_flags(x) splx((x & (1 << 9)) ? 0 : 7)
#ifdef __SMP__