init_task.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Init task definition
  3. *
  4. * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 and
  8. * only version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. * 02110-1301, USA.
  19. */
  20. #include <linux/mm.h>
  21. #include <linux/module.h>
  22. #include <linux/sched.h>
  23. #include <linux/init_task.h>
  24. #include <linux/fs.h>
  25. #include <linux/mqueue.h>
  26. #include <asm/thread_info.h>
  27. #include <asm/uaccess.h>
  28. #include <asm/pgtable.h>
  29. static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
  30. static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
  31. /*
  32. * Initial thread structure.
  33. *
  34. * We need to make sure that this is 8192-byte aligned due to the
  35. * way process stacks are handled. This is done by making sure
  36. * the linker maps this in the .text segment right after head.S,
  37. * and making head.S ensure the proper alignment.
  38. */
  39. union thread_union init_thread_union
  40. __attribute__((__section__(".data.init_task"),
  41. __aligned__(THREAD_SIZE))) = {
  42. INIT_THREAD_INFO(init_task)
  43. };
  44. /*
  45. * Initial task structure.
  46. *
  47. * All other task structs will be allocated on slabs in fork.c
  48. */
  49. struct task_struct init_task = INIT_TASK(init_task);
  50. EXPORT_SYMBOL(init_task);