thread_info.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef _ASM_PARISC_THREAD_INFO_H
  2. #define _ASM_PARISC_THREAD_INFO_H
  3. #ifdef __KERNEL__
  4. #ifndef __ASSEMBLY__
  5. #include <asm/processor.h>
  6. #include <asm/special_insns.h>
  7. struct thread_info {
  8. struct task_struct *task; /* main task structure */
  9. unsigned long flags; /* thread_info flags (see TIF_*) */
  10. mm_segment_t addr_limit; /* user-level address space limit */
  11. __u32 cpu; /* current CPU */
  12. int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
  13. };
  14. #define INIT_THREAD_INFO(tsk) \
  15. { \
  16. .task = &tsk, \
  17. .flags = 0, \
  18. .cpu = 0, \
  19. .addr_limit = KERNEL_DS, \
  20. .preempt_count = INIT_PREEMPT_COUNT, \
  21. }
  22. #define init_thread_info (init_thread_union.thread_info)
  23. #define init_stack (init_thread_union.stack)
  24. /* how to get the thread information struct from C */
  25. #define current_thread_info() ((struct thread_info *)mfctl(30))
  26. #endif /* !__ASSEMBLY */
  27. /* thread information allocation */
  28. #define THREAD_SIZE_ORDER 2 /* PA-RISC requires at least 16k stack */
  29. /* Be sure to hunt all references to this down when you change the size of
  30. * the kernel stack */
  31. #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
  32. #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
  33. /*
  34. * thread information flags
  35. */
  36. #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
  37. #define TIF_SIGPENDING 1 /* signal pending */
  38. #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
  39. #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
  40. #define TIF_32BIT 4 /* 32 bit binary */
  41. #define TIF_MEMDIE 5 /* is terminating due to OOM killer */
  42. #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
  43. #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
  44. #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
  45. #define TIF_SINGLESTEP 9 /* single stepping? */
  46. #define TIF_BLOCKSTEP 10 /* branch stepping? */
  47. #define TIF_SECCOMP 11 /* secure computing */
  48. #define TIF_SYSCALL_TRACEPOINT 12 /* syscall tracepoint instrumentation */
  49. #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
  50. #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
  51. #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
  52. #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
  53. #define _TIF_32BIT (1 << TIF_32BIT)
  54. #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
  55. #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
  56. #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
  57. #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
  58. #define _TIF_SECCOMP (1 << TIF_SECCOMP)
  59. #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
  60. #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
  61. _TIF_NEED_RESCHED)
  62. #define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
  63. _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \
  64. _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
  65. #ifdef CONFIG_64BIT
  66. # ifdef CONFIG_COMPAT
  67. # define is_32bit_task() (test_thread_flag(TIF_32BIT))
  68. # else
  69. # define is_32bit_task() (0)
  70. # endif
  71. #else
  72. # define is_32bit_task() (1)
  73. #endif
  74. #endif /* __KERNEL__ */
  75. #endif /* _ASM_PARISC_THREAD_INFO_H */