init_task.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #include "linux/config.h"
  6. #include "linux/mm.h"
  7. #include "linux/module.h"
  8. #include "linux/sched.h"
  9. #include "linux/init_task.h"
  10. #include "linux/mqueue.h"
  11. #include "linux/nsproxy.h"
  12. #include "asm/uaccess.h"
  13. #include "asm/pgtable.h"
  14. #include "user_util.h"
  15. #include "mem_user.h"
  16. #include "os.h"
  17. static struct fs_struct init_fs = INIT_FS;
  18. struct mm_struct init_mm = INIT_MM(init_mm);
  19. struct nsproxy init_nsproxy = INIT_NSPROXY(init_nsproxy);
  20. static struct files_struct init_files = INIT_FILES;
  21. static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
  22. static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
  23. EXPORT_SYMBOL(init_mm);
  24. /*
  25. * Initial task structure.
  26. *
  27. * All other task structs will be allocated on slabs in fork.c
  28. */
  29. struct task_struct init_task = INIT_TASK(init_task);
  30. EXPORT_SYMBOL(init_task);
  31. /*
  32. * Initial thread structure.
  33. *
  34. * We need to make sure that this is 16384-byte aligned due to the
  35. * way process stacks are handled. This is done by having a special
  36. * "init_task" linker map entry..
  37. */
  38. union thread_union init_thread_union
  39. __attribute__((__section__(".data.init_task"))) =
  40. { INIT_THREAD_INFO(init_task) };
  41. void unprotect_stack(unsigned long stack)
  42. {
  43. os_protect_memory((void *) stack, (1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE,
  44. 1, 1, 0);
  45. }
  46. /*
  47. * Overrides for Emacs so that we follow Linus's tabbing style.
  48. * Emacs will notice this stuff at the end of the file and automatically
  49. * adjust the settings for this buffer only. This must remain at the end
  50. * of the file.
  51. * ---------------------------------------------------------------------------
  52. * Local variables:
  53. * c-file-style: "linux"
  54. * End:
  55. */