asm-offsets.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (C) 1996 David S. Miller
  3. * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
  4. * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  5. * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  6. * Copyright (C) 2000 MIPS Technologies, Inc.
  7. *
  8. * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 and
  12. * only version 2 as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22. * 02110-1301, USA.
  23. */
  24. #include <linux/compat.h>
  25. #include <linux/types.h>
  26. #include <linux/sched.h>
  27. #include <linux/mm.h>
  28. #include <linux/interrupt.h>
  29. #include <linux/kbuild.h>
  30. #include <asm/ptrace.h>
  31. #include <asm/processor.h>
  32. /* This file is used to produce asm/linkerscript constants from header
  33. files typically used in c. Specifically, it generates asm-offsets.h */
  34. int main(void)
  35. {
  36. COMMENT("This is a comment.");
  37. /* might get these from somewhere else. */
  38. DEFINE(_PAGE_SIZE, PAGE_SIZE);
  39. DEFINE(_PAGE_SHIFT, PAGE_SHIFT);
  40. BLANK();
  41. COMMENT("Hexagon pt_regs definitions");
  42. OFFSET(_PT_SYSCALL_NR, pt_regs, syscall_nr);
  43. OFFSET(_PT_GPUGP, pt_regs, gpugp);
  44. OFFSET(_PT_CS1CS0, pt_regs, cs1cs0);
  45. OFFSET(_PT_R3130, pt_regs, r3130);
  46. OFFSET(_PT_R2928, pt_regs, r2928);
  47. OFFSET(_PT_R2726, pt_regs, r2726);
  48. OFFSET(_PT_R2524, pt_regs, r2524);
  49. OFFSET(_PT_R2322, pt_regs, r2322);
  50. OFFSET(_PT_R2120, pt_regs, r2120);
  51. OFFSET(_PT_R1918, pt_regs, r1918);
  52. OFFSET(_PT_R1716, pt_regs, r1716);
  53. OFFSET(_PT_R1514, pt_regs, r1514);
  54. OFFSET(_PT_R1312, pt_regs, r1312);
  55. OFFSET(_PT_R1110, pt_regs, r1110);
  56. OFFSET(_PT_R0908, pt_regs, r0908);
  57. OFFSET(_PT_R0706, pt_regs, r0706);
  58. OFFSET(_PT_R0504, pt_regs, r0504);
  59. OFFSET(_PT_R0302, pt_regs, r0302);
  60. OFFSET(_PT_R0100, pt_regs, r0100);
  61. OFFSET(_PT_LC0SA0, pt_regs, lc0sa0);
  62. OFFSET(_PT_LC1SA1, pt_regs, lc1sa1);
  63. OFFSET(_PT_M1M0, pt_regs, m1m0);
  64. OFFSET(_PT_PREDSUSR, pt_regs, predsusr);
  65. OFFSET(_PT_EVREC, pt_regs, hvmer);
  66. OFFSET(_PT_ER_VMEL, pt_regs, hvmer.vmel);
  67. OFFSET(_PT_ER_VMEST, pt_regs, hvmer.vmest);
  68. OFFSET(_PT_ER_VMPSP, pt_regs, hvmer.vmpsp);
  69. OFFSET(_PT_ER_VMBADVA, pt_regs, hvmer.vmbadva);
  70. DEFINE(_PT_REGS_SIZE, sizeof(struct pt_regs));
  71. BLANK();
  72. COMMENT("Hexagon thread_info definitions");
  73. OFFSET(_THREAD_INFO_FLAGS, thread_info, flags);
  74. OFFSET(_THREAD_INFO_PT_REGS, thread_info, regs);
  75. OFFSET(_THREAD_INFO_SP, thread_info, sp);
  76. DEFINE(_THREAD_SIZE, THREAD_SIZE);
  77. BLANK();
  78. COMMENT("Hexagon hexagon_switch_stack definitions");
  79. OFFSET(_SWITCH_R1716, hexagon_switch_stack, r1716);
  80. OFFSET(_SWITCH_R1918, hexagon_switch_stack, r1918);
  81. OFFSET(_SWITCH_R2120, hexagon_switch_stack, r2120);
  82. OFFSET(_SWITCH_R2322, hexagon_switch_stack, r2322);
  83. OFFSET(_SWITCH_R2524, hexagon_switch_stack, r2524);
  84. OFFSET(_SWITCH_R2726, hexagon_switch_stack, r2726);
  85. OFFSET(_SWITCH_FP, hexagon_switch_stack, fp);
  86. OFFSET(_SWITCH_LR, hexagon_switch_stack, lr);
  87. DEFINE(_SWITCH_STACK_SIZE, sizeof(struct hexagon_switch_stack));
  88. BLANK();
  89. COMMENT("Hexagon task_struct definitions");
  90. OFFSET(_TASK_THREAD_INFO, task_struct, stack);
  91. OFFSET(_TASK_STRUCT_THREAD, task_struct, thread);
  92. COMMENT("Hexagon thread_struct definitions");
  93. OFFSET(_THREAD_STRUCT_SWITCH_SP, thread_struct, switch_sp);
  94. return 0;
  95. }