init_task.c 1.6 KB

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