asm-offsets.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Generate definitions needed by assembly language modules.
  4. * This code generates raw asm output which is post-processed
  5. * to extract and format the required data.
  6. */
  7. #define ASM_OFFSETS_C 1
  8. #include <linux/sched/signal.h>
  9. #include <linux/pid.h>
  10. #include <linux/clocksource.h>
  11. #include <linux/kbuild.h>
  12. #include <asm/processor.h>
  13. #include <asm/ptrace.h>
  14. #include <asm/siginfo.h>
  15. #include <asm/sigcontext.h>
  16. #include <asm/mca.h>
  17. #include "../kernel/sigframe.h"
  18. #include "../kernel/fsyscall_gtod_data.h"
  19. void foo(void)
  20. {
  21. DEFINE(IA64_TASK_SIZE, sizeof (struct task_struct));
  22. DEFINE(IA64_THREAD_INFO_SIZE, sizeof (struct thread_info));
  23. DEFINE(IA64_PT_REGS_SIZE, sizeof (struct pt_regs));
  24. DEFINE(IA64_SWITCH_STACK_SIZE, sizeof (struct switch_stack));
  25. DEFINE(IA64_SIGINFO_SIZE, sizeof (struct siginfo));
  26. DEFINE(IA64_CPU_SIZE, sizeof (struct cpuinfo_ia64));
  27. DEFINE(SIGFRAME_SIZE, sizeof (struct sigframe));
  28. DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info));
  29. BUILD_BUG_ON(sizeof(struct upid) != 16);
  30. DEFINE(IA64_UPID_SHIFT, 4);
  31. BLANK();
  32. DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
  33. DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
  34. DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
  35. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  36. DEFINE(TI_AC_STAMP, offsetof(struct thread_info, ac_stamp));
  37. DEFINE(TI_AC_LEAVE, offsetof(struct thread_info, ac_leave));
  38. DEFINE(TI_AC_STIME, offsetof(struct thread_info, ac_stime));
  39. DEFINE(TI_AC_UTIME, offsetof(struct thread_info, ac_utime));
  40. #endif
  41. BLANK();
  42. DEFINE(IA64_TASK_BLOCKED_OFFSET,offsetof (struct task_struct, blocked));
  43. DEFINE(IA64_TASK_CLEAR_CHILD_TID_OFFSET,offsetof (struct task_struct, clear_child_tid));
  44. DEFINE(IA64_TASK_THREAD_PID_OFFSET,offsetof (struct task_struct, thread_pid));
  45. DEFINE(IA64_PID_LEVEL_OFFSET, offsetof (struct pid, level));
  46. DEFINE(IA64_PID_UPID_OFFSET, offsetof (struct pid, numbers[0]));
  47. DEFINE(IA64_TASK_PENDING_OFFSET,offsetof (struct task_struct, pending));
  48. DEFINE(IA64_TASK_PID_OFFSET, offsetof (struct task_struct, pid));
  49. DEFINE(IA64_TASK_REAL_PARENT_OFFSET, offsetof (struct task_struct, real_parent));
  50. DEFINE(IA64_TASK_SIGNAL_OFFSET,offsetof (struct task_struct, signal));
  51. DEFINE(IA64_TASK_TGID_OFFSET, offsetof (struct task_struct, tgid));
  52. DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct task_struct, thread.ksp));
  53. DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct task_struct, thread.on_ustack));
  54. BLANK();
  55. DEFINE(IA64_SIGNAL_GROUP_STOP_COUNT_OFFSET,offsetof (struct signal_struct,
  56. group_stop_count));
  57. DEFINE(IA64_SIGNAL_SHARED_PENDING_OFFSET,offsetof (struct signal_struct, shared_pending));
  58. DEFINE(IA64_SIGNAL_PIDS_TGID_OFFSET, offsetof (struct signal_struct, pids[PIDTYPE_TGID]));
  59. BLANK();
  60. DEFINE(IA64_PT_REGS_B6_OFFSET, offsetof (struct pt_regs, b6));
  61. DEFINE(IA64_PT_REGS_B7_OFFSET, offsetof (struct pt_regs, b7));
  62. DEFINE(IA64_PT_REGS_AR_CSD_OFFSET, offsetof (struct pt_regs, ar_csd));
  63. DEFINE(IA64_PT_REGS_AR_SSD_OFFSET, offsetof (struct pt_regs, ar_ssd));
  64. DEFINE(IA64_PT_REGS_R8_OFFSET, offsetof (struct pt_regs, r8));
  65. DEFINE(IA64_PT_REGS_R9_OFFSET, offsetof (struct pt_regs, r9));
  66. DEFINE(IA64_PT_REGS_R10_OFFSET, offsetof (struct pt_regs, r10));
  67. DEFINE(IA64_PT_REGS_R11_OFFSET, offsetof (struct pt_regs, r11));
  68. DEFINE(IA64_PT_REGS_CR_IPSR_OFFSET, offsetof (struct pt_regs, cr_ipsr));
  69. DEFINE(IA64_PT_REGS_CR_IIP_OFFSET, offsetof (struct pt_regs, cr_iip));
  70. DEFINE(IA64_PT_REGS_CR_IFS_OFFSET, offsetof (struct pt_regs, cr_ifs));
  71. DEFINE(IA64_PT_REGS_AR_UNAT_OFFSET, offsetof (struct pt_regs, ar_unat));
  72. DEFINE(IA64_PT_REGS_AR_PFS_OFFSET, offsetof (struct pt_regs, ar_pfs));
  73. DEFINE(IA64_PT_REGS_AR_RSC_OFFSET, offsetof (struct pt_regs, ar_rsc));
  74. DEFINE(IA64_PT_REGS_AR_RNAT_OFFSET, offsetof (struct pt_regs, ar_rnat));
  75. DEFINE(IA64_PT_REGS_AR_BSPSTORE_OFFSET, offsetof (struct pt_regs, ar_bspstore));
  76. DEFINE(IA64_PT_REGS_PR_OFFSET, offsetof (struct pt_regs, pr));
  77. DEFINE(IA64_PT_REGS_B0_OFFSET, offsetof (struct pt_regs, b0));
  78. DEFINE(IA64_PT_REGS_LOADRS_OFFSET, offsetof (struct pt_regs, loadrs));
  79. DEFINE(IA64_PT_REGS_R1_OFFSET, offsetof (struct pt_regs, r1));
  80. DEFINE(IA64_PT_REGS_R12_OFFSET, offsetof (struct pt_regs, r12));
  81. DEFINE(IA64_PT_REGS_R13_OFFSET, offsetof (struct pt_regs, r13));
  82. DEFINE(IA64_PT_REGS_AR_FPSR_OFFSET, offsetof (struct pt_regs, ar_fpsr));
  83. DEFINE(IA64_PT_REGS_R15_OFFSET, offsetof (struct pt_regs, r15));
  84. DEFINE(IA64_PT_REGS_R14_OFFSET, offsetof (struct pt_regs, r14));
  85. DEFINE(IA64_PT_REGS_R2_OFFSET, offsetof (struct pt_regs, r2));
  86. DEFINE(IA64_PT_REGS_R3_OFFSET, offsetof (struct pt_regs, r3));
  87. DEFINE(IA64_PT_REGS_R16_OFFSET, offsetof (struct pt_regs, r16));
  88. DEFINE(IA64_PT_REGS_R17_OFFSET, offsetof (struct pt_regs, r17));
  89. DEFINE(IA64_PT_REGS_R18_OFFSET, offsetof (struct pt_regs, r18));
  90. DEFINE(IA64_PT_REGS_R19_OFFSET, offsetof (struct pt_regs, r19));
  91. DEFINE(IA64_PT_REGS_R20_OFFSET, offsetof (struct pt_regs, r20));
  92. DEFINE(IA64_PT_REGS_R21_OFFSET, offsetof (struct pt_regs, r21));
  93. DEFINE(IA64_PT_REGS_R22_OFFSET, offsetof (struct pt_regs, r22));
  94. DEFINE(IA64_PT_REGS_R23_OFFSET, offsetof (struct pt_regs, r23));
  95. DEFINE(IA64_PT_REGS_R24_OFFSET, offsetof (struct pt_regs, r24));
  96. DEFINE(IA64_PT_REGS_R25_OFFSET, offsetof (struct pt_regs, r25));
  97. DEFINE(IA64_PT_REGS_R26_OFFSET, offsetof (struct pt_regs, r26));
  98. DEFINE(IA64_PT_REGS_R27_OFFSET, offsetof (struct pt_regs, r27));
  99. DEFINE(IA64_PT_REGS_R28_OFFSET, offsetof (struct pt_regs, r28));
  100. DEFINE(IA64_PT_REGS_R29_OFFSET, offsetof (struct pt_regs, r29));
  101. DEFINE(IA64_PT_REGS_R30_OFFSET, offsetof (struct pt_regs, r30));
  102. DEFINE(IA64_PT_REGS_R31_OFFSET, offsetof (struct pt_regs, r31));
  103. DEFINE(IA64_PT_REGS_AR_CCV_OFFSET, offsetof (struct pt_regs, ar_ccv));
  104. DEFINE(IA64_PT_REGS_F6_OFFSET, offsetof (struct pt_regs, f6));
  105. DEFINE(IA64_PT_REGS_F7_OFFSET, offsetof (struct pt_regs, f7));
  106. DEFINE(IA64_PT_REGS_F8_OFFSET, offsetof (struct pt_regs, f8));
  107. DEFINE(IA64_PT_REGS_F9_OFFSET, offsetof (struct pt_regs, f9));
  108. DEFINE(IA64_PT_REGS_F10_OFFSET, offsetof (struct pt_regs, f10));
  109. DEFINE(IA64_PT_REGS_F11_OFFSET, offsetof (struct pt_regs, f11));
  110. BLANK();
  111. DEFINE(IA64_SWITCH_STACK_CALLER_UNAT_OFFSET, offsetof (struct switch_stack, caller_unat));
  112. DEFINE(IA64_SWITCH_STACK_AR_FPSR_OFFSET, offsetof (struct switch_stack, ar_fpsr));
  113. DEFINE(IA64_SWITCH_STACK_F2_OFFSET, offsetof (struct switch_stack, f2));
  114. DEFINE(IA64_SWITCH_STACK_F3_OFFSET, offsetof (struct switch_stack, f3));
  115. DEFINE(IA64_SWITCH_STACK_F4_OFFSET, offsetof (struct switch_stack, f4));
  116. DEFINE(IA64_SWITCH_STACK_F5_OFFSET, offsetof (struct switch_stack, f5));
  117. DEFINE(IA64_SWITCH_STACK_F12_OFFSET, offsetof (struct switch_stack, f12));
  118. DEFINE(IA64_SWITCH_STACK_F13_OFFSET, offsetof (struct switch_stack, f13));
  119. DEFINE(IA64_SWITCH_STACK_F14_OFFSET, offsetof (struct switch_stack, f14));
  120. DEFINE(IA64_SWITCH_STACK_F15_OFFSET, offsetof (struct switch_stack, f15));
  121. DEFINE(IA64_SWITCH_STACK_F16_OFFSET, offsetof (struct switch_stack, f16));
  122. DEFINE(IA64_SWITCH_STACK_F17_OFFSET, offsetof (struct switch_stack, f17));
  123. DEFINE(IA64_SWITCH_STACK_F18_OFFSET, offsetof (struct switch_stack, f18));
  124. DEFINE(IA64_SWITCH_STACK_F19_OFFSET, offsetof (struct switch_stack, f19));
  125. DEFINE(IA64_SWITCH_STACK_F20_OFFSET, offsetof (struct switch_stack, f20));
  126. DEFINE(IA64_SWITCH_STACK_F21_OFFSET, offsetof (struct switch_stack, f21));
  127. DEFINE(IA64_SWITCH_STACK_F22_OFFSET, offsetof (struct switch_stack, f22));
  128. DEFINE(IA64_SWITCH_STACK_F23_OFFSET, offsetof (struct switch_stack, f23));
  129. DEFINE(IA64_SWITCH_STACK_F24_OFFSET, offsetof (struct switch_stack, f24));
  130. DEFINE(IA64_SWITCH_STACK_F25_OFFSET, offsetof (struct switch_stack, f25));
  131. DEFINE(IA64_SWITCH_STACK_F26_OFFSET, offsetof (struct switch_stack, f26));
  132. DEFINE(IA64_SWITCH_STACK_F27_OFFSET, offsetof (struct switch_stack, f27));
  133. DEFINE(IA64_SWITCH_STACK_F28_OFFSET, offsetof (struct switch_stack, f28));
  134. DEFINE(IA64_SWITCH_STACK_F29_OFFSET, offsetof (struct switch_stack, f29));
  135. DEFINE(IA64_SWITCH_STACK_F30_OFFSET, offsetof (struct switch_stack, f30));
  136. DEFINE(IA64_SWITCH_STACK_F31_OFFSET, offsetof (struct switch_stack, f31));
  137. DEFINE(IA64_SWITCH_STACK_R4_OFFSET, offsetof (struct switch_stack, r4));
  138. DEFINE(IA64_SWITCH_STACK_R5_OFFSET, offsetof (struct switch_stack, r5));
  139. DEFINE(IA64_SWITCH_STACK_R6_OFFSET, offsetof (struct switch_stack, r6));
  140. DEFINE(IA64_SWITCH_STACK_R7_OFFSET, offsetof (struct switch_stack, r7));
  141. DEFINE(IA64_SWITCH_STACK_B0_OFFSET, offsetof (struct switch_stack, b0));
  142. DEFINE(IA64_SWITCH_STACK_B1_OFFSET, offsetof (struct switch_stack, b1));
  143. DEFINE(IA64_SWITCH_STACK_B2_OFFSET, offsetof (struct switch_stack, b2));
  144. DEFINE(IA64_SWITCH_STACK_B3_OFFSET, offsetof (struct switch_stack, b3));
  145. DEFINE(IA64_SWITCH_STACK_B4_OFFSET, offsetof (struct switch_stack, b4));
  146. DEFINE(IA64_SWITCH_STACK_B5_OFFSET, offsetof (struct switch_stack, b5));
  147. DEFINE(IA64_SWITCH_STACK_AR_PFS_OFFSET, offsetof (struct switch_stack, ar_pfs));
  148. DEFINE(IA64_SWITCH_STACK_AR_LC_OFFSET, offsetof (struct switch_stack, ar_lc));
  149. DEFINE(IA64_SWITCH_STACK_AR_UNAT_OFFSET, offsetof (struct switch_stack, ar_unat));
  150. DEFINE(IA64_SWITCH_STACK_AR_RNAT_OFFSET, offsetof (struct switch_stack, ar_rnat));
  151. DEFINE(IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET, offsetof (struct switch_stack, ar_bspstore));
  152. DEFINE(IA64_SWITCH_STACK_PR_OFFSET, offsetof (struct switch_stack, pr));
  153. BLANK();
  154. DEFINE(IA64_SIGCONTEXT_IP_OFFSET, offsetof (struct sigcontext, sc_ip));
  155. DEFINE(IA64_SIGCONTEXT_AR_BSP_OFFSET, offsetof (struct sigcontext, sc_ar_bsp));
  156. DEFINE(IA64_SIGCONTEXT_AR_FPSR_OFFSET, offsetof (struct sigcontext, sc_ar_fpsr));
  157. DEFINE(IA64_SIGCONTEXT_AR_RNAT_OFFSET, offsetof (struct sigcontext, sc_ar_rnat));
  158. DEFINE(IA64_SIGCONTEXT_AR_UNAT_OFFSET, offsetof (struct sigcontext, sc_ar_unat));
  159. DEFINE(IA64_SIGCONTEXT_B0_OFFSET, offsetof (struct sigcontext, sc_br[0]));
  160. DEFINE(IA64_SIGCONTEXT_CFM_OFFSET, offsetof (struct sigcontext, sc_cfm));
  161. DEFINE(IA64_SIGCONTEXT_FLAGS_OFFSET, offsetof (struct sigcontext, sc_flags));
  162. DEFINE(IA64_SIGCONTEXT_FR6_OFFSET, offsetof (struct sigcontext, sc_fr[6]));
  163. DEFINE(IA64_SIGCONTEXT_PR_OFFSET, offsetof (struct sigcontext, sc_pr));
  164. DEFINE(IA64_SIGCONTEXT_R12_OFFSET, offsetof (struct sigcontext, sc_gr[12]));
  165. DEFINE(IA64_SIGCONTEXT_RBS_BASE_OFFSET,offsetof (struct sigcontext, sc_rbs_base));
  166. DEFINE(IA64_SIGCONTEXT_LOADRS_OFFSET, offsetof (struct sigcontext, sc_loadrs));
  167. BLANK();
  168. DEFINE(IA64_SIGPENDING_SIGNAL_OFFSET, offsetof (struct sigpending, signal));
  169. BLANK();
  170. DEFINE(IA64_SIGFRAME_ARG0_OFFSET, offsetof (struct sigframe, arg0));
  171. DEFINE(IA64_SIGFRAME_ARG1_OFFSET, offsetof (struct sigframe, arg1));
  172. DEFINE(IA64_SIGFRAME_ARG2_OFFSET, offsetof (struct sigframe, arg2));
  173. DEFINE(IA64_SIGFRAME_HANDLER_OFFSET, offsetof (struct sigframe, handler));
  174. DEFINE(IA64_SIGFRAME_SIGCONTEXT_OFFSET, offsetof (struct sigframe, sc));
  175. BLANK();
  176. /* for assembly files which can't include sched.h: */
  177. DEFINE(IA64_CLONE_VFORK, CLONE_VFORK);
  178. DEFINE(IA64_CLONE_VM, CLONE_VM);
  179. BLANK();
  180. DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET,
  181. offsetof (struct cpuinfo_ia64, nsec_per_cyc));
  182. DEFINE(IA64_CPUINFO_PTCE_BASE_OFFSET,
  183. offsetof (struct cpuinfo_ia64, ptce_base));
  184. DEFINE(IA64_CPUINFO_PTCE_COUNT_OFFSET,
  185. offsetof (struct cpuinfo_ia64, ptce_count));
  186. DEFINE(IA64_CPUINFO_PTCE_STRIDE_OFFSET,
  187. offsetof (struct cpuinfo_ia64, ptce_stride));
  188. BLANK();
  189. DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET,
  190. offsetof (struct timespec, tv_nsec));
  191. DEFINE(IA64_TIME_SN_SPEC_SNSEC_OFFSET,
  192. offsetof (struct time_sn_spec, snsec));
  193. DEFINE(CLONE_SETTLS_BIT, 19);
  194. #if CLONE_SETTLS != (1<<19)
  195. # error "CLONE_SETTLS_BIT incorrect, please fix"
  196. #endif
  197. BLANK();
  198. DEFINE(IA64_MCA_CPU_MCA_STACK_OFFSET,
  199. offsetof (struct ia64_mca_cpu, mca_stack));
  200. DEFINE(IA64_MCA_CPU_INIT_STACK_OFFSET,
  201. offsetof (struct ia64_mca_cpu, init_stack));
  202. BLANK();
  203. DEFINE(IA64_SAL_OS_STATE_OS_GP_OFFSET,
  204. offsetof (struct ia64_sal_os_state, os_gp));
  205. DEFINE(IA64_SAL_OS_STATE_PROC_STATE_PARAM_OFFSET,
  206. offsetof (struct ia64_sal_os_state, proc_state_param));
  207. DEFINE(IA64_SAL_OS_STATE_SAL_RA_OFFSET,
  208. offsetof (struct ia64_sal_os_state, sal_ra));
  209. DEFINE(IA64_SAL_OS_STATE_SAL_GP_OFFSET,
  210. offsetof (struct ia64_sal_os_state, sal_gp));
  211. DEFINE(IA64_SAL_OS_STATE_PAL_MIN_STATE_OFFSET,
  212. offsetof (struct ia64_sal_os_state, pal_min_state));
  213. DEFINE(IA64_SAL_OS_STATE_OS_STATUS_OFFSET,
  214. offsetof (struct ia64_sal_os_state, os_status));
  215. DEFINE(IA64_SAL_OS_STATE_CONTEXT_OFFSET,
  216. offsetof (struct ia64_sal_os_state, context));
  217. DEFINE(IA64_SAL_OS_STATE_SIZE,
  218. sizeof (struct ia64_sal_os_state));
  219. BLANK();
  220. DEFINE(IA64_PMSA_GR_OFFSET,
  221. offsetof (struct pal_min_state_area_s, pmsa_gr));
  222. DEFINE(IA64_PMSA_BANK1_GR_OFFSET,
  223. offsetof (struct pal_min_state_area_s, pmsa_bank1_gr));
  224. DEFINE(IA64_PMSA_PR_OFFSET,
  225. offsetof (struct pal_min_state_area_s, pmsa_pr));
  226. DEFINE(IA64_PMSA_BR0_OFFSET,
  227. offsetof (struct pal_min_state_area_s, pmsa_br0));
  228. DEFINE(IA64_PMSA_RSC_OFFSET,
  229. offsetof (struct pal_min_state_area_s, pmsa_rsc));
  230. DEFINE(IA64_PMSA_IIP_OFFSET,
  231. offsetof (struct pal_min_state_area_s, pmsa_iip));
  232. DEFINE(IA64_PMSA_IPSR_OFFSET,
  233. offsetof (struct pal_min_state_area_s, pmsa_ipsr));
  234. DEFINE(IA64_PMSA_IFS_OFFSET,
  235. offsetof (struct pal_min_state_area_s, pmsa_ifs));
  236. DEFINE(IA64_PMSA_XIP_OFFSET,
  237. offsetof (struct pal_min_state_area_s, pmsa_xip));
  238. BLANK();
  239. /* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */
  240. DEFINE(IA64_GTOD_SEQ_OFFSET,
  241. offsetof (struct fsyscall_gtod_data_t, seq));
  242. DEFINE(IA64_GTOD_WALL_TIME_OFFSET,
  243. offsetof (struct fsyscall_gtod_data_t, wall_time));
  244. DEFINE(IA64_GTOD_MONO_TIME_OFFSET,
  245. offsetof (struct fsyscall_gtod_data_t, monotonic_time));
  246. DEFINE(IA64_CLKSRC_MASK_OFFSET,
  247. offsetof (struct fsyscall_gtod_data_t, clk_mask));
  248. DEFINE(IA64_CLKSRC_MULT_OFFSET,
  249. offsetof (struct fsyscall_gtod_data_t, clk_mult));
  250. DEFINE(IA64_CLKSRC_SHIFT_OFFSET,
  251. offsetof (struct fsyscall_gtod_data_t, clk_shift));
  252. DEFINE(IA64_CLKSRC_MMIO_OFFSET,
  253. offsetof (struct fsyscall_gtod_data_t, clk_fsys_mmio));
  254. DEFINE(IA64_CLKSRC_CYCLE_LAST_OFFSET,
  255. offsetof (struct fsyscall_gtod_data_t, clk_cycle_last));
  256. DEFINE(IA64_ITC_JITTER_OFFSET,
  257. offsetof (struct itc_jitter_data_t, itc_jitter));
  258. DEFINE(IA64_ITC_LASTCYCLE_OFFSET,
  259. offsetof (struct itc_jitter_data_t, itc_lastcycle));
  260. }