uml: use UM_THREAD_SIZE in userspace code
authorJeff Dike <jdike@addtoit.com>
Fri, 11 May 2007 05:22:31 +0000 (22:22 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 11 May 2007 15:29:33 +0000 (08:29 -0700)
Now that we have UM_THREAD_SIZE, we can replace the calculations in
user-space code (an earlier patch took care of the kernel side of the
house).

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/kernel/init_task.c
arch/um/os-Linux/skas/process.c

index cda91aa8e703162564c2163064ed7efe567649d1..4506c7f32bac6eaf57e055fbc49b8e9fd24f51ed 100644 (file)
@@ -44,8 +44,7 @@ __attribute__((__section__(".data.init_task"))) =
 
 void unprotect_stack(unsigned long stack)
 {
-       os_protect_memory((void *) stack, (1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE,
-                      1, 1, 0);
+       os_protect_memory((void *) stack, THREAD_SIZE, 1, 1, 0);
 }
 
 /*
index 6a0e466d01e33052a2ba2b2a27ed8f9d42ac8cb2..3492886223e1fcaa0a06a15b8f921344b83707fa 100644 (file)
@@ -490,8 +490,8 @@ void map_stub_pages(int fd, unsigned long code,
 void new_thread(void *stack, jmp_buf *buf, void (*handler)(void))
 {
        (*buf)[0].JB_IP = (unsigned long) handler;
-       (*buf)[0].JB_SP = (unsigned long) stack +
-               (PAGE_SIZE << UML_CONFIG_KERNEL_STACK_ORDER) - sizeof(void *);
+       (*buf)[0].JB_SP = (unsigned long) stack + UM_THREAD_SIZE -
+               sizeof(void *);
 }
 
 #define INIT_JMP_NEW_THREAD 0
@@ -533,8 +533,7 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf)
        case INIT_JMP_NEW_THREAD:
                (*switch_buf)[0].JB_IP = (unsigned long) new_thread_handler;
                (*switch_buf)[0].JB_SP = (unsigned long) stack +
-                       (PAGE_SIZE << UML_CONFIG_KERNEL_STACK_ORDER) -
-                       sizeof(void *);
+                       UM_THREAD_SIZE - sizeof(void *);
                break;
        case INIT_JMP_CALLBACK:
                (*cb_proc)(cb_arg);