asm-offsets.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #include <linux/kbuild.h>
  2. #include <linux/sched.h>
  3. #include <asm/thread_info.h>
  4. /*
  5. * Generate definitions needed by assembly language modules.
  6. * This code generates raw asm output which is post-processed to extract
  7. * and format the required data.
  8. */
  9. #if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32)
  10. #error One of ARCH v10 and ARCH v32 must be true!
  11. #endif
  12. int main(void)
  13. {
  14. #define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
  15. ENTRY(orig_r10);
  16. ENTRY(r13);
  17. ENTRY(r12);
  18. ENTRY(r11);
  19. ENTRY(r10);
  20. ENTRY(r9);
  21. #ifdef CONFIG_ETRAX_ARCH_V32
  22. ENTRY(acr);
  23. ENTRY(srs);
  24. #endif
  25. ENTRY(mof);
  26. #ifdef CONFIG_ETRAX_ARCH_V10
  27. ENTRY(dccr);
  28. #else
  29. ENTRY(ccs);
  30. #endif
  31. ENTRY(srp);
  32. BLANK();
  33. #undef ENTRY
  34. #define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
  35. ENTRY(task);
  36. ENTRY(flags);
  37. ENTRY(preempt_count);
  38. BLANK();
  39. #undef ENTRY
  40. #define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
  41. ENTRY(ksp);
  42. ENTRY(usp);
  43. #ifdef CONFIG_ETRAX_ARCH_V10
  44. ENTRY(dccr);
  45. #else
  46. ENTRY(ccs);
  47. #endif
  48. BLANK();
  49. #undef ENTRY
  50. #define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
  51. ENTRY(pid);
  52. BLANK();
  53. DEFINE(LCLONE_VM, CLONE_VM);
  54. DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
  55. return 0;
  56. }