patch-2.1.37 linux/include/asm-i386/current.h

Next file: linux/include/asm-i386/delay.h
Previous file: linux/include/asm-i386/bitops.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/include/asm-i386/current.h linux/include/asm-i386/current.h
@@ -1,12 +1,14 @@
 #ifndef _I386_CURRENT_H
 #define _I386_CURRENT_H
 
-/* Some architectures may want to do something "clever" here since
- * this is the most frequently accessed piece of data in the entire
- * kernel.  For an example, see the Sparc implementation where an
- * entire register is hard locked to contain the value of current.
- */
-extern struct task_struct *current_set[NR_CPUS];
-#define current (current_set[smp_processor_id()])	/* Current on this processor */
+static inline unsigned long get_esp(void)
+{
+	unsigned long esp;
+	__asm__("movl %%esp,%0":"=r" (esp));
+	return esp;
+}
+
+#define current ((struct task_struct *)(get_esp() & ~8191UL))
+
 
 #endif /* !(_I386_CURRENT_H) */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov