asm-offsets_64.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // SPDX-License-Identifier: GPL-2.0
  2. #ifndef __LINUX_KBUILD_H
  3. # error "Please do not build this file directly, build asm-offsets.c instead"
  4. #endif
  5. #include <asm/ia32.h>
  6. #if defined(CONFIG_KVM_GUEST)
  7. #include <asm/kvm_para.h>
  8. #endif
  9. int main(void)
  10. {
  11. #ifdef CONFIG_PARAVIRT
  12. #ifdef CONFIG_PARAVIRT_XXL
  13. #ifdef CONFIG_DEBUG_ENTRY
  14. OFFSET(PV_IRQ_save_fl, paravirt_patch_template, irq.save_fl);
  15. #endif
  16. #endif
  17. BLANK();
  18. #endif
  19. #if defined(CONFIG_KVM_GUEST)
  20. OFFSET(KVM_STEAL_TIME_preempted, kvm_steal_time, preempted);
  21. BLANK();
  22. #endif
  23. #define ENTRY(entry) OFFSET(pt_regs_ ## entry, pt_regs, entry)
  24. ENTRY(bx);
  25. ENTRY(cx);
  26. ENTRY(dx);
  27. ENTRY(sp);
  28. ENTRY(bp);
  29. ENTRY(si);
  30. ENTRY(di);
  31. ENTRY(r8);
  32. ENTRY(r9);
  33. ENTRY(r10);
  34. ENTRY(r11);
  35. ENTRY(r12);
  36. ENTRY(r13);
  37. ENTRY(r14);
  38. ENTRY(r15);
  39. ENTRY(flags);
  40. BLANK();
  41. #undef ENTRY
  42. #define ENTRY(entry) OFFSET(saved_context_ ## entry, saved_context, entry)
  43. ENTRY(cr0);
  44. ENTRY(cr2);
  45. ENTRY(cr3);
  46. ENTRY(cr4);
  47. ENTRY(gdt_desc);
  48. BLANK();
  49. #undef ENTRY
  50. BLANK();
  51. #ifdef CONFIG_STACKPROTECTOR
  52. DEFINE(stack_canary_offset, offsetof(struct fixed_percpu_data, stack_canary));
  53. BLANK();
  54. #endif
  55. return 0;
  56. }