#ifdef __KERNEL__
#include <linux/config.h>
-#include <linux/compiler.h>
#include <asm/page.h>
#ifndef __ASSEMBLY__
0-0xBFFFFFFF for user-thead
0-0xFFFFFFFF for kernel-thread
*/
+ void *sysenter_return;
struct restart_block restart_block;
unsigned long previous_esp; /* ESP of the previous stack in case
#endif
-#define PREEMPT_ACTIVE 0x10000000
-#ifdef CONFIG_4KSTACKS
-#define THREAD_SIZE (4096)
-#else
-#define THREAD_SIZE (8192)
-#endif
+#define PREEMPT_ACTIVE 0x4000000
+#define THREAD_SIZE (1<<CONFIG_STACK_SIZE_SHIFT)
+#define STACK_WARN (CONFIG_STACK_WARN)
+#define STACK_PANIC (0x200ul)
-#define STACK_WARN (THREAD_SIZE/8)
/*
* macros/functions for gaining access to the thread information structure
*
*/
#ifndef __ASSEMBLY__
-#define INIT_THREAD_INFO(tsk) \
+#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
.exec_domain = &default_exec_domain, \
}
/* how to get the current stack pointer from C */
-register unsigned long current_stack_pointer asm("esp") __attribute_used__;
+static inline unsigned long current_stack_pointer(void)
+{
+ unsigned long ti;
+ __asm__("movl %%esp,%0; ":"=r" (ti) : );
+ return ti;
+}
/* thread information allocation */
#ifdef CONFIG_DEBUG_STACK_USAGE