summaryrefslogtreecommitdiff
path: root/linux/dev/include
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2007-08-04 17:50:50 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:12 +0200
commit5ad5458f9ea2b6fa91f2ee2538aa82f1eead5dfb (patch)
tree7894052921773e67bb5a2e7bd2ddf07b78594366 /linux/dev/include
parenta8711d20ce670b1f88f6926cb15d11a5674da41a (diff)
2007-08-04 Samuel Thibault <samuel.thibault@ens-lyon.org>
* linux/dev/include/asm-i386/system.h: Update to Linux 2.2 for SMP.
Diffstat (limited to 'linux/dev/include')
-rw-r--r--linux/dev/include/asm-i386/system.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/linux/dev/include/asm-i386/system.h b/linux/dev/include/asm-i386/system.h
index ecd2d75..3e17d2d 100644
--- a/linux/dev/include/asm-i386/system.h
+++ b/linux/dev/include/asm-i386/system.h
@@ -221,15 +221,34 @@ 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) \
+#define __sti() __asm__ __volatile__ ("sti": : :"memory")
+#define __cli() __asm__ __volatile__ ("cli": : :"memory")
+#define __save_flags(x) \
__asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */ :"memory")
-
-#define restore_flags(x) \
+#define __restore_flags(x) \
__asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory")
+#ifdef __SMP__
+
+extern void __global_cli(void);
+extern void __global_sti(void);
+extern unsigned long __global_save_flags(void);
+extern void __global_restore_flags(unsigned long);
+#define cli() __global_cli()
+#define sti() __global_sti()
+#define save_flags(x) ((x)=__global_save_flags())
+#define restore_flags(x) __global_restore_flags(x)
+
+#else
+
+#define cli() __cli()
+#define sti() __sti()
+#define save_flags(x) __save_flags(x)
+#define restore_flags(x) __restore_flags(x)
+
+#endif
+
+
#define iret() __asm__ __volatile__ ("iret": : :"memory")
#define _set_gate(gate_addr,type,dpl,addr) \