thread_info.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * S390 version
  3. * Copyright IBM Corp. 2002, 2006
  4. * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
  5. */
  6. #ifndef _ASM_THREAD_INFO_H
  7. #define _ASM_THREAD_INFO_H
  8. #include <linux/const.h>
  9. /*
  10. * Size of kernel stack for each process
  11. */
  12. #define THREAD_ORDER 2
  13. #define ASYNC_ORDER 2
  14. #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
  15. #define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER)
  16. #ifndef __ASSEMBLY__
  17. #include <asm/lowcore.h>
  18. #include <asm/page.h>
  19. #include <asm/processor.h>
  20. /*
  21. * low level task data that entry.S needs immediate access to
  22. * - this struct should fit entirely inside of one cache line
  23. * - this struct shares the supervisor stack pages
  24. * - if the contents of this structure are changed, the assembly constants must also be changed
  25. */
  26. struct thread_info {
  27. struct task_struct *task; /* main task structure */
  28. unsigned long flags; /* low level flags */
  29. unsigned long sys_call_table; /* System call table address */
  30. unsigned int cpu; /* current CPU */
  31. int preempt_count; /* 0 => preemptable, <0 => BUG */
  32. unsigned int system_call;
  33. __u64 user_timer;
  34. __u64 system_timer;
  35. unsigned long last_break; /* last breaking-event-address. */
  36. };
  37. /*
  38. * macros/functions for gaining access to the thread information structure
  39. */
  40. #define INIT_THREAD_INFO(tsk) \
  41. { \
  42. .task = &tsk, \
  43. .flags = 0, \
  44. .cpu = 0, \
  45. .preempt_count = INIT_PREEMPT_COUNT, \
  46. }
  47. #define init_thread_info (init_thread_union.thread_info)
  48. #define init_stack (init_thread_union.stack)
  49. /* how to get the thread information struct from C */
  50. static inline struct thread_info *current_thread_info(void)
  51. {
  52. return (struct thread_info *) S390_lowcore.thread_info;
  53. }
  54. void arch_release_task_struct(struct task_struct *tsk);
  55. int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
  56. #define THREAD_SIZE_ORDER THREAD_ORDER
  57. #endif
  58. /*
  59. * thread information flags bit numbers
  60. */
  61. #define TIF_NOTIFY_RESUME 0 /* callback before returning to user */
  62. #define TIF_SIGPENDING 1 /* signal pending */
  63. #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
  64. #define TIF_SYSCALL_TRACE 3 /* syscall trace active */
  65. #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */
  66. #define TIF_SECCOMP 5 /* secure computing */
  67. #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */
  68. #define TIF_UPROBE 7 /* breakpointed or single-stepping */
  69. #define TIF_ISOLATE_BP 8 /* Run process with isolated BP */
  70. #define TIF_ISOLATE_BP_GUEST 9 /* Run KVM guests with isolated BP */
  71. #define TIF_31BIT 16 /* 32bit process */
  72. #define TIF_MEMDIE 17 /* is terminating due to OOM killer */
  73. #define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal() */
  74. #define TIF_SINGLE_STEP 19 /* This task is single stepped */
  75. #define TIF_BLOCK_STEP 20 /* This task is block stepped */
  76. #define TIF_UPROBE_SINGLESTEP 21 /* This task is uprobe single stepped */
  77. #define _TIF_NOTIFY_RESUME _BITUL(TIF_NOTIFY_RESUME)
  78. #define _TIF_SIGPENDING _BITUL(TIF_SIGPENDING)
  79. #define _TIF_NEED_RESCHED _BITUL(TIF_NEED_RESCHED)
  80. #define _TIF_SYSCALL_TRACE _BITUL(TIF_SYSCALL_TRACE)
  81. #define _TIF_SYSCALL_AUDIT _BITUL(TIF_SYSCALL_AUDIT)
  82. #define _TIF_SECCOMP _BITUL(TIF_SECCOMP)
  83. #define _TIF_SYSCALL_TRACEPOINT _BITUL(TIF_SYSCALL_TRACEPOINT)
  84. #define _TIF_UPROBE _BITUL(TIF_UPROBE)
  85. #define _TIF_ISOLATE_BP _BITUL(TIF_ISOLATE_BP)
  86. #define _TIF_ISOLATE_BP_GUEST _BITUL(TIF_ISOLATE_BP_GUEST)
  87. #define _TIF_31BIT _BITUL(TIF_31BIT)
  88. #define _TIF_SINGLE_STEP _BITUL(TIF_SINGLE_STEP)
  89. #endif /* _ASM_THREAD_INFO_H */