asm-offsets.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Generate definitions needed by assembly language modules.
  4. * This code generates raw asm output which is post-processed to extract
  5. * and format the required data.
  6. */
  7. #include <linux/types.h>
  8. #include <linux/stddef.h>
  9. #include <linux/sched.h>
  10. #include <linux/ptrace.h>
  11. #include <linux/kbuild.h>
  12. #include <asm/io.h>
  13. void foo(void)
  14. {
  15. DEFINE(TI_TASK, offsetof(struct thread_info, task));
  16. DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
  17. DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
  18. BLANK();
  19. DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
  20. DEFINE(TASK_CRED, offsetof(struct task_struct, cred));
  21. DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
  22. DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
  23. DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
  24. BLANK();
  25. DEFINE(CRED_UID, offsetof(struct cred, uid));
  26. DEFINE(CRED_EUID, offsetof(struct cred, euid));
  27. DEFINE(CRED_GID, offsetof(struct cred, gid));
  28. DEFINE(CRED_EGID, offsetof(struct cred, egid));
  29. BLANK();
  30. DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
  31. DEFINE(PT_PTRACED, PT_PTRACED);
  32. DEFINE(CLONE_VM, CLONE_VM);
  33. DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
  34. DEFINE(SIGCHLD, SIGCHLD);
  35. BLANK();
  36. DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
  37. DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
  38. }