asm-offsets.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 1996 David S. Miller
  4. * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
  5. * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  6. * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  7. * Copyright (C) 2000 MIPS Technologies, Inc.
  8. *
  9. * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  10. */
  11. #include <linux/compat.h>
  12. #include <linux/types.h>
  13. #include <linux/sched.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/kbuild.h>
  16. #include <asm/ptrace.h>
  17. #include <asm/processor.h>
  18. /* This file is used to produce asm/linkerscript constants from header
  19. files typically used in c. Specifically, it generates asm-offsets.h */
  20. int main(void)
  21. {
  22. COMMENT("This is a comment.");
  23. /* might get these from somewhere else. */
  24. DEFINE(_PAGE_SIZE, PAGE_SIZE);
  25. DEFINE(_PAGE_SHIFT, PAGE_SHIFT);
  26. BLANK();
  27. COMMENT("Hexagon pt_regs definitions");
  28. OFFSET(_PT_SYSCALL_NR, pt_regs, syscall_nr);
  29. OFFSET(_PT_GPUGP, pt_regs, gpugp);
  30. OFFSET(_PT_CS1CS0, pt_regs, cs1cs0);
  31. OFFSET(_PT_R3130, pt_regs, r3130);
  32. OFFSET(_PT_R2928, pt_regs, r2928);
  33. OFFSET(_PT_R2726, pt_regs, r2726);
  34. OFFSET(_PT_R2524, pt_regs, r2524);
  35. OFFSET(_PT_R2322, pt_regs, r2322);
  36. OFFSET(_PT_R2120, pt_regs, r2120);
  37. OFFSET(_PT_R1918, pt_regs, r1918);
  38. OFFSET(_PT_R1716, pt_regs, r1716);
  39. OFFSET(_PT_R1514, pt_regs, r1514);
  40. OFFSET(_PT_R1312, pt_regs, r1312);
  41. OFFSET(_PT_R1110, pt_regs, r1110);
  42. OFFSET(_PT_R0908, pt_regs, r0908);
  43. OFFSET(_PT_R0706, pt_regs, r0706);
  44. OFFSET(_PT_R0504, pt_regs, r0504);
  45. OFFSET(_PT_R0302, pt_regs, r0302);
  46. OFFSET(_PT_R0100, pt_regs, r0100);
  47. OFFSET(_PT_LC0SA0, pt_regs, lc0sa0);
  48. OFFSET(_PT_LC1SA1, pt_regs, lc1sa1);
  49. OFFSET(_PT_M1M0, pt_regs, m1m0);
  50. OFFSET(_PT_PREDSUSR, pt_regs, predsusr);
  51. OFFSET(_PT_EVREC, pt_regs, hvmer);
  52. OFFSET(_PT_ER_VMEL, pt_regs, hvmer.vmel);
  53. OFFSET(_PT_ER_VMEST, pt_regs, hvmer.vmest);
  54. OFFSET(_PT_ER_VMPSP, pt_regs, hvmer.vmpsp);
  55. OFFSET(_PT_ER_VMBADVA, pt_regs, hvmer.vmbadva);
  56. DEFINE(_PT_REGS_SIZE, sizeof(struct pt_regs));
  57. BLANK();
  58. COMMENT("Hexagon thread_info definitions");
  59. OFFSET(_THREAD_INFO_FLAGS, thread_info, flags);
  60. OFFSET(_THREAD_INFO_PT_REGS, thread_info, regs);
  61. OFFSET(_THREAD_INFO_SP, thread_info, sp);
  62. DEFINE(_THREAD_SIZE, THREAD_SIZE);
  63. BLANK();
  64. COMMENT("Hexagon hexagon_switch_stack definitions");
  65. OFFSET(_SWITCH_R1716, hexagon_switch_stack, r1716);
  66. OFFSET(_SWITCH_R1918, hexagon_switch_stack, r1918);
  67. OFFSET(_SWITCH_R2120, hexagon_switch_stack, r2120);
  68. OFFSET(_SWITCH_R2322, hexagon_switch_stack, r2322);
  69. OFFSET(_SWITCH_R2524, hexagon_switch_stack, r2524);
  70. OFFSET(_SWITCH_R2726, hexagon_switch_stack, r2726);
  71. OFFSET(_SWITCH_FP, hexagon_switch_stack, fp);
  72. OFFSET(_SWITCH_LR, hexagon_switch_stack, lr);
  73. DEFINE(_SWITCH_STACK_SIZE, sizeof(struct hexagon_switch_stack));
  74. BLANK();
  75. COMMENT("Hexagon task_struct definitions");
  76. OFFSET(_TASK_THREAD_INFO, task_struct, stack);
  77. OFFSET(_TASK_STRUCT_THREAD, task_struct, thread);
  78. COMMENT("Hexagon thread_struct definitions");
  79. OFFSET(_THREAD_STRUCT_SWITCH_SP, thread_struct, switch_sp);
  80. return 0;
  81. }