asm-offsets.c 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. *
  14. * Generates definitions from c-type structures used by assembly sources.
  15. */
  16. /* Check for compatible compiler early in the build. */
  17. #ifdef CONFIG_TILEGX
  18. # ifndef __tilegx__
  19. # error Can only build TILE-Gx configurations with tilegx compiler
  20. # endif
  21. # ifndef __LP64__
  22. # error Must not specify -m32 when building the TILE-Gx kernel
  23. # endif
  24. #else
  25. # ifdef __tilegx__
  26. # error Can not build TILEPro configurations with tilegx compiler
  27. # endif
  28. #endif
  29. #include <linux/kbuild.h>
  30. #include <linux/thread_info.h>
  31. #include <linux/sched.h>
  32. #include <linux/hardirq.h>
  33. #include <linux/ptrace.h>
  34. #include <hv/hypervisor.h>
  35. void foo(void)
  36. {
  37. DEFINE(SINGLESTEP_STATE_BUFFER_OFFSET,
  38. offsetof(struct single_step_state, buffer));
  39. DEFINE(SINGLESTEP_STATE_FLAGS_OFFSET,
  40. offsetof(struct single_step_state, flags));
  41. DEFINE(SINGLESTEP_STATE_ORIG_PC_OFFSET,
  42. offsetof(struct single_step_state, orig_pc));
  43. DEFINE(SINGLESTEP_STATE_NEXT_PC_OFFSET,
  44. offsetof(struct single_step_state, next_pc));
  45. DEFINE(SINGLESTEP_STATE_BRANCH_NEXT_PC_OFFSET,
  46. offsetof(struct single_step_state, branch_next_pc));
  47. DEFINE(SINGLESTEP_STATE_UPDATE_VALUE_OFFSET,
  48. offsetof(struct single_step_state, update_value));
  49. DEFINE(THREAD_INFO_TASK_OFFSET,
  50. offsetof(struct thread_info, task));
  51. DEFINE(THREAD_INFO_FLAGS_OFFSET,
  52. offsetof(struct thread_info, flags));
  53. DEFINE(THREAD_INFO_STATUS_OFFSET,
  54. offsetof(struct thread_info, status));
  55. DEFINE(THREAD_INFO_HOMECACHE_CPU_OFFSET,
  56. offsetof(struct thread_info, homecache_cpu));
  57. DEFINE(THREAD_INFO_PREEMPT_COUNT_OFFSET,
  58. offsetof(struct thread_info, preempt_count));
  59. DEFINE(THREAD_INFO_STEP_STATE_OFFSET,
  60. offsetof(struct thread_info, step_state));
  61. #ifdef __tilegx__
  62. DEFINE(THREAD_INFO_UNALIGN_JIT_BASE_OFFSET,
  63. offsetof(struct thread_info, unalign_jit_base));
  64. DEFINE(THREAD_INFO_UNALIGN_JIT_TMP_OFFSET,
  65. offsetof(struct thread_info, unalign_jit_tmp));
  66. #endif
  67. DEFINE(TASK_STRUCT_THREAD_KSP_OFFSET,
  68. offsetof(struct task_struct, thread.ksp));
  69. DEFINE(TASK_STRUCT_THREAD_PC_OFFSET,
  70. offsetof(struct task_struct, thread.pc));
  71. DEFINE(HV_TOPOLOGY_WIDTH_OFFSET,
  72. offsetof(HV_Topology, width));
  73. DEFINE(HV_TOPOLOGY_HEIGHT_OFFSET,
  74. offsetof(HV_Topology, height));
  75. DEFINE(IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET,
  76. offsetof(irq_cpustat_t, irq_syscall_count));
  77. }