asm-offsets.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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/signal.h>
  8. #include <linux/personality.h>
  9. #include <linux/kbuild.h>
  10. #include <asm/ucontext.h>
  11. #include <asm/processor.h>
  12. #include <asm/thread_info.h>
  13. #include <asm/ptrace.h>
  14. #include "sigframe.h"
  15. #include "mn10300-serial.h"
  16. void foo(void)
  17. {
  18. OFFSET(SIGCONTEXT_d0, sigcontext, d0);
  19. OFFSET(SIGCONTEXT_d1, sigcontext, d1);
  20. BLANK();
  21. OFFSET(TI_task, thread_info, task);
  22. OFFSET(TI_frame, thread_info, frame);
  23. OFFSET(TI_flags, thread_info, flags);
  24. OFFSET(TI_cpu, thread_info, cpu);
  25. OFFSET(TI_preempt_count, thread_info, preempt_count);
  26. OFFSET(TI_addr_limit, thread_info, addr_limit);
  27. BLANK();
  28. OFFSET(REG_D0, pt_regs, d0);
  29. OFFSET(REG_D1, pt_regs, d1);
  30. OFFSET(REG_D2, pt_regs, d2);
  31. OFFSET(REG_D3, pt_regs, d3);
  32. OFFSET(REG_A0, pt_regs, a0);
  33. OFFSET(REG_A1, pt_regs, a1);
  34. OFFSET(REG_A2, pt_regs, a2);
  35. OFFSET(REG_A3, pt_regs, a3);
  36. OFFSET(REG_E0, pt_regs, e0);
  37. OFFSET(REG_E1, pt_regs, e1);
  38. OFFSET(REG_E2, pt_regs, e2);
  39. OFFSET(REG_E3, pt_regs, e3);
  40. OFFSET(REG_E4, pt_regs, e4);
  41. OFFSET(REG_E5, pt_regs, e5);
  42. OFFSET(REG_E6, pt_regs, e6);
  43. OFFSET(REG_E7, pt_regs, e7);
  44. OFFSET(REG_SP, pt_regs, sp);
  45. OFFSET(REG_EPSW, pt_regs, epsw);
  46. OFFSET(REG_PC, pt_regs, pc);
  47. OFFSET(REG_LAR, pt_regs, lar);
  48. OFFSET(REG_LIR, pt_regs, lir);
  49. OFFSET(REG_MDR, pt_regs, mdr);
  50. OFFSET(REG_MCVF, pt_regs, mcvf);
  51. OFFSET(REG_MCRL, pt_regs, mcrl);
  52. OFFSET(REG_MCRH, pt_regs, mcrh);
  53. OFFSET(REG_MDRQ, pt_regs, mdrq);
  54. OFFSET(REG_ORIG_D0, pt_regs, orig_d0);
  55. OFFSET(REG_NEXT, pt_regs, next);
  56. DEFINE(REG__END, sizeof(struct pt_regs));
  57. BLANK();
  58. OFFSET(THREAD_UREGS, thread_struct, uregs);
  59. OFFSET(THREAD_PC, thread_struct, pc);
  60. OFFSET(THREAD_SP, thread_struct, sp);
  61. OFFSET(THREAD_A3, thread_struct, a3);
  62. OFFSET(THREAD_USP, thread_struct, usp);
  63. #ifdef CONFIG_FPU
  64. OFFSET(THREAD_FPU_FLAGS, thread_struct, fpu_flags);
  65. OFFSET(THREAD_FPU_STATE, thread_struct, fpu_state);
  66. DEFINE(__THREAD_USING_FPU, THREAD_USING_FPU);
  67. DEFINE(__THREAD_HAS_FPU, THREAD_HAS_FPU);
  68. #endif /* CONFIG_FPU */
  69. BLANK();
  70. OFFSET(TASK_THREAD, task_struct, thread);
  71. BLANK();
  72. DEFINE(CLONE_VM_asm, CLONE_VM);
  73. DEFINE(CLONE_FS_asm, CLONE_FS);
  74. DEFINE(CLONE_FILES_asm, CLONE_FILES);
  75. DEFINE(CLONE_SIGHAND_asm, CLONE_SIGHAND);
  76. DEFINE(CLONE_UNTRACED_asm, CLONE_UNTRACED);
  77. DEFINE(SIGCHLD_asm, SIGCHLD);
  78. BLANK();
  79. OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
  80. DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
  81. OFFSET(__rx_buffer, mn10300_serial_port, rx_buffer);
  82. OFFSET(__rx_inp, mn10300_serial_port, rx_inp);
  83. OFFSET(__rx_outp, mn10300_serial_port, rx_outp);
  84. OFFSET(__uart_state, mn10300_serial_port, uart.state);
  85. OFFSET(__tx_xchar, mn10300_serial_port, tx_xchar);
  86. OFFSET(__tx_flags, mn10300_serial_port, tx_flags);
  87. OFFSET(__intr_flags, mn10300_serial_port, intr_flags);
  88. OFFSET(__rx_icr, mn10300_serial_port, rx_icr);
  89. OFFSET(__tx_icr, mn10300_serial_port, tx_icr);
  90. OFFSET(__tm_icr, mn10300_serial_port, _tmicr);
  91. OFFSET(__iobase, mn10300_serial_port, _iobase);
  92. DEFINE(__UART_XMIT_SIZE, UART_XMIT_SIZE);
  93. OFFSET(__xmit_buffer, uart_state, xmit.buf);
  94. OFFSET(__xmit_head, uart_state, xmit.head);
  95. OFFSET(__xmit_tail, uart_state, xmit.tail);
  96. }