thread_info.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. struct exec_domain *exec_domain;/* execution domain */
  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. struct restart_block restart_block;
  15. };
  16. #define INIT_THREAD_INFO(tsk) \
  17. { \
  18. .task = &tsk, \
  19. .exec_domain = &default_exec_domain, \
  20. .flags = 0, \
  21. .cpu = 0, \
  22. .addr_limit = KERNEL_DS, \
  23. .preempt_count = INIT_PREEMPT_COUNT, \
  24. .restart_block = { \
  25. .fn = do_no_restart_syscall \
  26. } \
  27. }
  28. #define init_thread_info (init_thread_union.thread_info)
  29. #define init_stack (init_thread_union.stack)
  30. /* how to get the thread information struct from C */
  31. #define current_thread_info() ((struct thread_info *)mfctl(30))
  32. #endif /* !__ASSEMBLY */
  33. /* thread information allocation */
  34. #define THREAD_SIZE_ORDER 2
  35. /* Be sure to hunt all references to this down when you change the size of
  36. * the kernel stack */
  37. #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
  38. #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
  39. #define PREEMPT_ACTIVE_BIT 28
  40. #define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
  41. /*
  42. * thread information flags
  43. */
  44. #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
  45. #define TIF_SIGPENDING 1 /* signal pending */
  46. #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
  47. #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
  48. #define TIF_32BIT 4 /* 32 bit binary */
  49. #define TIF_MEMDIE 5 /* is terminating due to OOM killer */
  50. #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
  51. #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
  52. #define TIF_SINGLESTEP 9 /* single stepping? */
  53. #define TIF_BLOCKSTEP 10 /* branch stepping? */
  54. #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
  55. #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
  56. #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
  57. #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
  58. #define _TIF_32BIT (1 << TIF_32BIT)
  59. #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
  60. #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
  61. #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
  62. #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
  63. #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
  64. _TIF_NEED_RESCHED)
  65. #endif /* __KERNEL__ */
  66. #endif /* _ASM_PARISC_THREAD_INFO_H */