thread_info.h 3.1 KB

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