asm-offsets.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * File: arch/blackfin/kernel/asm-offsets.c
  3. * Based on:
  4. * Author:
  5. *
  6. * Created:
  7. * Description: generate definitions needed by assembly language modules.
  8. *
  9. * Modified:
  10. * Copyright 2004-2006 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #include <linux/stddef.h>
  30. #include <linux/sched.h>
  31. #include <linux/kernel_stat.h>
  32. #include <linux/ptrace.h>
  33. #include <linux/hardirq.h>
  34. #include <linux/irq.h>
  35. #include <linux/thread_info.h>
  36. #include <linux/kbuild.h>
  37. int main(void)
  38. {
  39. /* offsets into the task struct */
  40. DEFINE(TASK_STATE, offsetof(struct task_struct, state));
  41. DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
  42. DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
  43. DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
  44. DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
  45. DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
  46. DEFINE(TASK_MM, offsetof(struct task_struct, mm));
  47. DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
  48. DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, pending));
  49. /* offsets into the irq_cpustat_t struct */
  50. DEFINE(CPUSTAT_SOFTIRQ_PENDING,
  51. offsetof(irq_cpustat_t, __softirq_pending));
  52. /* offsets into the thread struct */
  53. DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
  54. DEFINE(THREAD_USP, offsetof(struct thread_struct, usp));
  55. DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
  56. DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
  57. /* offsets into the pt_regs */
  58. DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
  59. DEFINE(PT_ORIG_PC, offsetof(struct pt_regs, orig_pc));
  60. DEFINE(PT_R0, offsetof(struct pt_regs, r0));
  61. DEFINE(PT_R1, offsetof(struct pt_regs, r1));
  62. DEFINE(PT_R2, offsetof(struct pt_regs, r2));
  63. DEFINE(PT_R3, offsetof(struct pt_regs, r3));
  64. DEFINE(PT_R4, offsetof(struct pt_regs, r4));
  65. DEFINE(PT_R5, offsetof(struct pt_regs, r5));
  66. DEFINE(PT_R6, offsetof(struct pt_regs, r6));
  67. DEFINE(PT_R7, offsetof(struct pt_regs, r7));
  68. DEFINE(PT_P0, offsetof(struct pt_regs, p0));
  69. DEFINE(PT_P1, offsetof(struct pt_regs, p1));
  70. DEFINE(PT_P2, offsetof(struct pt_regs, p2));
  71. DEFINE(PT_P3, offsetof(struct pt_regs, p3));
  72. DEFINE(PT_P4, offsetof(struct pt_regs, p4));
  73. DEFINE(PT_P5, offsetof(struct pt_regs, p5));
  74. DEFINE(PT_FP, offsetof(struct pt_regs, fp));
  75. DEFINE(PT_USP, offsetof(struct pt_regs, usp));
  76. DEFINE(PT_I0, offsetof(struct pt_regs, i0));
  77. DEFINE(PT_I1, offsetof(struct pt_regs, i1));
  78. DEFINE(PT_I2, offsetof(struct pt_regs, i2));
  79. DEFINE(PT_I3, offsetof(struct pt_regs, i3));
  80. DEFINE(PT_M0, offsetof(struct pt_regs, m0));
  81. DEFINE(PT_M1, offsetof(struct pt_regs, m1));
  82. DEFINE(PT_M2, offsetof(struct pt_regs, m2));
  83. DEFINE(PT_M3, offsetof(struct pt_regs, m3));
  84. DEFINE(PT_L0, offsetof(struct pt_regs, l0));
  85. DEFINE(PT_L1, offsetof(struct pt_regs, l1));
  86. DEFINE(PT_L2, offsetof(struct pt_regs, l2));
  87. DEFINE(PT_L3, offsetof(struct pt_regs, l3));
  88. DEFINE(PT_B0, offsetof(struct pt_regs, b0));
  89. DEFINE(PT_B1, offsetof(struct pt_regs, b1));
  90. DEFINE(PT_B2, offsetof(struct pt_regs, b2));
  91. DEFINE(PT_B3, offsetof(struct pt_regs, b3));
  92. DEFINE(PT_A0X, offsetof(struct pt_regs, a0x));
  93. DEFINE(PT_A0W, offsetof(struct pt_regs, a0w));
  94. DEFINE(PT_A1X, offsetof(struct pt_regs, a1x));
  95. DEFINE(PT_A1W, offsetof(struct pt_regs, a1w));
  96. DEFINE(PT_LC0, offsetof(struct pt_regs, lc0));
  97. DEFINE(PT_LC1, offsetof(struct pt_regs, lc1));
  98. DEFINE(PT_LT0, offsetof(struct pt_regs, lt0));
  99. DEFINE(PT_LT1, offsetof(struct pt_regs, lt1));
  100. DEFINE(PT_LB0, offsetof(struct pt_regs, lb0));
  101. DEFINE(PT_LB1, offsetof(struct pt_regs, lb1));
  102. DEFINE(PT_ASTAT, offsetof(struct pt_regs, astat));
  103. DEFINE(PT_RESERVED, offsetof(struct pt_regs, reserved));
  104. DEFINE(PT_RETS, offsetof(struct pt_regs, rets));
  105. DEFINE(PT_PC, offsetof(struct pt_regs, pc));
  106. DEFINE(PT_RETX, offsetof(struct pt_regs, retx));
  107. DEFINE(PT_RETN, offsetof(struct pt_regs, retn));
  108. DEFINE(PT_RETE, offsetof(struct pt_regs, rete));
  109. DEFINE(PT_SEQSTAT, offsetof(struct pt_regs, seqstat));
  110. DEFINE(PT_SYSCFG, offsetof(struct pt_regs, syscfg));
  111. DEFINE(PT_IPEND, offsetof(struct pt_regs, ipend));
  112. DEFINE(SIZEOF_PTREGS, sizeof(struct pt_regs));
  113. DEFINE(PT_TEXT_ADDR, sizeof(struct pt_regs)); /* Needed by gdb */
  114. DEFINE(PT_TEXT_END_ADDR, 4 + sizeof(struct pt_regs));/* Needed by gdb */
  115. DEFINE(PT_DATA_ADDR, 8 + sizeof(struct pt_regs)); /* Needed by gdb */
  116. DEFINE(PT_FDPIC_EXEC, 12 + sizeof(struct pt_regs)); /* Needed by gdb */
  117. DEFINE(PT_FDPIC_INTERP, 16 + sizeof(struct pt_regs));/* Needed by gdb */
  118. /* signal defines */
  119. DEFINE(SIGSEGV, SIGSEGV);
  120. DEFINE(SIGTRAP, SIGTRAP);
  121. return 0;
  122. }