asm-offsets.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. /*
  2. * Generate definitions needed by assembly language modules.
  3. * This code generates raw asm output which is post-processed to extract
  4. * and format the required data.
  5. *
  6. * Copyright (C) 2000-2001 John Marvin <jsm at parisc-linux.org>
  7. * Copyright (C) 2000 David Huggins-Daines <dhd with pobox.org>
  8. * Copyright (C) 2000 Sam Creasey <sammy@sammy.net>
  9. * Copyright (C) 2000 Grant Grundler <grundler with parisc-linux.org>
  10. * Copyright (C) 2001 Paul Bame <bame at parisc-linux.org>
  11. * Copyright (C) 2001 Richard Hirst <rhirst at parisc-linux.org>
  12. * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
  13. * Copyright (C) 2003 James Bottomley <jejb at parisc-linux.org>
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2 of the License, or
  18. * (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, write to the Free Software
  27. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  28. */
  29. #include <linux/types.h>
  30. #include <linux/sched.h>
  31. #include <linux/thread_info.h>
  32. #include <linux/ptrace.h>
  33. #include <linux/hardirq.h>
  34. #include <linux/kbuild.h>
  35. #include <asm/pgtable.h>
  36. #include <asm/ptrace.h>
  37. #include <asm/processor.h>
  38. #include <asm/pdc.h>
  39. #include <asm/uaccess.h>
  40. #ifdef CONFIG_64BIT
  41. #define FRAME_SIZE 128
  42. #else
  43. #define FRAME_SIZE 64
  44. #endif
  45. #define FRAME_ALIGN 64
  46. /* Add FRAME_SIZE to the size x and align it to y. All definitions
  47. * that use align_frame will include space for a frame.
  48. */
  49. #define align_frame(x,y) (((x)+FRAME_SIZE+(y)-1) - (((x)+(y)-1)%(y)))
  50. int main(void)
  51. {
  52. DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
  53. DEFINE(TASK_STATE, offsetof(struct task_struct, state));
  54. DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
  55. DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, pending));
  56. DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
  57. DEFINE(TASK_MM, offsetof(struct task_struct, mm));
  58. DEFINE(TASK_PERSONALITY, offsetof(struct task_struct, personality));
  59. DEFINE(TASK_PID, offsetof(struct task_struct, pid));
  60. BLANK();
  61. DEFINE(TASK_REGS, offsetof(struct task_struct, thread.regs));
  62. DEFINE(TASK_PT_PSW, offsetof(struct task_struct, thread.regs.gr[ 0]));
  63. DEFINE(TASK_PT_GR1, offsetof(struct task_struct, thread.regs.gr[ 1]));
  64. DEFINE(TASK_PT_GR2, offsetof(struct task_struct, thread.regs.gr[ 2]));
  65. DEFINE(TASK_PT_GR3, offsetof(struct task_struct, thread.regs.gr[ 3]));
  66. DEFINE(TASK_PT_GR4, offsetof(struct task_struct, thread.regs.gr[ 4]));
  67. DEFINE(TASK_PT_GR5, offsetof(struct task_struct, thread.regs.gr[ 5]));
  68. DEFINE(TASK_PT_GR6, offsetof(struct task_struct, thread.regs.gr[ 6]));
  69. DEFINE(TASK_PT_GR7, offsetof(struct task_struct, thread.regs.gr[ 7]));
  70. DEFINE(TASK_PT_GR8, offsetof(struct task_struct, thread.regs.gr[ 8]));
  71. DEFINE(TASK_PT_GR9, offsetof(struct task_struct, thread.regs.gr[ 9]));
  72. DEFINE(TASK_PT_GR10, offsetof(struct task_struct, thread.regs.gr[10]));
  73. DEFINE(TASK_PT_GR11, offsetof(struct task_struct, thread.regs.gr[11]));
  74. DEFINE(TASK_PT_GR12, offsetof(struct task_struct, thread.regs.gr[12]));
  75. DEFINE(TASK_PT_GR13, offsetof(struct task_struct, thread.regs.gr[13]));
  76. DEFINE(TASK_PT_GR14, offsetof(struct task_struct, thread.regs.gr[14]));
  77. DEFINE(TASK_PT_GR15, offsetof(struct task_struct, thread.regs.gr[15]));
  78. DEFINE(TASK_PT_GR16, offsetof(struct task_struct, thread.regs.gr[16]));
  79. DEFINE(TASK_PT_GR17, offsetof(struct task_struct, thread.regs.gr[17]));
  80. DEFINE(TASK_PT_GR18, offsetof(struct task_struct, thread.regs.gr[18]));
  81. DEFINE(TASK_PT_GR19, offsetof(struct task_struct, thread.regs.gr[19]));
  82. DEFINE(TASK_PT_GR20, offsetof(struct task_struct, thread.regs.gr[20]));
  83. DEFINE(TASK_PT_GR21, offsetof(struct task_struct, thread.regs.gr[21]));
  84. DEFINE(TASK_PT_GR22, offsetof(struct task_struct, thread.regs.gr[22]));
  85. DEFINE(TASK_PT_GR23, offsetof(struct task_struct, thread.regs.gr[23]));
  86. DEFINE(TASK_PT_GR24, offsetof(struct task_struct, thread.regs.gr[24]));
  87. DEFINE(TASK_PT_GR25, offsetof(struct task_struct, thread.regs.gr[25]));
  88. DEFINE(TASK_PT_GR26, offsetof(struct task_struct, thread.regs.gr[26]));
  89. DEFINE(TASK_PT_GR27, offsetof(struct task_struct, thread.regs.gr[27]));
  90. DEFINE(TASK_PT_GR28, offsetof(struct task_struct, thread.regs.gr[28]));
  91. DEFINE(TASK_PT_GR29, offsetof(struct task_struct, thread.regs.gr[29]));
  92. DEFINE(TASK_PT_GR30, offsetof(struct task_struct, thread.regs.gr[30]));
  93. DEFINE(TASK_PT_GR31, offsetof(struct task_struct, thread.regs.gr[31]));
  94. DEFINE(TASK_PT_FR0, offsetof(struct task_struct, thread.regs.fr[ 0]));
  95. DEFINE(TASK_PT_FR1, offsetof(struct task_struct, thread.regs.fr[ 1]));
  96. DEFINE(TASK_PT_FR2, offsetof(struct task_struct, thread.regs.fr[ 2]));
  97. DEFINE(TASK_PT_FR3, offsetof(struct task_struct, thread.regs.fr[ 3]));
  98. DEFINE(TASK_PT_FR4, offsetof(struct task_struct, thread.regs.fr[ 4]));
  99. DEFINE(TASK_PT_FR5, offsetof(struct task_struct, thread.regs.fr[ 5]));
  100. DEFINE(TASK_PT_FR6, offsetof(struct task_struct, thread.regs.fr[ 6]));
  101. DEFINE(TASK_PT_FR7, offsetof(struct task_struct, thread.regs.fr[ 7]));
  102. DEFINE(TASK_PT_FR8, offsetof(struct task_struct, thread.regs.fr[ 8]));
  103. DEFINE(TASK_PT_FR9, offsetof(struct task_struct, thread.regs.fr[ 9]));
  104. DEFINE(TASK_PT_FR10, offsetof(struct task_struct, thread.regs.fr[10]));
  105. DEFINE(TASK_PT_FR11, offsetof(struct task_struct, thread.regs.fr[11]));
  106. DEFINE(TASK_PT_FR12, offsetof(struct task_struct, thread.regs.fr[12]));
  107. DEFINE(TASK_PT_FR13, offsetof(struct task_struct, thread.regs.fr[13]));
  108. DEFINE(TASK_PT_FR14, offsetof(struct task_struct, thread.regs.fr[14]));
  109. DEFINE(TASK_PT_FR15, offsetof(struct task_struct, thread.regs.fr[15]));
  110. DEFINE(TASK_PT_FR16, offsetof(struct task_struct, thread.regs.fr[16]));
  111. DEFINE(TASK_PT_FR17, offsetof(struct task_struct, thread.regs.fr[17]));
  112. DEFINE(TASK_PT_FR18, offsetof(struct task_struct, thread.regs.fr[18]));
  113. DEFINE(TASK_PT_FR19, offsetof(struct task_struct, thread.regs.fr[19]));
  114. DEFINE(TASK_PT_FR20, offsetof(struct task_struct, thread.regs.fr[20]));
  115. DEFINE(TASK_PT_FR21, offsetof(struct task_struct, thread.regs.fr[21]));
  116. DEFINE(TASK_PT_FR22, offsetof(struct task_struct, thread.regs.fr[22]));
  117. DEFINE(TASK_PT_FR23, offsetof(struct task_struct, thread.regs.fr[23]));
  118. DEFINE(TASK_PT_FR24, offsetof(struct task_struct, thread.regs.fr[24]));
  119. DEFINE(TASK_PT_FR25, offsetof(struct task_struct, thread.regs.fr[25]));
  120. DEFINE(TASK_PT_FR26, offsetof(struct task_struct, thread.regs.fr[26]));
  121. DEFINE(TASK_PT_FR27, offsetof(struct task_struct, thread.regs.fr[27]));
  122. DEFINE(TASK_PT_FR28, offsetof(struct task_struct, thread.regs.fr[28]));
  123. DEFINE(TASK_PT_FR29, offsetof(struct task_struct, thread.regs.fr[29]));
  124. DEFINE(TASK_PT_FR30, offsetof(struct task_struct, thread.regs.fr[30]));
  125. DEFINE(TASK_PT_FR31, offsetof(struct task_struct, thread.regs.fr[31]));
  126. DEFINE(TASK_PT_SR0, offsetof(struct task_struct, thread.regs.sr[ 0]));
  127. DEFINE(TASK_PT_SR1, offsetof(struct task_struct, thread.regs.sr[ 1]));
  128. DEFINE(TASK_PT_SR2, offsetof(struct task_struct, thread.regs.sr[ 2]));
  129. DEFINE(TASK_PT_SR3, offsetof(struct task_struct, thread.regs.sr[ 3]));
  130. DEFINE(TASK_PT_SR4, offsetof(struct task_struct, thread.regs.sr[ 4]));
  131. DEFINE(TASK_PT_SR5, offsetof(struct task_struct, thread.regs.sr[ 5]));
  132. DEFINE(TASK_PT_SR6, offsetof(struct task_struct, thread.regs.sr[ 6]));
  133. DEFINE(TASK_PT_SR7, offsetof(struct task_struct, thread.regs.sr[ 7]));
  134. DEFINE(TASK_PT_IASQ0, offsetof(struct task_struct, thread.regs.iasq[0]));
  135. DEFINE(TASK_PT_IASQ1, offsetof(struct task_struct, thread.regs.iasq[1]));
  136. DEFINE(TASK_PT_IAOQ0, offsetof(struct task_struct, thread.regs.iaoq[0]));
  137. DEFINE(TASK_PT_IAOQ1, offsetof(struct task_struct, thread.regs.iaoq[1]));
  138. DEFINE(TASK_PT_CR27, offsetof(struct task_struct, thread.regs.cr27));
  139. DEFINE(TASK_PT_ORIG_R28, offsetof(struct task_struct, thread.regs.orig_r28));
  140. DEFINE(TASK_PT_KSP, offsetof(struct task_struct, thread.regs.ksp));
  141. DEFINE(TASK_PT_KPC, offsetof(struct task_struct, thread.regs.kpc));
  142. DEFINE(TASK_PT_SAR, offsetof(struct task_struct, thread.regs.sar));
  143. DEFINE(TASK_PT_IIR, offsetof(struct task_struct, thread.regs.iir));
  144. DEFINE(TASK_PT_ISR, offsetof(struct task_struct, thread.regs.isr));
  145. DEFINE(TASK_PT_IOR, offsetof(struct task_struct, thread.regs.ior));
  146. BLANK();
  147. DEFINE(TASK_SZ, sizeof(struct task_struct));
  148. /* TASK_SZ_ALGN includes space for a stack frame. */
  149. DEFINE(TASK_SZ_ALGN, align_frame(sizeof(struct task_struct), FRAME_ALIGN));
  150. BLANK();
  151. DEFINE(PT_PSW, offsetof(struct pt_regs, gr[ 0]));
  152. DEFINE(PT_GR1, offsetof(struct pt_regs, gr[ 1]));
  153. DEFINE(PT_GR2, offsetof(struct pt_regs, gr[ 2]));
  154. DEFINE(PT_GR3, offsetof(struct pt_regs, gr[ 3]));
  155. DEFINE(PT_GR4, offsetof(struct pt_regs, gr[ 4]));
  156. DEFINE(PT_GR5, offsetof(struct pt_regs, gr[ 5]));
  157. DEFINE(PT_GR6, offsetof(struct pt_regs, gr[ 6]));
  158. DEFINE(PT_GR7, offsetof(struct pt_regs, gr[ 7]));
  159. DEFINE(PT_GR8, offsetof(struct pt_regs, gr[ 8]));
  160. DEFINE(PT_GR9, offsetof(struct pt_regs, gr[ 9]));
  161. DEFINE(PT_GR10, offsetof(struct pt_regs, gr[10]));
  162. DEFINE(PT_GR11, offsetof(struct pt_regs, gr[11]));
  163. DEFINE(PT_GR12, offsetof(struct pt_regs, gr[12]));
  164. DEFINE(PT_GR13, offsetof(struct pt_regs, gr[13]));
  165. DEFINE(PT_GR14, offsetof(struct pt_regs, gr[14]));
  166. DEFINE(PT_GR15, offsetof(struct pt_regs, gr[15]));
  167. DEFINE(PT_GR16, offsetof(struct pt_regs, gr[16]));
  168. DEFINE(PT_GR17, offsetof(struct pt_regs, gr[17]));
  169. DEFINE(PT_GR18, offsetof(struct pt_regs, gr[18]));
  170. DEFINE(PT_GR19, offsetof(struct pt_regs, gr[19]));
  171. DEFINE(PT_GR20, offsetof(struct pt_regs, gr[20]));
  172. DEFINE(PT_GR21, offsetof(struct pt_regs, gr[21]));
  173. DEFINE(PT_GR22, offsetof(struct pt_regs, gr[22]));
  174. DEFINE(PT_GR23, offsetof(struct pt_regs, gr[23]));
  175. DEFINE(PT_GR24, offsetof(struct pt_regs, gr[24]));
  176. DEFINE(PT_GR25, offsetof(struct pt_regs, gr[25]));
  177. DEFINE(PT_GR26, offsetof(struct pt_regs, gr[26]));
  178. DEFINE(PT_GR27, offsetof(struct pt_regs, gr[27]));
  179. DEFINE(PT_GR28, offsetof(struct pt_regs, gr[28]));
  180. DEFINE(PT_GR29, offsetof(struct pt_regs, gr[29]));
  181. DEFINE(PT_GR30, offsetof(struct pt_regs, gr[30]));
  182. DEFINE(PT_GR31, offsetof(struct pt_regs, gr[31]));
  183. DEFINE(PT_FR0, offsetof(struct pt_regs, fr[ 0]));
  184. DEFINE(PT_FR1, offsetof(struct pt_regs, fr[ 1]));
  185. DEFINE(PT_FR2, offsetof(struct pt_regs, fr[ 2]));
  186. DEFINE(PT_FR3, offsetof(struct pt_regs, fr[ 3]));
  187. DEFINE(PT_FR4, offsetof(struct pt_regs, fr[ 4]));
  188. DEFINE(PT_FR5, offsetof(struct pt_regs, fr[ 5]));
  189. DEFINE(PT_FR6, offsetof(struct pt_regs, fr[ 6]));
  190. DEFINE(PT_FR7, offsetof(struct pt_regs, fr[ 7]));
  191. DEFINE(PT_FR8, offsetof(struct pt_regs, fr[ 8]));
  192. DEFINE(PT_FR9, offsetof(struct pt_regs, fr[ 9]));
  193. DEFINE(PT_FR10, offsetof(struct pt_regs, fr[10]));
  194. DEFINE(PT_FR11, offsetof(struct pt_regs, fr[11]));
  195. DEFINE(PT_FR12, offsetof(struct pt_regs, fr[12]));
  196. DEFINE(PT_FR13, offsetof(struct pt_regs, fr[13]));
  197. DEFINE(PT_FR14, offsetof(struct pt_regs, fr[14]));
  198. DEFINE(PT_FR15, offsetof(struct pt_regs, fr[15]));
  199. DEFINE(PT_FR16, offsetof(struct pt_regs, fr[16]));
  200. DEFINE(PT_FR17, offsetof(struct pt_regs, fr[17]));
  201. DEFINE(PT_FR18, offsetof(struct pt_regs, fr[18]));
  202. DEFINE(PT_FR19, offsetof(struct pt_regs, fr[19]));
  203. DEFINE(PT_FR20, offsetof(struct pt_regs, fr[20]));
  204. DEFINE(PT_FR21, offsetof(struct pt_regs, fr[21]));
  205. DEFINE(PT_FR22, offsetof(struct pt_regs, fr[22]));
  206. DEFINE(PT_FR23, offsetof(struct pt_regs, fr[23]));
  207. DEFINE(PT_FR24, offsetof(struct pt_regs, fr[24]));
  208. DEFINE(PT_FR25, offsetof(struct pt_regs, fr[25]));
  209. DEFINE(PT_FR26, offsetof(struct pt_regs, fr[26]));
  210. DEFINE(PT_FR27, offsetof(struct pt_regs, fr[27]));
  211. DEFINE(PT_FR28, offsetof(struct pt_regs, fr[28]));
  212. DEFINE(PT_FR29, offsetof(struct pt_regs, fr[29]));
  213. DEFINE(PT_FR30, offsetof(struct pt_regs, fr[30]));
  214. DEFINE(PT_FR31, offsetof(struct pt_regs, fr[31]));
  215. DEFINE(PT_SR0, offsetof(struct pt_regs, sr[ 0]));
  216. DEFINE(PT_SR1, offsetof(struct pt_regs, sr[ 1]));
  217. DEFINE(PT_SR2, offsetof(struct pt_regs, sr[ 2]));
  218. DEFINE(PT_SR3, offsetof(struct pt_regs, sr[ 3]));
  219. DEFINE(PT_SR4, offsetof(struct pt_regs, sr[ 4]));
  220. DEFINE(PT_SR5, offsetof(struct pt_regs, sr[ 5]));
  221. DEFINE(PT_SR6, offsetof(struct pt_regs, sr[ 6]));
  222. DEFINE(PT_SR7, offsetof(struct pt_regs, sr[ 7]));
  223. DEFINE(PT_IASQ0, offsetof(struct pt_regs, iasq[0]));
  224. DEFINE(PT_IASQ1, offsetof(struct pt_regs, iasq[1]));
  225. DEFINE(PT_IAOQ0, offsetof(struct pt_regs, iaoq[0]));
  226. DEFINE(PT_IAOQ1, offsetof(struct pt_regs, iaoq[1]));
  227. DEFINE(PT_CR27, offsetof(struct pt_regs, cr27));
  228. DEFINE(PT_ORIG_R28, offsetof(struct pt_regs, orig_r28));
  229. DEFINE(PT_KSP, offsetof(struct pt_regs, ksp));
  230. DEFINE(PT_KPC, offsetof(struct pt_regs, kpc));
  231. DEFINE(PT_SAR, offsetof(struct pt_regs, sar));
  232. DEFINE(PT_IIR, offsetof(struct pt_regs, iir));
  233. DEFINE(PT_ISR, offsetof(struct pt_regs, isr));
  234. DEFINE(PT_IOR, offsetof(struct pt_regs, ior));
  235. DEFINE(PT_SIZE, sizeof(struct pt_regs));
  236. /* PT_SZ_ALGN includes space for a stack frame. */
  237. DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN));
  238. BLANK();
  239. DEFINE(TI_TASK, offsetof(struct thread_info, task));
  240. DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
  241. DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
  242. DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit));
  243. DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
  244. DEFINE(THREAD_SZ, sizeof(struct thread_info));
  245. /* THREAD_SZ_ALGN includes space for a stack frame. */
  246. DEFINE(THREAD_SZ_ALGN, align_frame(sizeof(struct thread_info), FRAME_ALIGN));
  247. BLANK();
  248. DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base));
  249. DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride));
  250. DEFINE(ICACHE_COUNT, offsetof(struct pdc_cache_info, ic_count));
  251. DEFINE(ICACHE_LOOP, offsetof(struct pdc_cache_info, ic_loop));
  252. DEFINE(DCACHE_BASE, offsetof(struct pdc_cache_info, dc_base));
  253. DEFINE(DCACHE_STRIDE, offsetof(struct pdc_cache_info, dc_stride));
  254. DEFINE(DCACHE_COUNT, offsetof(struct pdc_cache_info, dc_count));
  255. DEFINE(DCACHE_LOOP, offsetof(struct pdc_cache_info, dc_loop));
  256. DEFINE(ITLB_SID_BASE, offsetof(struct pdc_cache_info, it_sp_base));
  257. DEFINE(ITLB_SID_STRIDE, offsetof(struct pdc_cache_info, it_sp_stride));
  258. DEFINE(ITLB_SID_COUNT, offsetof(struct pdc_cache_info, it_sp_count));
  259. DEFINE(ITLB_OFF_BASE, offsetof(struct pdc_cache_info, it_off_base));
  260. DEFINE(ITLB_OFF_STRIDE, offsetof(struct pdc_cache_info, it_off_stride));
  261. DEFINE(ITLB_OFF_COUNT, offsetof(struct pdc_cache_info, it_off_count));
  262. DEFINE(ITLB_LOOP, offsetof(struct pdc_cache_info, it_loop));
  263. DEFINE(DTLB_SID_BASE, offsetof(struct pdc_cache_info, dt_sp_base));
  264. DEFINE(DTLB_SID_STRIDE, offsetof(struct pdc_cache_info, dt_sp_stride));
  265. DEFINE(DTLB_SID_COUNT, offsetof(struct pdc_cache_info, dt_sp_count));
  266. DEFINE(DTLB_OFF_BASE, offsetof(struct pdc_cache_info, dt_off_base));
  267. DEFINE(DTLB_OFF_STRIDE, offsetof(struct pdc_cache_info, dt_off_stride));
  268. DEFINE(DTLB_OFF_COUNT, offsetof(struct pdc_cache_info, dt_off_count));
  269. DEFINE(DTLB_LOOP, offsetof(struct pdc_cache_info, dt_loop));
  270. BLANK();
  271. DEFINE(TIF_BLOCKSTEP_PA_BIT, 31-TIF_BLOCKSTEP);
  272. DEFINE(TIF_SINGLESTEP_PA_BIT, 31-TIF_SINGLESTEP);
  273. BLANK();
  274. DEFINE(ASM_PMD_SHIFT, PMD_SHIFT);
  275. DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT);
  276. DEFINE(ASM_BITS_PER_PGD, BITS_PER_PGD);
  277. DEFINE(ASM_BITS_PER_PMD, BITS_PER_PMD);
  278. DEFINE(ASM_BITS_PER_PTE, BITS_PER_PTE);
  279. DEFINE(ASM_PGD_PMD_OFFSET, -(PAGE_SIZE << PGD_ORDER));
  280. DEFINE(ASM_PMD_ENTRY, ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT));
  281. DEFINE(ASM_PGD_ENTRY, PAGE_OFFSET >> PGDIR_SHIFT);
  282. DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE);
  283. DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE);
  284. DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE);
  285. DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT);
  286. DEFINE(ASM_PT_INITIAL, PT_INITIAL);
  287. BLANK();
  288. /* HUGEPAGE_SIZE is only used in vmlinux.lds.S to align kernel text
  289. * and kernel data on physical huge pages */
  290. #ifdef CONFIG_HUGETLB_PAGE
  291. DEFINE(HUGEPAGE_SIZE, 1UL << REAL_HPAGE_SHIFT);
  292. #else
  293. DEFINE(HUGEPAGE_SIZE, PAGE_SIZE);
  294. #endif
  295. BLANK();
  296. DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip));
  297. DEFINE(EXCDATA_GP, offsetof(struct exception_data, fault_gp));
  298. DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space));
  299. DEFINE(EXCDATA_ADDR, offsetof(struct exception_data, fault_addr));
  300. BLANK();
  301. DEFINE(ASM_PDC_RESULT_SIZE, NUM_PDC_RESULT * sizeof(unsigned long));
  302. BLANK();
  303. return 0;
  304. }