thread_info.h 2.9 KB

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