asm-offsets.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. OFFSET(TI_preempt_count, thread_info, preempt_count);
  32. BLANK();
  33. OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
  34. BLANK();
  35. OFFSET(pbe_address, pbe, address);
  36. OFFSET(pbe_orig_address, pbe, orig_address);
  37. OFFSET(pbe_next, pbe, next);
  38. #ifdef CONFIG_PARAVIRT
  39. BLANK();
  40. OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
  41. OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops);
  42. OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops);
  43. OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
  44. OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
  45. OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
  46. OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
  47. OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
  48. OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
  49. #endif
  50. #ifdef CONFIG_XEN
  51. BLANK();
  52. OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
  53. OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
  54. #endif
  55. BLANK();
  56. OFFSET(BP_scratch, boot_params, scratch);
  57. OFFSET(BP_loadflags, boot_params, hdr.loadflags);
  58. OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
  59. OFFSET(BP_version, boot_params, hdr.version);
  60. OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
  61. }