From 5ad5458f9ea2b6fa91f2ee2538aa82f1eead5dfb Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 4 Aug 2007 17:50:50 +0000 Subject: 2007-08-04 Samuel Thibault * linux/dev/include/asm-i386/system.h: Update to Linux 2.2 for SMP. --- linux/dev/include/asm-i386/system.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'linux') 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) \ -- cgit v1.2.3