init_task.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. #include <linux/mm.h>
  15. #include <linux/fs.h>
  16. #include <linux/init_task.h>
  17. #include <linux/mqueue.h>
  18. #include <linux/module.h>
  19. #include <linux/start_kernel.h>
  20. #include <linux/uaccess.h>
  21. static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
  22. static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
  23. /*
  24. * Initial thread structure.
  25. *
  26. * We need to make sure that this is THREAD_SIZE aligned due to the
  27. * way process stacks are handled. This is done by having a special
  28. * "init_task" linker map entry..
  29. */
  30. union thread_union init_thread_union __init_task_data = {
  31. INIT_THREAD_INFO(init_task)
  32. };
  33. /*
  34. * Initial task structure.
  35. *
  36. * All other task structs will be allocated on slabs in fork.c
  37. */
  38. struct task_struct init_task = INIT_TASK(init_task);
  39. EXPORT_SYMBOL(init_task);
  40. /*
  41. * per-CPU stack and boot info.
  42. */
  43. DEFINE_PER_CPU(unsigned long, boot_sp) =
  44. (unsigned long)init_stack + THREAD_SIZE;
  45. #ifdef CONFIG_SMP
  46. DEFINE_PER_CPU(unsigned long, boot_pc) = (unsigned long)start_kernel;
  47. #else
  48. /*
  49. * The variable must be __initdata since it references __init code.
  50. * With CONFIG_SMP it is per-cpu data, which is exempt from validation.
  51. */
  52. unsigned long __initdata boot_pc = (unsigned long)start_kernel;
  53. #endif