Commit 64827454 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: eliminate useless thread field

This patch eliminates use of task.thread.kernel_stack.  It was unnecessary,
confusing, and was masking some kernel stack size assumptions.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6feb9cf3
......@@ -46,7 +46,7 @@ void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
int flags = 0, pages;
if(sig_stack != NULL){
pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER) - 2;
pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER);
set_sigstack(sig_stack, pages * page_size());
flags = SA_ONSTACK;
}
......
......@@ -166,8 +166,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
struct pt_regs *regs)
{
p->thread = (struct thread_struct) INIT_THREAD;
p->thread.kernel_stack =
(unsigned long) p->thread_info + 2 * PAGE_SIZE;
return(CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
clone_flags, sp, stack_top, p, regs));
}
......@@ -327,8 +325,7 @@ int user_context(unsigned long sp)
unsigned long stack;
stack = sp & (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER);
stack += 2 * PAGE_SIZE;
return(stack != current->thread.kernel_stack);
return(stack != (unsigned long) current_thread);
}
extern void remove_umid_dir(void);
......
......@@ -191,8 +191,7 @@ int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp,
handler = new_thread_handler;
}
new_thread((void *) p->thread.kernel_stack,
&p->thread.mode.skas.switch_buf,
new_thread(p->thread_info, &p->thread.mode.skas.switch_buf,
&p->thread.mode.skas.fork_buf, handler);
return(0);
}
......@@ -231,7 +230,7 @@ int start_uml_skas(void)
init_task.thread.request.u.thread.proc = start_kernel_proc;
init_task.thread.request.u.thread.arg = NULL;
return(start_idle_thread((void *) init_task.thread.kernel_stack,
return(start_idle_thread(init_task.thread_info,
&init_task.thread.mode.skas.switch_buf,
&init_task.thread.mode.skas.fork_buf));
}
......
......@@ -39,8 +39,7 @@ void flush_thread_tt(void)
do_exit(SIGKILL);
}
new_pid = start_fork_tramp((void *) current->thread.kernel_stack,
stack, 0, exec_tramp);
new_pid = start_fork_tramp(current->thread_info, stack, 0, exec_tramp);
if(new_pid < 0){
printk(KERN_ERR
"flush_thread : new thread failed, errno = %d\n",
......
......@@ -248,8 +248,7 @@ int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp,
clone_flags &= CLONE_VM;
p->thread.temp_stack = stack;
new_pid = start_fork_tramp((void *) p->thread.kernel_stack, stack,
clone_flags, tramp);
new_pid = start_fork_tramp(p->thread_info, stack, clone_flags, tramp);
if(new_pid < 0){
printk(KERN_ERR "copy_thread : clone failed - errno = %d\n",
-new_pid);
......@@ -501,9 +500,9 @@ int start_uml_tt(void)
void *sp;
int pages;
pages = (1 << CONFIG_KERNEL_STACK_ORDER) - 2;
sp = (void *) init_task.thread.kernel_stack + pages * PAGE_SIZE -
sizeof(unsigned long);
pages = (1 << CONFIG_KERNEL_STACK_ORDER);
sp = (void *) ((unsigned long) init_task.thread_info) +
pages * PAGE_SIZE - sizeof(unsigned long);
return(tracer(start_kernel_proc, sp));
}
......
......@@ -380,9 +380,6 @@ int linux_main(int argc, char **argv)
uml_postsetup();
init_task.thread.kernel_stack = (unsigned long) &init_thread_info +
2 * PAGE_SIZE;
task_protections((unsigned long) &init_thread_info);
os_flush_stdout();
......
......@@ -22,7 +22,6 @@ struct mm_struct;
struct thread_struct {
int forking;
unsigned long kernel_stack;
int nsyscalls;
struct pt_regs regs;
unsigned long cr2;
......@@ -73,7 +72,6 @@ struct thread_struct {
#define INIT_THREAD \
{ \
.forking = 0, \
.kernel_stack = 0, \
.nsyscalls = 0, \
.regs = EMPTY_REGS, \
.cr2 = 0, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment