thread_info.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef _ASM_M68K_THREAD_INFO_H
  2. #define _ASM_M68K_THREAD_INFO_H
  3. #include <asm/types.h>
  4. #include <asm/page.h>
  5. #include <asm/segment.h>
  6. /*
  7. * On machines with 4k pages we default to an 8k thread size, though we
  8. * allow a 4k with config option. Any other machine page size then
  9. * the thread size must match the page size (which is 8k and larger here).
  10. */
  11. #if PAGE_SHIFT < 13
  12. #ifdef CONFIG_4KSTACKS
  13. #define THREAD_SIZE 4096
  14. #else
  15. #define THREAD_SIZE 8192
  16. #endif
  17. #else
  18. #define THREAD_SIZE PAGE_SIZE
  19. #endif
  20. #define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1)
  21. #ifndef __ASSEMBLY__
  22. struct thread_info {
  23. struct task_struct *task; /* main task structure */
  24. unsigned long flags;
  25. struct exec_domain *exec_domain; /* execution domain */
  26. mm_segment_t addr_limit; /* thread address space */
  27. int preempt_count; /* 0 => preemptable, <0 => BUG */
  28. __u32 cpu; /* should always be 0 on m68k */
  29. unsigned long tp_value; /* thread pointer */
  30. struct restart_block restart_block;
  31. };
  32. #endif /* __ASSEMBLY__ */
  33. #define PREEMPT_ACTIVE 0x4000000
  34. #define INIT_THREAD_INFO(tsk) \
  35. { \
  36. .task = &tsk, \
  37. .exec_domain = &default_exec_domain, \
  38. .addr_limit = KERNEL_DS, \
  39. .preempt_count = INIT_PREEMPT_COUNT, \
  40. .restart_block = { \
  41. .fn = do_no_restart_syscall, \
  42. }, \
  43. }
  44. #define init_stack (init_thread_union.stack)
  45. #ifndef __ASSEMBLY__
  46. /* how to get the thread information struct from C */
  47. static inline struct thread_info *current_thread_info(void)
  48. {
  49. struct thread_info *ti;
  50. __asm__(
  51. "move.l %%sp, %0 \n\t"
  52. "and.l %1, %0"
  53. : "=&d"(ti)
  54. : "di" (~(THREAD_SIZE-1))
  55. );
  56. return ti;
  57. }
  58. #endif
  59. #define init_thread_info (init_thread_union.thread_info)
  60. /* entry.S relies on these definitions!
  61. * bits 0-7 are tested at every exception exit
  62. * bits 8-15 are also tested at syscall exit
  63. */
  64. #define TIF_SIGPENDING 6 /* signal pending */
  65. #define TIF_NEED_RESCHED 7 /* rescheduling necessary */
  66. #define TIF_DELAYED_TRACE 14 /* single step a syscall */
  67. #define TIF_SYSCALL_TRACE 15 /* syscall trace active */
  68. #define TIF_MEMDIE 16 /* is terminating due to OOM killer */
  69. #define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal */
  70. #endif /* _ASM_M68K_THREAD_INFO_H */