thread_info.h 3.0 KB

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