init_task.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * This is where we statically allocate and initialize the initial
  3. * task.
  4. *
  5. * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co
  6. * David Mosberger-Tang <davidm@hpl.hp.com>
  7. */
  8. #include <linux/init.h>
  9. #include <linux/mm.h>
  10. #include <linux/module.h>
  11. #include <linux/sched.h>
  12. #include <linux/init_task.h>
  13. #include <linux/mqueue.h>
  14. #include <asm/uaccess.h>
  15. #include <asm/pgtable.h>
  16. static struct fs_struct init_fs = INIT_FS;
  17. static struct files_struct init_files = INIT_FILES;
  18. static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
  19. static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
  20. struct mm_struct init_mm = INIT_MM(init_mm);
  21. EXPORT_SYMBOL(init_mm);
  22. /*
  23. * Initial task structure.
  24. *
  25. * We need to make sure that this is properly aligned due to the way process stacks are
  26. * handled. This is done by having a special ".data.init_task" section...
  27. */
  28. #define init_thread_info init_task_mem.s.thread_info
  29. union {
  30. struct {
  31. struct task_struct task;
  32. struct thread_info thread_info;
  33. } s;
  34. unsigned long stack[KERNEL_STACK_SIZE/sizeof (unsigned long)];
  35. } init_task_mem asm ("init_task") __attribute__((section(".data.init_task"))) = {{
  36. .task = INIT_TASK(init_task_mem.s.task),
  37. .thread_info = INIT_THREAD_INFO(init_task_mem.s.task)
  38. }};
  39. EXPORT_SYMBOL(init_task);