asm-offsets.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/sched.h>
  9. #include <linux/mm.h>
  10. #include <linux/interrupt.h>
  11. #include <linux/thread_info.h>
  12. #include <linux/kbuild.h>
  13. #include <asm/hardirq.h>
  14. #include <asm/page.h>
  15. #include <asm/ptrace.h>
  16. int main(void)
  17. {
  18. DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
  19. DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
  20. BLANK();
  21. DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
  22. DEFINE(THREAD_CALLEE_REG, offsetof(struct thread_struct, callee_reg));
  23. #ifdef CONFIG_ARC_CURR_IN_REG
  24. DEFINE(THREAD_USER_R25, offsetof(struct thread_struct, user_r25));
  25. #endif
  26. DEFINE(THREAD_FAULT_ADDR,
  27. offsetof(struct thread_struct, fault_address));
  28. BLANK();
  29. DEFINE(THREAD_INFO_FLAGS, offsetof(struct thread_info, flags));
  30. DEFINE(THREAD_INFO_PREEMPT_COUNT,
  31. offsetof(struct thread_info, preempt_count));
  32. BLANK();
  33. DEFINE(TASK_ACT_MM, offsetof(struct task_struct, active_mm));
  34. DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
  35. DEFINE(MM_CTXT, offsetof(struct mm_struct, context));
  36. DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
  37. DEFINE(MM_CTXT_ASID, offsetof(mm_context_t, asid));
  38. BLANK();
  39. DEFINE(PT_status32, offsetof(struct pt_regs, status32));
  40. DEFINE(PT_orig_r8, offsetof(struct pt_regs, orig_r8_word));
  41. DEFINE(PT_sp, offsetof(struct pt_regs, sp));
  42. DEFINE(PT_r0, offsetof(struct pt_regs, r0));
  43. DEFINE(PT_r1, offsetof(struct pt_regs, r1));
  44. DEFINE(PT_r2, offsetof(struct pt_regs, r2));
  45. DEFINE(PT_r3, offsetof(struct pt_regs, r3));
  46. DEFINE(PT_r4, offsetof(struct pt_regs, r4));
  47. DEFINE(PT_r5, offsetof(struct pt_regs, r5));
  48. DEFINE(PT_r6, offsetof(struct pt_regs, r6));
  49. DEFINE(PT_r7, offsetof(struct pt_regs, r7));
  50. return 0;
  51. }