asm-offsets.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #include <linux/types.h>
  7. #include <linux/stddef.h>
  8. #include <linux/sched.h>
  9. #include <linux/ptrace.h>
  10. #include <linux/kbuild.h>
  11. #include <asm/io.h>
  12. void foo(void)
  13. {
  14. DEFINE(TI_TASK, offsetof(struct thread_info, task));
  15. DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
  16. DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
  17. BLANK();
  18. DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
  19. DEFINE(TASK_UID, offsetof(struct task_struct, uid));
  20. DEFINE(TASK_EUID, offsetof(struct task_struct, euid));
  21. DEFINE(TASK_GID, offsetof(struct task_struct, gid));
  22. DEFINE(TASK_EGID, offsetof(struct task_struct, egid));
  23. DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
  24. DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
  25. DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
  26. BLANK();
  27. DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
  28. DEFINE(PT_PTRACED, PT_PTRACED);
  29. DEFINE(CLONE_VM, CLONE_VM);
  30. DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
  31. DEFINE(SIGCHLD, SIGCHLD);
  32. BLANK();
  33. DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
  34. DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
  35. }