~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/um/kernel/skas/process.c

Version: ~ [ linux-5.3-rc5 ] ~ [ linux-5.2.9 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.67 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.139 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.189 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.189 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.72 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3  * Licensed under the GPL
  4  */
  5 
  6 #include <linux/init.h>
  7 #include <linux/sched.h>
  8 #include <as-layout.h>
  9 #include <kern.h>
 10 #include <os.h>
 11 #include <skas.h>
 12 
 13 int new_mm(unsigned long stack)
 14 {
 15         int fd, err;
 16 
 17         fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0);
 18         if (fd < 0)
 19                 return fd;
 20 
 21         if (skas_needs_stub) {
 22                 err = map_stub_pages(fd, STUB_CODE, STUB_DATA, stack);
 23                 if (err) {
 24                         os_close_file(fd);
 25                         return err;
 26                 }
 27         }
 28 
 29         return fd;
 30 }
 31 
 32 extern void start_kernel(void);
 33 
 34 static int __init start_kernel_proc(void *unused)
 35 {
 36         int pid;
 37 
 38         block_signals();
 39         pid = os_getpid();
 40 
 41         cpu_tasks[0].pid = pid;
 42         cpu_tasks[0].task = current;
 43 #ifdef CONFIG_SMP
 44         init_cpu_online(get_cpu_mask(0));
 45 #endif
 46         start_kernel();
 47         return 0;
 48 }
 49 
 50 extern int userspace_pid[];
 51 
 52 extern char cpu0_irqstack[];
 53 
 54 int __init start_uml(void)
 55 {
 56         stack_protections((unsigned long) &cpu0_irqstack);
 57         set_sigstack(cpu0_irqstack, THREAD_SIZE);
 58         if (proc_mm) {
 59                 userspace_pid[0] = start_userspace(0);
 60                 if (userspace_pid[0] < 0) {
 61                         printf("start_uml - start_userspace returned %d\n",
 62                                userspace_pid[0]);
 63                         exit(1);
 64                 }
 65         }
 66 
 67         init_new_thread_signals();
 68 
 69         init_task.thread.request.u.thread.proc = start_kernel_proc;
 70         init_task.thread.request.u.thread.arg = NULL;
 71         return start_idle_thread(task_stack_page(&init_task),
 72                                  &init_task.thread.switch_buf);
 73 }
 74 
 75 unsigned long current_stub_stack(void)
 76 {
 77         if (current->mm == NULL)
 78                 return 0;
 79 
 80         return current->mm->context.id.stack;
 81 }
 82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp