Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / um / kernel / skas / process.c
blobd4dbf08722d68c6da4cae14a02b3a6372603c8bb
1 /*
2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
6 #include <linux/init.h>
7 #include <linux/sched/mm.h>
8 #include <linux/sched/task_stack.h>
9 #include <linux/sched/task.h>
11 #include <as-layout.h>
12 #include <kern.h>
13 #include <os.h>
14 #include <skas.h>
16 extern void start_kernel(void);
18 static int __init start_kernel_proc(void *unused)
20 int pid;
22 block_signals();
23 pid = os_getpid();
25 cpu_tasks[0].pid = pid;
26 cpu_tasks[0].task = current;
28 start_kernel();
29 return 0;
32 extern int userspace_pid[];
34 extern char cpu0_irqstack[];
36 int __init start_uml(void)
38 stack_protections((unsigned long) &cpu0_irqstack);
39 set_sigstack(cpu0_irqstack, THREAD_SIZE);
41 init_new_thread_signals();
43 init_task.thread.request.u.thread.proc = start_kernel_proc;
44 init_task.thread.request.u.thread.arg = NULL;
45 return start_idle_thread(task_stack_page(&init_task),
46 &init_task.thread.switch_buf);
49 unsigned long current_stub_stack(void)
51 if (current->mm == NULL)
52 return 0;
54 return current->mm->context.id.stack;