asm-offsets.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Generate definitions needed by assembly language modules.
  3. * This code generates raw asm output which is post-processed to extract
  4. * and format the required data.
  5. */
  6. #define COMPILE_OFFSETS
  7. #include <linux/crypto.h>
  8. #include <linux/sched.h>
  9. #include <linux/stddef.h>
  10. #include <linux/hardirq.h>
  11. #include <linux/suspend.h>
  12. #include <linux/kbuild.h>
  13. #include <asm/processor.h>
  14. #include <asm/thread_info.h>
  15. #include <asm/sigframe.h>
  16. #include <asm/bootparam.h>
  17. #include <asm/suspend.h>
  18. #ifdef CONFIG_XEN
  19. #include <xen/interface/xen.h>
  20. #endif
  21. #ifdef CONFIG_X86_32
  22. # include "asm-offsets_32.c"
  23. #else
  24. # include "asm-offsets_64.c"
  25. #endif
  26. void common(void) {
  27. BLANK();
  28. OFFSET(TI_flags, thread_info, flags);
  29. OFFSET(TI_status, thread_info, status);
  30. OFFSET(TI_addr_limit, thread_info, addr_limit);
  31. BLANK();
  32. OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
  33. BLANK();
  34. OFFSET(pbe_address, pbe, address);
  35. OFFSET(pbe_orig_address, pbe, orig_address);
  36. OFFSET(pbe_next, pbe, next);
  37. #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
  38. BLANK();
  39. OFFSET(IA32_SIGCONTEXT_ax, sigcontext_ia32, ax);
  40. OFFSET(IA32_SIGCONTEXT_bx, sigcontext_ia32, bx);
  41. OFFSET(IA32_SIGCONTEXT_cx, sigcontext_ia32, cx);
  42. OFFSET(IA32_SIGCONTEXT_dx, sigcontext_ia32, dx);
  43. OFFSET(IA32_SIGCONTEXT_si, sigcontext_ia32, si);
  44. OFFSET(IA32_SIGCONTEXT_di, sigcontext_ia32, di);
  45. OFFSET(IA32_SIGCONTEXT_bp, sigcontext_ia32, bp);
  46. OFFSET(IA32_SIGCONTEXT_sp, sigcontext_ia32, sp);
  47. OFFSET(IA32_SIGCONTEXT_ip, sigcontext_ia32, ip);
  48. BLANK();
  49. OFFSET(TI_sysenter_return, thread_info, sysenter_return);
  50. BLANK();
  51. OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext);
  52. #endif
  53. #ifdef CONFIG_PARAVIRT
  54. BLANK();
  55. OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
  56. OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops);
  57. OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops);
  58. OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
  59. OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
  60. OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
  61. #ifdef CONFIG_X86_32
  62. OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
  63. #endif
  64. OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
  65. OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
  66. #endif
  67. #ifdef CONFIG_XEN
  68. BLANK();
  69. OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
  70. OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
  71. #endif
  72. BLANK();
  73. OFFSET(BP_scratch, boot_params, scratch);
  74. OFFSET(BP_loadflags, boot_params, hdr.loadflags);
  75. OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
  76. OFFSET(BP_version, boot_params, hdr.version);
  77. OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
  78. OFFSET(BP_pref_address, boot_params, hdr.pref_address);
  79. OFFSET(BP_code32_start, boot_params, hdr.code32_start);
  80. BLANK();
  81. DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
  82. }