patch-2.1.102 linux/include/asm-i386/current.h
Next file: linux/include/asm-ppc/serial.h
Previous file: linux/fs/super.c
Back to the patch index
Back to the overall index
-  Lines: 22
-  Date:
Mon May 11 09:39:36 1998
-  Orig file: 
v2.1.101/linux/include/asm-i386/current.h
-  Orig date: 
Tue May 13 22:41:17 1997
diff -u --recursive --new-file v2.1.101/linux/include/asm-i386/current.h linux/include/asm-i386/current.h
@@ -1,14 +1,13 @@
 #ifndef _I386_CURRENT_H
 #define _I386_CURRENT_H
 
-static inline unsigned long get_esp(void)
+static inline struct task_struct * get_current(void)
 {
-	unsigned long esp;
-	__asm__("movl %%esp,%0":"=r" (esp));
-	return esp;
-}
-
-#define current ((struct task_struct *)(get_esp() & ~8191UL))
-
+	struct task_struct *current;
+	__asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
+	return current;
+ }
+ 
+#define current get_current()
 
 #endif /* !(_I386_CURRENT_H) */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov