head_44x.S 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. /*
  2. * Kernel execution entry point code.
  3. *
  4. * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
  5. * Initial PowerPC version.
  6. * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
  7. * Rewritten for PReP
  8. * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
  9. * Low-level exception handers, MMU support, and rewrite.
  10. * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
  11. * PowerPC 8xx modifications.
  12. * Copyright (c) 1998-1999 TiVo, Inc.
  13. * PowerPC 403GCX modifications.
  14. * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
  15. * PowerPC 403GCX/405GP modifications.
  16. * Copyright 2000 MontaVista Software Inc.
  17. * PPC405 modifications
  18. * PowerPC 403GCX/405GP modifications.
  19. * Author: MontaVista Software, Inc.
  20. * frank_rowand@mvista.com or source@mvista.com
  21. * debbie_chu@mvista.com
  22. * Copyright 2002-2005 MontaVista Software, Inc.
  23. * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
  24. *
  25. * This program is free software; you can redistribute it and/or modify it
  26. * under the terms of the GNU General Public License as published by the
  27. * Free Software Foundation; either version 2 of the License, or (at your
  28. * option) any later version.
  29. */
  30. #include <linux/init.h>
  31. #include <asm/processor.h>
  32. #include <asm/page.h>
  33. #include <asm/mmu.h>
  34. #include <asm/pgtable.h>
  35. #include <asm/cputable.h>
  36. #include <asm/thread_info.h>
  37. #include <asm/ppc_asm.h>
  38. #include <asm/asm-offsets.h>
  39. #include <asm/ptrace.h>
  40. #include <asm/synch.h>
  41. #include "head_booke.h"
  42. /* As with the other PowerPC ports, it is expected that when code
  43. * execution begins here, the following registers contain valid, yet
  44. * optional, information:
  45. *
  46. * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
  47. * r4 - Starting address of the init RAM disk
  48. * r5 - Ending address of the init RAM disk
  49. * r6 - Start of kernel command line string (e.g. "mem=128")
  50. * r7 - End of kernel command line string
  51. *
  52. */
  53. __HEAD
  54. _ENTRY(_stext);
  55. _ENTRY(_start);
  56. /*
  57. * Reserve a word at a fixed location to store the address
  58. * of abatron_pteptrs
  59. */
  60. nop
  61. /*
  62. * Save parameters we are passed
  63. */
  64. mr r31,r3
  65. mr r30,r4
  66. mr r29,r5
  67. mr r28,r6
  68. mr r27,r7
  69. li r24,0 /* CPU number */
  70. bl init_cpu_state
  71. /*
  72. * This is where the main kernel code starts.
  73. */
  74. /* ptr to current */
  75. lis r2,init_task@h
  76. ori r2,r2,init_task@l
  77. /* ptr to current thread */
  78. addi r4,r2,THREAD /* init task's THREAD */
  79. mtspr SPRN_SPRG_THREAD,r4
  80. /* stack */
  81. lis r1,init_thread_union@h
  82. ori r1,r1,init_thread_union@l
  83. li r0,0
  84. stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
  85. bl early_init
  86. #ifdef CONFIG_RELOCATABLE
  87. /*
  88. * r25 will contain RPN/ERPN for the start address of memory
  89. *
  90. * Add the difference between KERNELBASE and PAGE_OFFSET to the
  91. * start of physical memory to get kernstart_addr.
  92. */
  93. lis r3,kernstart_addr@ha
  94. la r3,kernstart_addr@l(r3)
  95. lis r4,KERNELBASE@h
  96. ori r4,r4,KERNELBASE@l
  97. lis r5,PAGE_OFFSET@h
  98. ori r5,r5,PAGE_OFFSET@l
  99. subf r4,r5,r4
  100. rlwinm r6,r25,0,28,31 /* ERPN */
  101. rlwinm r7,r25,0,0,3 /* RPN - assuming 256 MB page size */
  102. add r7,r7,r4
  103. stw r6,0(r3)
  104. stw r7,4(r3)
  105. #endif
  106. /*
  107. * Decide what sort of machine this is and initialize the MMU.
  108. */
  109. mr r3,r31
  110. mr r4,r30
  111. mr r5,r29
  112. mr r6,r28
  113. mr r7,r27
  114. bl machine_init
  115. bl MMU_init
  116. /* Setup PTE pointers for the Abatron bdiGDB */
  117. lis r6, swapper_pg_dir@h
  118. ori r6, r6, swapper_pg_dir@l
  119. lis r5, abatron_pteptrs@h
  120. ori r5, r5, abatron_pteptrs@l
  121. lis r4, KERNELBASE@h
  122. ori r4, r4, KERNELBASE@l
  123. stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
  124. stw r6, 0(r5)
  125. /* Clear the Machine Check Syndrome Register */
  126. li r0,0
  127. mtspr SPRN_MCSR,r0
  128. /* Let's move on */
  129. lis r4,start_kernel@h
  130. ori r4,r4,start_kernel@l
  131. lis r3,MSR_KERNEL@h
  132. ori r3,r3,MSR_KERNEL@l
  133. mtspr SPRN_SRR0,r4
  134. mtspr SPRN_SRR1,r3
  135. rfi /* change context and jump to start_kernel */
  136. /*
  137. * Interrupt vector entry code
  138. *
  139. * The Book E MMUs are always on so we don't need to handle
  140. * interrupts in real mode as with previous PPC processors. In
  141. * this case we handle interrupts in the kernel virtual address
  142. * space.
  143. *
  144. * Interrupt vectors are dynamically placed relative to the
  145. * interrupt prefix as determined by the address of interrupt_base.
  146. * The interrupt vectors offsets are programmed using the labels
  147. * for each interrupt vector entry.
  148. *
  149. * Interrupt vectors must be aligned on a 16 byte boundary.
  150. * We align on a 32 byte cache line boundary for good measure.
  151. */
  152. interrupt_base:
  153. /* Critical Input Interrupt */
  154. CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
  155. /* Machine Check Interrupt */
  156. CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
  157. MCHECK_EXCEPTION(0x0210, MachineCheckA, machine_check_exception)
  158. /* Data Storage Interrupt */
  159. DATA_STORAGE_EXCEPTION
  160. /* Instruction Storage Interrupt */
  161. INSTRUCTION_STORAGE_EXCEPTION
  162. /* External Input Interrupt */
  163. EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE)
  164. /* Alignment Interrupt */
  165. ALIGNMENT_EXCEPTION
  166. /* Program Interrupt */
  167. PROGRAM_EXCEPTION
  168. /* Floating Point Unavailable Interrupt */
  169. #ifdef CONFIG_PPC_FPU
  170. FP_UNAVAILABLE_EXCEPTION
  171. #else
  172. EXCEPTION(0x2010, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
  173. #endif
  174. /* System Call Interrupt */
  175. START_EXCEPTION(SystemCall)
  176. NORMAL_EXCEPTION_PROLOG
  177. EXC_XFER_EE_LITE(0x0c00, DoSyscall)
  178. /* Auxiliary Processor Unavailable Interrupt */
  179. EXCEPTION(0x2020, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
  180. /* Decrementer Interrupt */
  181. DECREMENTER_EXCEPTION
  182. /* Fixed Internal Timer Interrupt */
  183. /* TODO: Add FIT support */
  184. EXCEPTION(0x1010, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
  185. /* Watchdog Timer Interrupt */
  186. /* TODO: Add watchdog support */
  187. #ifdef CONFIG_BOOKE_WDT
  188. CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
  189. #else
  190. CRITICAL_EXCEPTION(0x1020, WatchdogTimer, unknown_exception)
  191. #endif
  192. /* Data TLB Error Interrupt */
  193. START_EXCEPTION(DataTLBError44x)
  194. mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
  195. mtspr SPRN_SPRG_WSCRATCH1, r11
  196. mtspr SPRN_SPRG_WSCRATCH2, r12
  197. mtspr SPRN_SPRG_WSCRATCH3, r13
  198. mfcr r11
  199. mtspr SPRN_SPRG_WSCRATCH4, r11
  200. mfspr r10, SPRN_DEAR /* Get faulting address */
  201. /* If we are faulting a kernel address, we have to use the
  202. * kernel page tables.
  203. */
  204. lis r11, PAGE_OFFSET@h
  205. cmplw r10, r11
  206. blt+ 3f
  207. lis r11, swapper_pg_dir@h
  208. ori r11, r11, swapper_pg_dir@l
  209. mfspr r12,SPRN_MMUCR
  210. rlwinm r12,r12,0,0,23 /* Clear TID */
  211. b 4f
  212. /* Get the PGD for the current thread */
  213. 3:
  214. mfspr r11,SPRN_SPRG_THREAD
  215. lwz r11,PGDIR(r11)
  216. /* Load PID into MMUCR TID */
  217. mfspr r12,SPRN_MMUCR
  218. mfspr r13,SPRN_PID /* Get PID */
  219. rlwimi r12,r13,0,24,31 /* Set TID */
  220. 4:
  221. mtspr SPRN_MMUCR,r12
  222. /* Mask of required permission bits. Note that while we
  223. * do copy ESR:ST to _PAGE_RW position as trying to write
  224. * to an RO page is pretty common, we don't do it with
  225. * _PAGE_DIRTY. We could do it, but it's a fairly rare
  226. * event so I'd rather take the overhead when it happens
  227. * rather than adding an instruction here. We should measure
  228. * whether the whole thing is worth it in the first place
  229. * as we could avoid loading SPRN_ESR completely in the first
  230. * place...
  231. *
  232. * TODO: Is it worth doing that mfspr & rlwimi in the first
  233. * place or can we save a couple of instructions here ?
  234. */
  235. mfspr r12,SPRN_ESR
  236. li r13,_PAGE_PRESENT|_PAGE_ACCESSED
  237. rlwimi r13,r12,10,30,30
  238. /* Load the PTE */
  239. /* Compute pgdir/pmd offset */
  240. rlwinm r12, r10, PPC44x_PGD_OFF_SHIFT, PPC44x_PGD_OFF_MASK_BIT, 29
  241. lwzx r11, r12, r11 /* Get pgd/pmd entry */
  242. rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
  243. beq 2f /* Bail if no table */
  244. /* Compute pte address */
  245. rlwimi r12, r10, PPC44x_PTE_ADD_SHIFT, PPC44x_PTE_ADD_MASK_BIT, 28
  246. lwz r11, 0(r12) /* Get high word of pte entry */
  247. lwz r12, 4(r12) /* Get low word of pte entry */
  248. lis r10,tlb_44x_index@ha
  249. andc. r13,r13,r12 /* Check permission */
  250. /* Load the next available TLB index */
  251. lwz r13,tlb_44x_index@l(r10)
  252. bne 2f /* Bail if permission mismach */
  253. /* Increment, rollover, and store TLB index */
  254. addi r13,r13,1
  255. /* Compare with watermark (instruction gets patched) */
  256. .globl tlb_44x_patch_hwater_D
  257. tlb_44x_patch_hwater_D:
  258. cmpwi 0,r13,1 /* reserve entries */
  259. ble 5f
  260. li r13,0
  261. 5:
  262. /* Store the next available TLB index */
  263. stw r13,tlb_44x_index@l(r10)
  264. /* Re-load the faulting address */
  265. mfspr r10,SPRN_DEAR
  266. /* Jump to common tlb load */
  267. b finish_tlb_load_44x
  268. 2:
  269. /* The bailout. Restore registers to pre-exception conditions
  270. * and call the heavyweights to help us out.
  271. */
  272. mfspr r11, SPRN_SPRG_RSCRATCH4
  273. mtcr r11
  274. mfspr r13, SPRN_SPRG_RSCRATCH3
  275. mfspr r12, SPRN_SPRG_RSCRATCH2
  276. mfspr r11, SPRN_SPRG_RSCRATCH1
  277. mfspr r10, SPRN_SPRG_RSCRATCH0
  278. b DataStorage
  279. /* Instruction TLB Error Interrupt */
  280. /*
  281. * Nearly the same as above, except we get our
  282. * information from different registers and bailout
  283. * to a different point.
  284. */
  285. START_EXCEPTION(InstructionTLBError44x)
  286. mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
  287. mtspr SPRN_SPRG_WSCRATCH1, r11
  288. mtspr SPRN_SPRG_WSCRATCH2, r12
  289. mtspr SPRN_SPRG_WSCRATCH3, r13
  290. mfcr r11
  291. mtspr SPRN_SPRG_WSCRATCH4, r11
  292. mfspr r10, SPRN_SRR0 /* Get faulting address */
  293. /* If we are faulting a kernel address, we have to use the
  294. * kernel page tables.
  295. */
  296. lis r11, PAGE_OFFSET@h
  297. cmplw r10, r11
  298. blt+ 3f
  299. lis r11, swapper_pg_dir@h
  300. ori r11, r11, swapper_pg_dir@l
  301. mfspr r12,SPRN_MMUCR
  302. rlwinm r12,r12,0,0,23 /* Clear TID */
  303. b 4f
  304. /* Get the PGD for the current thread */
  305. 3:
  306. mfspr r11,SPRN_SPRG_THREAD
  307. lwz r11,PGDIR(r11)
  308. /* Load PID into MMUCR TID */
  309. mfspr r12,SPRN_MMUCR
  310. mfspr r13,SPRN_PID /* Get PID */
  311. rlwimi r12,r13,0,24,31 /* Set TID */
  312. 4:
  313. mtspr SPRN_MMUCR,r12
  314. /* Make up the required permissions */
  315. li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
  316. /* Compute pgdir/pmd offset */
  317. rlwinm r12, r10, PPC44x_PGD_OFF_SHIFT, PPC44x_PGD_OFF_MASK_BIT, 29
  318. lwzx r11, r12, r11 /* Get pgd/pmd entry */
  319. rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
  320. beq 2f /* Bail if no table */
  321. /* Compute pte address */
  322. rlwimi r12, r10, PPC44x_PTE_ADD_SHIFT, PPC44x_PTE_ADD_MASK_BIT, 28
  323. lwz r11, 0(r12) /* Get high word of pte entry */
  324. lwz r12, 4(r12) /* Get low word of pte entry */
  325. lis r10,tlb_44x_index@ha
  326. andc. r13,r13,r12 /* Check permission */
  327. /* Load the next available TLB index */
  328. lwz r13,tlb_44x_index@l(r10)
  329. bne 2f /* Bail if permission mismach */
  330. /* Increment, rollover, and store TLB index */
  331. addi r13,r13,1
  332. /* Compare with watermark (instruction gets patched) */
  333. .globl tlb_44x_patch_hwater_I
  334. tlb_44x_patch_hwater_I:
  335. cmpwi 0,r13,1 /* reserve entries */
  336. ble 5f
  337. li r13,0
  338. 5:
  339. /* Store the next available TLB index */
  340. stw r13,tlb_44x_index@l(r10)
  341. /* Re-load the faulting address */
  342. mfspr r10,SPRN_SRR0
  343. /* Jump to common TLB load point */
  344. b finish_tlb_load_44x
  345. 2:
  346. /* The bailout. Restore registers to pre-exception conditions
  347. * and call the heavyweights to help us out.
  348. */
  349. mfspr r11, SPRN_SPRG_RSCRATCH4
  350. mtcr r11
  351. mfspr r13, SPRN_SPRG_RSCRATCH3
  352. mfspr r12, SPRN_SPRG_RSCRATCH2
  353. mfspr r11, SPRN_SPRG_RSCRATCH1
  354. mfspr r10, SPRN_SPRG_RSCRATCH0
  355. b InstructionStorage
  356. /*
  357. * Both the instruction and data TLB miss get to this
  358. * point to load the TLB.
  359. * r10 - EA of fault
  360. * r11 - PTE high word value
  361. * r12 - PTE low word value
  362. * r13 - TLB index
  363. * MMUCR - loaded with proper value when we get here
  364. * Upon exit, we reload everything and RFI.
  365. */
  366. finish_tlb_load_44x:
  367. /* Combine RPN & ERPN an write WS 0 */
  368. rlwimi r11,r12,0,0,31-PAGE_SHIFT
  369. tlbwe r11,r13,PPC44x_TLB_XLAT
  370. /*
  371. * Create WS1. This is the faulting address (EPN),
  372. * page size, and valid flag.
  373. */
  374. li r11,PPC44x_TLB_VALID | PPC44x_TLBE_SIZE
  375. /* Insert valid and page size */
  376. rlwimi r10,r11,0,PPC44x_PTE_ADD_MASK_BIT,31
  377. tlbwe r10,r13,PPC44x_TLB_PAGEID /* Write PAGEID */
  378. /* And WS 2 */
  379. li r10,0xf85 /* Mask to apply from PTE */
  380. rlwimi r10,r12,29,30,30 /* DIRTY -> SW position */
  381. and r11,r12,r10 /* Mask PTE bits to keep */
  382. andi. r10,r12,_PAGE_USER /* User page ? */
  383. beq 1f /* nope, leave U bits empty */
  384. rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */
  385. 1: tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */
  386. /* Done...restore registers and get out of here.
  387. */
  388. mfspr r11, SPRN_SPRG_RSCRATCH4
  389. mtcr r11
  390. mfspr r13, SPRN_SPRG_RSCRATCH3
  391. mfspr r12, SPRN_SPRG_RSCRATCH2
  392. mfspr r11, SPRN_SPRG_RSCRATCH1
  393. mfspr r10, SPRN_SPRG_RSCRATCH0
  394. rfi /* Force context change */
  395. /* TLB error interrupts for 476
  396. */
  397. #ifdef CONFIG_PPC_47x
  398. START_EXCEPTION(DataTLBError47x)
  399. mtspr SPRN_SPRG_WSCRATCH0,r10 /* Save some working registers */
  400. mtspr SPRN_SPRG_WSCRATCH1,r11
  401. mtspr SPRN_SPRG_WSCRATCH2,r12
  402. mtspr SPRN_SPRG_WSCRATCH3,r13
  403. mfcr r11
  404. mtspr SPRN_SPRG_WSCRATCH4,r11
  405. mfspr r10,SPRN_DEAR /* Get faulting address */
  406. /* If we are faulting a kernel address, we have to use the
  407. * kernel page tables.
  408. */
  409. lis r11,PAGE_OFFSET@h
  410. cmplw cr0,r10,r11
  411. blt+ 3f
  412. lis r11,swapper_pg_dir@h
  413. ori r11,r11, swapper_pg_dir@l
  414. li r12,0 /* MMUCR = 0 */
  415. b 4f
  416. /* Get the PGD for the current thread and setup MMUCR */
  417. 3: mfspr r11,SPRN_SPRG3
  418. lwz r11,PGDIR(r11)
  419. mfspr r12,SPRN_PID /* Get PID */
  420. 4: mtspr SPRN_MMUCR,r12 /* Set MMUCR */
  421. /* Mask of required permission bits. Note that while we
  422. * do copy ESR:ST to _PAGE_RW position as trying to write
  423. * to an RO page is pretty common, we don't do it with
  424. * _PAGE_DIRTY. We could do it, but it's a fairly rare
  425. * event so I'd rather take the overhead when it happens
  426. * rather than adding an instruction here. We should measure
  427. * whether the whole thing is worth it in the first place
  428. * as we could avoid loading SPRN_ESR completely in the first
  429. * place...
  430. *
  431. * TODO: Is it worth doing that mfspr & rlwimi in the first
  432. * place or can we save a couple of instructions here ?
  433. */
  434. mfspr r12,SPRN_ESR
  435. li r13,_PAGE_PRESENT|_PAGE_ACCESSED
  436. rlwimi r13,r12,10,30,30
  437. /* Load the PTE */
  438. /* Compute pgdir/pmd offset */
  439. rlwinm r12,r10,PPC44x_PGD_OFF_SHIFT,PPC44x_PGD_OFF_MASK_BIT,29
  440. lwzx r11,r12,r11 /* Get pgd/pmd entry */
  441. /* Word 0 is EPN,V,TS,DSIZ */
  442. li r12,PPC47x_TLB0_VALID | PPC47x_TLBE_SIZE
  443. rlwimi r10,r12,0,32-PAGE_SHIFT,31 /* Insert valid and page size*/
  444. li r12,0
  445. tlbwe r10,r12,0
  446. /* XXX can we do better ? Need to make sure tlbwe has established
  447. * latch V bit in MMUCR0 before the PTE is loaded further down */
  448. #ifdef CONFIG_SMP
  449. isync
  450. #endif
  451. rlwinm. r12,r11,0,0,20 /* Extract pt base address */
  452. /* Compute pte address */
  453. rlwimi r12,r10,PPC44x_PTE_ADD_SHIFT,PPC44x_PTE_ADD_MASK_BIT,28
  454. beq 2f /* Bail if no table */
  455. lwz r11,0(r12) /* Get high word of pte entry */
  456. /* XXX can we do better ? maybe insert a known 0 bit from r11 into the
  457. * bottom of r12 to create a data dependency... We can also use r10
  458. * as destination nowadays
  459. */
  460. #ifdef CONFIG_SMP
  461. lwsync
  462. #endif
  463. lwz r12,4(r12) /* Get low word of pte entry */
  464. andc. r13,r13,r12 /* Check permission */
  465. /* Jump to common tlb load */
  466. beq finish_tlb_load_47x
  467. 2: /* The bailout. Restore registers to pre-exception conditions
  468. * and call the heavyweights to help us out.
  469. */
  470. mfspr r11,SPRN_SPRG_RSCRATCH4
  471. mtcr r11
  472. mfspr r13,SPRN_SPRG_RSCRATCH3
  473. mfspr r12,SPRN_SPRG_RSCRATCH2
  474. mfspr r11,SPRN_SPRG_RSCRATCH1
  475. mfspr r10,SPRN_SPRG_RSCRATCH0
  476. b DataStorage
  477. /* Instruction TLB Error Interrupt */
  478. /*
  479. * Nearly the same as above, except we get our
  480. * information from different registers and bailout
  481. * to a different point.
  482. */
  483. START_EXCEPTION(InstructionTLBError47x)
  484. mtspr SPRN_SPRG_WSCRATCH0,r10 /* Save some working registers */
  485. mtspr SPRN_SPRG_WSCRATCH1,r11
  486. mtspr SPRN_SPRG_WSCRATCH2,r12
  487. mtspr SPRN_SPRG_WSCRATCH3,r13
  488. mfcr r11
  489. mtspr SPRN_SPRG_WSCRATCH4,r11
  490. mfspr r10,SPRN_SRR0 /* Get faulting address */
  491. /* If we are faulting a kernel address, we have to use the
  492. * kernel page tables.
  493. */
  494. lis r11,PAGE_OFFSET@h
  495. cmplw cr0,r10,r11
  496. blt+ 3f
  497. lis r11,swapper_pg_dir@h
  498. ori r11,r11, swapper_pg_dir@l
  499. li r12,0 /* MMUCR = 0 */
  500. b 4f
  501. /* Get the PGD for the current thread and setup MMUCR */
  502. 3: mfspr r11,SPRN_SPRG_THREAD
  503. lwz r11,PGDIR(r11)
  504. mfspr r12,SPRN_PID /* Get PID */
  505. 4: mtspr SPRN_MMUCR,r12 /* Set MMUCR */
  506. /* Make up the required permissions */
  507. li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
  508. /* Load PTE */
  509. /* Compute pgdir/pmd offset */
  510. rlwinm r12,r10,PPC44x_PGD_OFF_SHIFT,PPC44x_PGD_OFF_MASK_BIT,29
  511. lwzx r11,r12,r11 /* Get pgd/pmd entry */
  512. /* Word 0 is EPN,V,TS,DSIZ */
  513. li r12,PPC47x_TLB0_VALID | PPC47x_TLBE_SIZE
  514. rlwimi r10,r12,0,32-PAGE_SHIFT,31 /* Insert valid and page size*/
  515. li r12,0
  516. tlbwe r10,r12,0
  517. /* XXX can we do better ? Need to make sure tlbwe has established
  518. * latch V bit in MMUCR0 before the PTE is loaded further down */
  519. #ifdef CONFIG_SMP
  520. isync
  521. #endif
  522. rlwinm. r12,r11,0,0,20 /* Extract pt base address */
  523. /* Compute pte address */
  524. rlwimi r12,r10,PPC44x_PTE_ADD_SHIFT,PPC44x_PTE_ADD_MASK_BIT,28
  525. beq 2f /* Bail if no table */
  526. lwz r11,0(r12) /* Get high word of pte entry */
  527. /* XXX can we do better ? maybe insert a known 0 bit from r11 into the
  528. * bottom of r12 to create a data dependency... We can also use r10
  529. * as destination nowadays
  530. */
  531. #ifdef CONFIG_SMP
  532. lwsync
  533. #endif
  534. lwz r12,4(r12) /* Get low word of pte entry */
  535. andc. r13,r13,r12 /* Check permission */
  536. /* Jump to common TLB load point */
  537. beq finish_tlb_load_47x
  538. 2: /* The bailout. Restore registers to pre-exception conditions
  539. * and call the heavyweights to help us out.
  540. */
  541. mfspr r11, SPRN_SPRG_RSCRATCH4
  542. mtcr r11
  543. mfspr r13, SPRN_SPRG_RSCRATCH3
  544. mfspr r12, SPRN_SPRG_RSCRATCH2
  545. mfspr r11, SPRN_SPRG_RSCRATCH1
  546. mfspr r10, SPRN_SPRG_RSCRATCH0
  547. b InstructionStorage
  548. /*
  549. * Both the instruction and data TLB miss get to this
  550. * point to load the TLB.
  551. * r10 - free to use
  552. * r11 - PTE high word value
  553. * r12 - PTE low word value
  554. * r13 - free to use
  555. * MMUCR - loaded with proper value when we get here
  556. * Upon exit, we reload everything and RFI.
  557. */
  558. finish_tlb_load_47x:
  559. /* Combine RPN & ERPN an write WS 1 */
  560. rlwimi r11,r12,0,0,31-PAGE_SHIFT
  561. tlbwe r11,r13,1
  562. /* And make up word 2 */
  563. li r10,0xf85 /* Mask to apply from PTE */
  564. rlwimi r10,r12,29,30,30 /* DIRTY -> SW position */
  565. and r11,r12,r10 /* Mask PTE bits to keep */
  566. andi. r10,r12,_PAGE_USER /* User page ? */
  567. beq 1f /* nope, leave U bits empty */
  568. rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */
  569. 1: tlbwe r11,r13,2
  570. /* Done...restore registers and get out of here.
  571. */
  572. mfspr r11, SPRN_SPRG_RSCRATCH4
  573. mtcr r11
  574. mfspr r13, SPRN_SPRG_RSCRATCH3
  575. mfspr r12, SPRN_SPRG_RSCRATCH2
  576. mfspr r11, SPRN_SPRG_RSCRATCH1
  577. mfspr r10, SPRN_SPRG_RSCRATCH0
  578. rfi
  579. #endif /* CONFIG_PPC_47x */
  580. /* Debug Interrupt */
  581. /*
  582. * This statement needs to exist at the end of the IVPR
  583. * definition just in case you end up taking a debug
  584. * exception within another exception.
  585. */
  586. DEBUG_CRIT_EXCEPTION
  587. /*
  588. * Global functions
  589. */
  590. /*
  591. * Adjust the machine check IVOR on 440A cores
  592. */
  593. _GLOBAL(__fixup_440A_mcheck)
  594. li r3,MachineCheckA@l
  595. mtspr SPRN_IVOR1,r3
  596. sync
  597. blr
  598. /*
  599. * extern void giveup_altivec(struct task_struct *prev)
  600. *
  601. * The 44x core does not have an AltiVec unit.
  602. */
  603. _GLOBAL(giveup_altivec)
  604. blr
  605. /*
  606. * extern void giveup_fpu(struct task_struct *prev)
  607. *
  608. * The 44x core does not have an FPU.
  609. */
  610. #ifndef CONFIG_PPC_FPU
  611. _GLOBAL(giveup_fpu)
  612. blr
  613. #endif
  614. _GLOBAL(set_context)
  615. #ifdef CONFIG_BDI_SWITCH
  616. /* Context switch the PTE pointer for the Abatron BDI2000.
  617. * The PGDIR is the second parameter.
  618. */
  619. lis r5, abatron_pteptrs@h
  620. ori r5, r5, abatron_pteptrs@l
  621. stw r4, 0x4(r5)
  622. #endif
  623. mtspr SPRN_PID,r3
  624. isync /* Force context change */
  625. blr
  626. /*
  627. * Init CPU state. This is called at boot time or for secondary CPUs
  628. * to setup initial TLB entries, setup IVORs, etc...
  629. *
  630. */
  631. _GLOBAL(init_cpu_state)
  632. mflr r22
  633. #ifdef CONFIG_PPC_47x
  634. /* We use the PVR to differenciate 44x cores from 476 */
  635. mfspr r3,SPRN_PVR
  636. srwi r3,r3,16
  637. cmplwi cr0,r3,PVR_476@h
  638. beq head_start_47x
  639. cmplwi cr0,r3,PVR_476_ISS@h
  640. beq head_start_47x
  641. #endif /* CONFIG_PPC_47x */
  642. /*
  643. * In case the firmware didn't do it, we apply some workarounds
  644. * that are good for all 440 core variants here
  645. */
  646. mfspr r3,SPRN_CCR0
  647. rlwinm r3,r3,0,0,27 /* disable icache prefetch */
  648. isync
  649. mtspr SPRN_CCR0,r3
  650. isync
  651. sync
  652. /*
  653. * Set up the initial MMU state for 44x
  654. *
  655. * We are still executing code at the virtual address
  656. * mappings set by the firmware for the base of RAM.
  657. *
  658. * We first invalidate all TLB entries but the one
  659. * we are running from. We then load the KERNELBASE
  660. * mappings so we can begin to use kernel addresses
  661. * natively and so the interrupt vector locations are
  662. * permanently pinned (necessary since Book E
  663. * implementations always have translation enabled).
  664. *
  665. * TODO: Use the known TLB entry we are running from to
  666. * determine which physical region we are located
  667. * in. This can be used to determine where in RAM
  668. * (on a shared CPU system) or PCI memory space
  669. * (on a DRAMless system) we are located.
  670. * For now, we assume a perfect world which means
  671. * we are located at the base of DRAM (physical 0).
  672. */
  673. /*
  674. * Search TLB for entry that we are currently using.
  675. * Invalidate all entries but the one we are using.
  676. */
  677. /* Load our current PID->MMUCR TID and MSR IS->MMUCR STS */
  678. mfspr r3,SPRN_PID /* Get PID */
  679. mfmsr r4 /* Get MSR */
  680. andi. r4,r4,MSR_IS@l /* TS=1? */
  681. beq wmmucr /* If not, leave STS=0 */
  682. oris r3,r3,PPC44x_MMUCR_STS@h /* Set STS=1 */
  683. wmmucr: mtspr SPRN_MMUCR,r3 /* Put MMUCR */
  684. sync
  685. bl invstr /* Find our address */
  686. invstr: mflr r5 /* Make it accessible */
  687. tlbsx r23,0,r5 /* Find entry we are in */
  688. li r4,0 /* Start at TLB entry 0 */
  689. li r3,0 /* Set PAGEID inval value */
  690. 1: cmpw r23,r4 /* Is this our entry? */
  691. beq skpinv /* If so, skip the inval */
  692. tlbwe r3,r4,PPC44x_TLB_PAGEID /* If not, inval the entry */
  693. skpinv: addi r4,r4,1 /* Increment */
  694. cmpwi r4,64 /* Are we done? */
  695. bne 1b /* If not, repeat */
  696. isync /* If so, context change */
  697. /*
  698. * Configure and load pinned entry into TLB slot 63.
  699. */
  700. lis r3,PAGE_OFFSET@h
  701. ori r3,r3,PAGE_OFFSET@l
  702. /* Kernel is at the base of RAM */
  703. li r4, 0 /* Load the kernel physical address */
  704. /* Load the kernel PID = 0 */
  705. li r0,0
  706. mtspr SPRN_PID,r0
  707. sync
  708. /* Initialize MMUCR */
  709. li r5,0
  710. mtspr SPRN_MMUCR,r5
  711. sync
  712. /* pageid fields */
  713. clrrwi r3,r3,10 /* Mask off the effective page number */
  714. ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M
  715. /* xlat fields */
  716. clrrwi r4,r4,10 /* Mask off the real page number */
  717. /* ERPN is 0 for first 4GB page */
  718. /* attrib fields */
  719. /* Added guarded bit to protect against speculative loads/stores */
  720. li r5,0
  721. ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G)
  722. li r0,63 /* TLB slot 63 */
  723. tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
  724. tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
  725. tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */
  726. /* Force context change */
  727. mfmsr r0
  728. mtspr SPRN_SRR1, r0
  729. lis r0,3f@h
  730. ori r0,r0,3f@l
  731. mtspr SPRN_SRR0,r0
  732. sync
  733. rfi
  734. /* If necessary, invalidate original entry we used */
  735. 3: cmpwi r23,63
  736. beq 4f
  737. li r6,0
  738. tlbwe r6,r23,PPC44x_TLB_PAGEID
  739. isync
  740. 4:
  741. #ifdef CONFIG_PPC_EARLY_DEBUG_44x
  742. /* Add UART mapping for early debug. */
  743. /* pageid fields */
  744. lis r3,PPC44x_EARLY_DEBUG_VIRTADDR@h
  745. ori r3,r3,PPC44x_TLB_VALID|PPC44x_TLB_TS|PPC44x_TLB_64K
  746. /* xlat fields */
  747. lis r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW@h
  748. ori r4,r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH
  749. /* attrib fields */
  750. li r5,(PPC44x_TLB_SW|PPC44x_TLB_SR|PPC44x_TLB_I|PPC44x_TLB_G)
  751. li r0,62 /* TLB slot 0 */
  752. tlbwe r3,r0,PPC44x_TLB_PAGEID
  753. tlbwe r4,r0,PPC44x_TLB_XLAT
  754. tlbwe r5,r0,PPC44x_TLB_ATTRIB
  755. /* Force context change */
  756. isync
  757. #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
  758. /* Establish the interrupt vector offsets */
  759. SET_IVOR(0, CriticalInput);
  760. SET_IVOR(1, MachineCheck);
  761. SET_IVOR(2, DataStorage);
  762. SET_IVOR(3, InstructionStorage);
  763. SET_IVOR(4, ExternalInput);
  764. SET_IVOR(5, Alignment);
  765. SET_IVOR(6, Program);
  766. SET_IVOR(7, FloatingPointUnavailable);
  767. SET_IVOR(8, SystemCall);
  768. SET_IVOR(9, AuxillaryProcessorUnavailable);
  769. SET_IVOR(10, Decrementer);
  770. SET_IVOR(11, FixedIntervalTimer);
  771. SET_IVOR(12, WatchdogTimer);
  772. SET_IVOR(13, DataTLBError44x);
  773. SET_IVOR(14, InstructionTLBError44x);
  774. SET_IVOR(15, DebugCrit);
  775. b head_start_common
  776. #ifdef CONFIG_PPC_47x
  777. #ifdef CONFIG_SMP
  778. /* Entry point for secondary 47x processors */
  779. _GLOBAL(start_secondary_47x)
  780. mr r24,r3 /* CPU number */
  781. bl init_cpu_state
  782. /* Now we need to bolt the rest of kernel memory which
  783. * is done in C code. We must be careful because our task
  784. * struct or our stack can (and will probably) be out
  785. * of reach of the initial 256M TLB entry, so we use a
  786. * small temporary stack in .bss for that. This works
  787. * because only one CPU at a time can be in this code
  788. */
  789. lis r1,temp_boot_stack@h
  790. ori r1,r1,temp_boot_stack@l
  791. addi r1,r1,1024-STACK_FRAME_OVERHEAD
  792. li r0,0
  793. stw r0,0(r1)
  794. bl mmu_init_secondary
  795. /* Now we can get our task struct and real stack pointer */
  796. /* Get current_thread_info and current */
  797. lis r1,secondary_ti@ha
  798. lwz r1,secondary_ti@l(r1)
  799. lwz r2,TI_TASK(r1)
  800. /* Current stack pointer */
  801. addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
  802. li r0,0
  803. stw r0,0(r1)
  804. /* Kernel stack for exception entry in SPRG3 */
  805. addi r4,r2,THREAD /* init task's THREAD */
  806. mtspr SPRN_SPRG3,r4
  807. b start_secondary
  808. #endif /* CONFIG_SMP */
  809. /*
  810. * Set up the initial MMU state for 44x
  811. *
  812. * We are still executing code at the virtual address
  813. * mappings set by the firmware for the base of RAM.
  814. */
  815. head_start_47x:
  816. /* Load our current PID->MMUCR TID and MSR IS->MMUCR STS */
  817. mfspr r3,SPRN_PID /* Get PID */
  818. mfmsr r4 /* Get MSR */
  819. andi. r4,r4,MSR_IS@l /* TS=1? */
  820. beq 1f /* If not, leave STS=0 */
  821. oris r3,r3,PPC47x_MMUCR_STS@h /* Set STS=1 */
  822. 1: mtspr SPRN_MMUCR,r3 /* Put MMUCR */
  823. sync
  824. /* Find the entry we are running from */
  825. bl 1f
  826. 1: mflr r23
  827. tlbsx r23,0,r23
  828. tlbre r24,r23,0
  829. tlbre r25,r23,1
  830. tlbre r26,r23,2
  831. /*
  832. * Cleanup time
  833. */
  834. /* Initialize MMUCR */
  835. li r5,0
  836. mtspr SPRN_MMUCR,r5
  837. sync
  838. clear_all_utlb_entries:
  839. #; Set initial values.
  840. addis r3,0,0x8000
  841. addi r4,0,0
  842. addi r5,0,0
  843. b clear_utlb_entry
  844. #; Align the loop to speed things up.
  845. .align 6
  846. clear_utlb_entry:
  847. tlbwe r4,r3,0
  848. tlbwe r5,r3,1
  849. tlbwe r5,r3,2
  850. addis r3,r3,0x2000
  851. cmpwi r3,0
  852. bne clear_utlb_entry
  853. addis r3,0,0x8000
  854. addis r4,r4,0x100
  855. cmpwi r4,0
  856. bne clear_utlb_entry
  857. #; Restore original entry.
  858. oris r23,r23,0x8000 /* specify the way */
  859. tlbwe r24,r23,0
  860. tlbwe r25,r23,1
  861. tlbwe r26,r23,2
  862. /*
  863. * Configure and load pinned entry into TLB for the kernel core
  864. */
  865. lis r3,PAGE_OFFSET@h
  866. ori r3,r3,PAGE_OFFSET@l
  867. /* Load the kernel PID = 0 */
  868. li r0,0
  869. mtspr SPRN_PID,r0
  870. sync
  871. /* Word 0 */
  872. clrrwi r3,r3,12 /* Mask off the effective page number */
  873. ori r3,r3,PPC47x_TLB0_VALID | PPC47x_TLB0_256M
  874. /* Word 1 - use r25. RPN is the same as the original entry */
  875. /* Word 2 */
  876. li r5,0
  877. ori r5,r5,PPC47x_TLB2_S_RWX
  878. #ifdef CONFIG_SMP
  879. ori r5,r5,PPC47x_TLB2_M
  880. #endif
  881. /* We write to way 0 and bolted 0 */
  882. lis r0,0x8800
  883. tlbwe r3,r0,0
  884. tlbwe r25,r0,1
  885. tlbwe r5,r0,2
  886. /*
  887. * Configure SSPCR, ISPCR and USPCR for now to search everything, we can fix
  888. * them up later
  889. */
  890. LOAD_REG_IMMEDIATE(r3, 0x9abcdef0)
  891. mtspr SPRN_SSPCR,r3
  892. mtspr SPRN_USPCR,r3
  893. LOAD_REG_IMMEDIATE(r3, 0x12345670)
  894. mtspr SPRN_ISPCR,r3
  895. /* Force context change */
  896. mfmsr r0
  897. mtspr SPRN_SRR1, r0
  898. lis r0,3f@h
  899. ori r0,r0,3f@l
  900. mtspr SPRN_SRR0,r0
  901. sync
  902. rfi
  903. /* Invalidate original entry we used */
  904. 3:
  905. rlwinm r24,r24,0,21,19 /* clear the "valid" bit */
  906. tlbwe r24,r23,0
  907. addi r24,0,0
  908. tlbwe r24,r23,1
  909. tlbwe r24,r23,2
  910. isync /* Clear out the shadow TLB entries */
  911. #ifdef CONFIG_PPC_EARLY_DEBUG_44x
  912. /* Add UART mapping for early debug. */
  913. /* Word 0 */
  914. lis r3,PPC44x_EARLY_DEBUG_VIRTADDR@h
  915. ori r3,r3,PPC47x_TLB0_VALID | PPC47x_TLB0_TS | PPC47x_TLB0_1M
  916. /* Word 1 */
  917. lis r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW@h
  918. ori r4,r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH
  919. /* Word 2 */
  920. li r5,(PPC47x_TLB2_S_RW | PPC47x_TLB2_IMG)
  921. /* Bolted in way 0, bolt slot 5, we -hope- we don't hit the same
  922. * congruence class as the kernel, we need to make sure of it at
  923. * some point
  924. */
  925. lis r0,0x8d00
  926. tlbwe r3,r0,0
  927. tlbwe r4,r0,1
  928. tlbwe r5,r0,2
  929. /* Force context change */
  930. isync
  931. #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
  932. /* Establish the interrupt vector offsets */
  933. SET_IVOR(0, CriticalInput);
  934. SET_IVOR(1, MachineCheckA);
  935. SET_IVOR(2, DataStorage);
  936. SET_IVOR(3, InstructionStorage);
  937. SET_IVOR(4, ExternalInput);
  938. SET_IVOR(5, Alignment);
  939. SET_IVOR(6, Program);
  940. SET_IVOR(7, FloatingPointUnavailable);
  941. SET_IVOR(8, SystemCall);
  942. SET_IVOR(9, AuxillaryProcessorUnavailable);
  943. SET_IVOR(10, Decrementer);
  944. SET_IVOR(11, FixedIntervalTimer);
  945. SET_IVOR(12, WatchdogTimer);
  946. SET_IVOR(13, DataTLBError47x);
  947. SET_IVOR(14, InstructionTLBError47x);
  948. SET_IVOR(15, DebugCrit);
  949. /* We configure icbi to invalidate 128 bytes at a time since the
  950. * current 32-bit kernel code isn't too happy with icache != dcache
  951. * block size
  952. */
  953. mfspr r3,SPRN_CCR0
  954. oris r3,r3,0x0020
  955. mtspr SPRN_CCR0,r3
  956. isync
  957. #endif /* CONFIG_PPC_47x */
  958. /*
  959. * Here we are back to code that is common between 44x and 47x
  960. *
  961. * We proceed to further kernel initialization and return to the
  962. * main kernel entry
  963. */
  964. head_start_common:
  965. /* Establish the interrupt vector base */
  966. lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
  967. mtspr SPRN_IVPR,r4
  968. /*
  969. * If the kernel was loaded at a non-zero 256 MB page, we need to
  970. * mask off the most significant 4 bits to get the relative address
  971. * from the start of physical memory
  972. */
  973. rlwinm r22,r22,0,4,31
  974. addis r22,r22,PAGE_OFFSET@h
  975. mtlr r22
  976. isync
  977. blr
  978. /*
  979. * We put a few things here that have to be page-aligned. This stuff
  980. * goes at the beginning of the data segment, which is page-aligned.
  981. */
  982. .data
  983. .align PAGE_SHIFT
  984. .globl sdata
  985. sdata:
  986. .globl empty_zero_page
  987. empty_zero_page:
  988. .space PAGE_SIZE
  989. /*
  990. * To support >32-bit physical addresses, we use an 8KB pgdir.
  991. */
  992. .globl swapper_pg_dir
  993. swapper_pg_dir:
  994. .space PGD_TABLE_SIZE
  995. /*
  996. * Room for two PTE pointers, usually the kernel and current user pointers
  997. * to their respective root page table.
  998. */
  999. abatron_pteptrs:
  1000. .space 8
  1001. #ifdef CONFIG_SMP
  1002. .align 12
  1003. temp_boot_stack:
  1004. .space 1024
  1005. #endif /* CONFIG_SMP */