patch-2.4.0-test8 linux/include/asm-arm/current.h
Next file: linux/include/asm-arm/dma.h
Previous file: linux/include/asm-arm/arch-rpc/irq.h
Back to the patch index
Back to the overall index
- Lines: 33
- Date:
Sun Sep 3 11:19:11 2000
- Orig file:
v2.4.0-test7/linux/include/asm-arm/current.h
- Orig date:
Fri Oct 22 13:21:53 1999
diff -u --recursive --new-file v2.4.0-test7/linux/include/asm-arm/current.h linux/include/asm-arm/current.h
@@ -1,30 +1,16 @@
#ifndef _ASMARM_CURRENT_H
#define _ASMARM_CURRENT_H
-static inline unsigned long get_sp(void)
-{
- unsigned long sp;
- __asm__ ("mov %0,sp" : "=r" (sp));
- return sp;
-}
-
/* Old compilers seem to generate bad code if we allow `current' to be
non volatile. */
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 90)
static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
-#define __VOLATILE_CURRENT
-#else
-#define __VOLATILE_CURRENT volatile
#endif
static inline struct task_struct *get_current(void)
{
- struct task_struct *ts;
- __asm__ __VOLATILE_CURRENT (
- "bic %0, sp, #0x1f00 @ get_current
- bic %0, %0, #0x00ff"
- : "=r" (ts));
- return ts;
+ register unsigned long sp asm ("sp");
+ return (struct task_struct *)(sp & ~0x1fff);
}
#define current (get_current())
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)