asm-offsets.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Generate definitions needed by assembly language modules.
  3. * This code generates raw asm output which is post-processed
  4. * to extract and format the required data.
  5. */
  6. #include <linux/sched.h>
  7. #include <linux/thread_info.h>
  8. #include <asm/procinfo.h>
  9. #include <linux/kbuild.h>
  10. #include <linux/unistd.h>
  11. void foo(void)
  12. {
  13. OFFSET(REGS_A16, pt_regs, a16);
  14. OFFSET(REGS_A17, pt_regs, a17);
  15. OFFSET(REGS_A18, pt_regs, a18);
  16. OFFSET(REGS_A19, pt_regs, a19);
  17. OFFSET(REGS_A20, pt_regs, a20);
  18. OFFSET(REGS_A21, pt_regs, a21);
  19. OFFSET(REGS_A22, pt_regs, a22);
  20. OFFSET(REGS_A23, pt_regs, a23);
  21. OFFSET(REGS_A24, pt_regs, a24);
  22. OFFSET(REGS_A25, pt_regs, a25);
  23. OFFSET(REGS_A26, pt_regs, a26);
  24. OFFSET(REGS_A27, pt_regs, a27);
  25. OFFSET(REGS_A28, pt_regs, a28);
  26. OFFSET(REGS_A29, pt_regs, a29);
  27. OFFSET(REGS_A30, pt_regs, a30);
  28. OFFSET(REGS_A31, pt_regs, a31);
  29. OFFSET(REGS_B16, pt_regs, b16);
  30. OFFSET(REGS_B17, pt_regs, b17);
  31. OFFSET(REGS_B18, pt_regs, b18);
  32. OFFSET(REGS_B19, pt_regs, b19);
  33. OFFSET(REGS_B20, pt_regs, b20);
  34. OFFSET(REGS_B21, pt_regs, b21);
  35. OFFSET(REGS_B22, pt_regs, b22);
  36. OFFSET(REGS_B23, pt_regs, b23);
  37. OFFSET(REGS_B24, pt_regs, b24);
  38. OFFSET(REGS_B25, pt_regs, b25);
  39. OFFSET(REGS_B26, pt_regs, b26);
  40. OFFSET(REGS_B27, pt_regs, b27);
  41. OFFSET(REGS_B28, pt_regs, b28);
  42. OFFSET(REGS_B29, pt_regs, b29);
  43. OFFSET(REGS_B30, pt_regs, b30);
  44. OFFSET(REGS_B31, pt_regs, b31);
  45. OFFSET(REGS_A0, pt_regs, a0);
  46. OFFSET(REGS_A1, pt_regs, a1);
  47. OFFSET(REGS_A2, pt_regs, a2);
  48. OFFSET(REGS_A3, pt_regs, a3);
  49. OFFSET(REGS_A4, pt_regs, a4);
  50. OFFSET(REGS_A5, pt_regs, a5);
  51. OFFSET(REGS_A6, pt_regs, a6);
  52. OFFSET(REGS_A7, pt_regs, a7);
  53. OFFSET(REGS_A8, pt_regs, a8);
  54. OFFSET(REGS_A9, pt_regs, a9);
  55. OFFSET(REGS_A10, pt_regs, a10);
  56. OFFSET(REGS_A11, pt_regs, a11);
  57. OFFSET(REGS_A12, pt_regs, a12);
  58. OFFSET(REGS_A13, pt_regs, a13);
  59. OFFSET(REGS_A14, pt_regs, a14);
  60. OFFSET(REGS_A15, pt_regs, a15);
  61. OFFSET(REGS_B0, pt_regs, b0);
  62. OFFSET(REGS_B1, pt_regs, b1);
  63. OFFSET(REGS_B2, pt_regs, b2);
  64. OFFSET(REGS_B3, pt_regs, b3);
  65. OFFSET(REGS_B4, pt_regs, b4);
  66. OFFSET(REGS_B5, pt_regs, b5);
  67. OFFSET(REGS_B6, pt_regs, b6);
  68. OFFSET(REGS_B7, pt_regs, b7);
  69. OFFSET(REGS_B8, pt_regs, b8);
  70. OFFSET(REGS_B9, pt_regs, b9);
  71. OFFSET(REGS_B10, pt_regs, b10);
  72. OFFSET(REGS_B11, pt_regs, b11);
  73. OFFSET(REGS_B12, pt_regs, b12);
  74. OFFSET(REGS_B13, pt_regs, b13);
  75. OFFSET(REGS_DP, pt_regs, dp);
  76. OFFSET(REGS_SP, pt_regs, sp);
  77. OFFSET(REGS_TSR, pt_regs, tsr);
  78. OFFSET(REGS_ORIG_A4, pt_regs, orig_a4);
  79. DEFINE(REGS__END, sizeof(struct pt_regs));
  80. BLANK();
  81. OFFSET(THREAD_PC, thread_struct, pc);
  82. OFFSET(THREAD_B15_14, thread_struct, b15_14);
  83. OFFSET(THREAD_A15_14, thread_struct, a15_14);
  84. OFFSET(THREAD_B13_12, thread_struct, b13_12);
  85. OFFSET(THREAD_A13_12, thread_struct, a13_12);
  86. OFFSET(THREAD_B11_10, thread_struct, b11_10);
  87. OFFSET(THREAD_A11_10, thread_struct, a11_10);
  88. OFFSET(THREAD_RICL_ICL, thread_struct, ricl_icl);
  89. BLANK();
  90. OFFSET(TASK_STATE, task_struct, state);
  91. BLANK();
  92. OFFSET(THREAD_INFO_FLAGS, thread_info, flags);
  93. OFFSET(THREAD_INFO_PREEMPT_COUNT, thread_info, preempt_count);
  94. BLANK();
  95. /* These would be unneccessary if we ran asm files
  96. * through the preprocessor.
  97. */
  98. DEFINE(KTHREAD_SIZE, THREAD_SIZE);
  99. DEFINE(KTHREAD_SHIFT, THREAD_SHIFT);
  100. DEFINE(KTHREAD_START_SP, THREAD_START_SP);
  101. DEFINE(ENOSYS_, ENOSYS);
  102. DEFINE(NR_SYSCALLS_, __NR_syscalls);
  103. DEFINE(_TIF_SYSCALL_TRACE, (1<<TIF_SYSCALL_TRACE));
  104. DEFINE(_TIF_NOTIFY_RESUME, (1<<TIF_NOTIFY_RESUME));
  105. DEFINE(_TIF_SIGPENDING, (1<<TIF_SIGPENDING));
  106. DEFINE(_TIF_NEED_RESCHED, (1<<TIF_NEED_RESCHED));
  107. DEFINE(_TIF_ALLWORK_MASK, TIF_ALLWORK_MASK);
  108. DEFINE(_TIF_WORK_MASK, TIF_WORK_MASK);
  109. }