asm-offsets.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_CRED, offsetof(struct task_struct, cred));
  20. DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
  21. DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
  22. DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
  23. BLANK();
  24. DEFINE(CRED_UID, offsetof(struct cred, uid));
  25. DEFINE(CRED_EUID, offsetof(struct cred, euid));
  26. DEFINE(CRED_GID, offsetof(struct cred, gid));
  27. DEFINE(CRED_EGID, offsetof(struct cred, egid));
  28. BLANK();
  29. DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
  30. DEFINE(PT_PTRACED, PT_PTRACED);
  31. DEFINE(CLONE_VM, CLONE_VM);
  32. DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
  33. DEFINE(SIGCHLD, SIGCHLD);
  34. BLANK();
  35. DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
  36. DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
  37. }