asm-offsets.c 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #include <linux/kbuild.h>
  17. #include <linux/thread_info.h>
  18. #include <linux/sched.h>
  19. #include <linux/hardirq.h>
  20. #include <linux/ptrace.h>
  21. #include <hv/hypervisor.h>
  22. /* Check for compatible compiler early in the build. */
  23. #ifdef CONFIG_TILEGX
  24. # ifndef __tilegx__
  25. # error Can only build TILE-Gx configurations with tilegx compiler
  26. # endif
  27. # ifndef __LP64__
  28. # error Must not specify -m32 when building the TILE-Gx kernel
  29. # endif
  30. #else
  31. # ifdef __tilegx__
  32. # error Can not build TILEPro/TILE64 configurations with tilegx compiler
  33. # endif
  34. #endif
  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_STEP_STATE_OFFSET, \
  58. offsetof(struct thread_info, step_state));
  59. DEFINE(TASK_STRUCT_THREAD_KSP_OFFSET,
  60. offsetof(struct task_struct, thread.ksp));
  61. DEFINE(TASK_STRUCT_THREAD_PC_OFFSET,
  62. offsetof(struct task_struct, thread.pc));
  63. DEFINE(HV_TOPOLOGY_WIDTH_OFFSET, \
  64. offsetof(HV_Topology, width));
  65. DEFINE(HV_TOPOLOGY_HEIGHT_OFFSET, \
  66. offsetof(HV_Topology, height));
  67. DEFINE(IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET, \
  68. offsetof(irq_cpustat_t, irq_syscall_count));
  69. }