head_fsl_booke.S 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  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-2004 MontaVista Software, Inc.
  23. * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
  24. * Copyright 2004 Freescale Semiconductor, Inc
  25. * PowerPC e500 modifications, Kumar Gala <galak@kernel.crashing.org>
  26. *
  27. * This program is free software; you can redistribute it and/or modify it
  28. * under the terms of the GNU General Public License as published by the
  29. * Free Software Foundation; either version 2 of the License, or (at your
  30. * option) any later version.
  31. */
  32. #include <linux/threads.h>
  33. #include <asm/processor.h>
  34. #include <asm/page.h>
  35. #include <asm/mmu.h>
  36. #include <asm/pgtable.h>
  37. #include <asm/cputable.h>
  38. #include <asm/thread_info.h>
  39. #include <asm/ppc_asm.h>
  40. #include <asm/asm-offsets.h>
  41. #include <asm/cache.h>
  42. #include "head_booke.h"
  43. /* As with the other PowerPC ports, it is expected that when code
  44. * execution begins here, the following registers contain valid, yet
  45. * optional, information:
  46. *
  47. * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
  48. * r4 - Starting address of the init RAM disk
  49. * r5 - Ending address of the init RAM disk
  50. * r6 - Start of kernel command line string (e.g. "mem=128")
  51. * r7 - End of kernel command line string
  52. *
  53. */
  54. .section .text.head, "ax"
  55. _ENTRY(_stext);
  56. _ENTRY(_start);
  57. /*
  58. * Reserve a word at a fixed location to store the address
  59. * of abatron_pteptrs
  60. */
  61. nop
  62. /*
  63. * Save parameters we are passed
  64. */
  65. mr r31,r3
  66. mr r30,r4
  67. mr r29,r5
  68. mr r28,r6
  69. mr r27,r7
  70. li r25,0 /* phys kernel start (low) */
  71. li r24,0 /* CPU number */
  72. li r23,0 /* phys kernel start (high) */
  73. /* We try to not make any assumptions about how the boot loader
  74. * setup or used the TLBs. We invalidate all mappings from the
  75. * boot loader and load a single entry in TLB1[0] to map the
  76. * first 64M of kernel memory. Any boot info passed from the
  77. * bootloader needs to live in this first 64M.
  78. *
  79. * Requirement on bootloader:
  80. * - The page we're executing in needs to reside in TLB1 and
  81. * have IPROT=1. If not an invalidate broadcast could
  82. * evict the entry we're currently executing in.
  83. *
  84. * r3 = Index of TLB1 were executing in
  85. * r4 = Current MSR[IS]
  86. * r5 = Index of TLB1 temp mapping
  87. *
  88. * Later in mapin_ram we will correctly map lowmem, and resize TLB1[0]
  89. * if needed
  90. */
  91. _ENTRY(__early_start)
  92. /* 1. Find the index of the entry we're executing in */
  93. bl invstr /* Find our address */
  94. invstr: mflr r6 /* Make it accessible */
  95. mfmsr r7
  96. rlwinm r4,r7,27,31,31 /* extract MSR[IS] */
  97. mfspr r7, SPRN_PID0
  98. slwi r7,r7,16
  99. or r7,r7,r4
  100. mtspr SPRN_MAS6,r7
  101. tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */
  102. mfspr r7,SPRN_MAS1
  103. andis. r7,r7,MAS1_VALID@h
  104. bne match_TLB
  105. mfspr r7,SPRN_MMUCFG
  106. rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */
  107. cmpwi r7,3
  108. bne match_TLB /* skip if NPIDS != 3 */
  109. mfspr r7,SPRN_PID1
  110. slwi r7,r7,16
  111. or r7,r7,r4
  112. mtspr SPRN_MAS6,r7
  113. tlbsx 0,r6 /* search MSR[IS], SPID=PID1 */
  114. mfspr r7,SPRN_MAS1
  115. andis. r7,r7,MAS1_VALID@h
  116. bne match_TLB
  117. mfspr r7, SPRN_PID2
  118. slwi r7,r7,16
  119. or r7,r7,r4
  120. mtspr SPRN_MAS6,r7
  121. tlbsx 0,r6 /* Fall through, we had to match */
  122. match_TLB:
  123. mfspr r7,SPRN_MAS0
  124. rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */
  125. mfspr r7,SPRN_MAS1 /* Insure IPROT set */
  126. oris r7,r7,MAS1_IPROT@h
  127. mtspr SPRN_MAS1,r7
  128. tlbwe
  129. /* 2. Invalidate all entries except the entry we're executing in */
  130. mfspr r9,SPRN_TLB1CFG
  131. andi. r9,r9,0xfff
  132. li r6,0 /* Set Entry counter to 0 */
  133. 1: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
  134. rlwimi r7,r6,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */
  135. mtspr SPRN_MAS0,r7
  136. tlbre
  137. mfspr r7,SPRN_MAS1
  138. rlwinm r7,r7,0,2,31 /* Clear MAS1 Valid and IPROT */
  139. cmpw r3,r6
  140. beq skpinv /* Dont update the current execution TLB */
  141. mtspr SPRN_MAS1,r7
  142. tlbwe
  143. isync
  144. skpinv: addi r6,r6,1 /* Increment */
  145. cmpw r6,r9 /* Are we done? */
  146. bne 1b /* If not, repeat */
  147. /* Invalidate TLB0 */
  148. li r6,0x04
  149. tlbivax 0,r6
  150. TLBSYNC
  151. /* Invalidate TLB1 */
  152. li r6,0x0c
  153. tlbivax 0,r6
  154. TLBSYNC
  155. /* 3. Setup a temp mapping and jump to it */
  156. andi. r5, r3, 0x1 /* Find an entry not used and is non-zero */
  157. addi r5, r5, 0x1
  158. lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
  159. rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
  160. mtspr SPRN_MAS0,r7
  161. tlbre
  162. /* grab and fixup the RPN */
  163. mfspr r6,SPRN_MAS1 /* extract MAS1[SIZE] */
  164. rlwinm r6,r6,25,27,31
  165. li r8,-1
  166. addi r6,r6,10
  167. slw r6,r8,r6 /* convert to mask */
  168. bl 1f /* Find our address */
  169. 1: mflr r7
  170. mfspr r8,SPRN_MAS3
  171. #ifdef CONFIG_PHYS_64BIT
  172. mfspr r23,SPRN_MAS7
  173. #endif
  174. and r8,r6,r8
  175. subfic r9,r6,-4096
  176. and r9,r9,r7
  177. or r25,r8,r9
  178. ori r8,r25,(MAS3_SX|MAS3_SW|MAS3_SR)
  179. /* Just modify the entry ID and EPN for the temp mapping */
  180. lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
  181. rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */
  182. mtspr SPRN_MAS0,r7
  183. xori r6,r4,1 /* Setup TMP mapping in the other Address space */
  184. slwi r6,r6,12
  185. oris r6,r6,(MAS1_VALID|MAS1_IPROT)@h
  186. ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_4K))@l
  187. mtspr SPRN_MAS1,r6
  188. mfspr r6,SPRN_MAS2
  189. li r7,0 /* temp EPN = 0 */
  190. rlwimi r7,r6,0,20,31
  191. mtspr SPRN_MAS2,r7
  192. mtspr SPRN_MAS3,r8
  193. tlbwe
  194. xori r6,r4,1
  195. slwi r6,r6,5 /* setup new context with other address space */
  196. bl 1f /* Find our address */
  197. 1: mflr r9
  198. rlwimi r7,r9,0,20,31
  199. addi r7,r7,24
  200. mtspr SPRN_SRR0,r7
  201. mtspr SPRN_SRR1,r6
  202. rfi
  203. /* 4. Clear out PIDs & Search info */
  204. li r6,0
  205. mtspr SPRN_MAS6,r6
  206. mtspr SPRN_PID0,r6
  207. mfspr r7,SPRN_MMUCFG
  208. rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */
  209. cmpwi r7,3
  210. bne 2f /* skip if NPIDS != 3 */
  211. mtspr SPRN_PID1,r6
  212. mtspr SPRN_PID2,r6
  213. /* 5. Invalidate mapping we started in */
  214. 2:
  215. lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
  216. rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
  217. mtspr SPRN_MAS0,r7
  218. tlbre
  219. mfspr r6,SPRN_MAS1
  220. rlwinm r6,r6,0,2,0 /* clear IPROT */
  221. mtspr SPRN_MAS1,r6
  222. tlbwe
  223. /* Invalidate TLB1 */
  224. li r9,0x0c
  225. tlbivax 0,r9
  226. TLBSYNC
  227. /* The mapping only needs to be cache-coherent on SMP */
  228. #ifdef CONFIG_SMP
  229. #define M_IF_SMP MAS2_M
  230. #else
  231. #define M_IF_SMP 0
  232. #endif
  233. /* 6. Setup KERNELBASE mapping in TLB1[0] */
  234. lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */
  235. mtspr SPRN_MAS0,r6
  236. lis r6,(MAS1_VALID|MAS1_IPROT)@h
  237. ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_64M))@l
  238. mtspr SPRN_MAS1,r6
  239. lis r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@h
  240. ori r6,r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@l
  241. mtspr SPRN_MAS2,r6
  242. mtspr SPRN_MAS3,r8
  243. tlbwe
  244. /* 7. Jump to KERNELBASE mapping */
  245. lis r6,(KERNELBASE & ~0xfff)@h
  246. ori r6,r6,(KERNELBASE & ~0xfff)@l
  247. lis r7,MSR_KERNEL@h
  248. ori r7,r7,MSR_KERNEL@l
  249. bl 1f /* Find our address */
  250. 1: mflr r9
  251. rlwimi r6,r9,0,20,31
  252. addi r6,r6,(2f - 1b)
  253. mtspr SPRN_SRR0,r6
  254. mtspr SPRN_SRR1,r7
  255. rfi /* start execution out of TLB1[0] entry */
  256. /* 8. Clear out the temp mapping */
  257. 2: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
  258. rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */
  259. mtspr SPRN_MAS0,r7
  260. tlbre
  261. mfspr r8,SPRN_MAS1
  262. rlwinm r8,r8,0,2,0 /* clear IPROT */
  263. mtspr SPRN_MAS1,r8
  264. tlbwe
  265. /* Invalidate TLB1 */
  266. li r9,0x0c
  267. tlbivax 0,r9
  268. TLBSYNC
  269. /* Establish the interrupt vector offsets */
  270. SET_IVOR(0, CriticalInput);
  271. SET_IVOR(1, MachineCheck);
  272. SET_IVOR(2, DataStorage);
  273. SET_IVOR(3, InstructionStorage);
  274. SET_IVOR(4, ExternalInput);
  275. SET_IVOR(5, Alignment);
  276. SET_IVOR(6, Program);
  277. SET_IVOR(7, FloatingPointUnavailable);
  278. SET_IVOR(8, SystemCall);
  279. SET_IVOR(9, AuxillaryProcessorUnavailable);
  280. SET_IVOR(10, Decrementer);
  281. SET_IVOR(11, FixedIntervalTimer);
  282. SET_IVOR(12, WatchdogTimer);
  283. SET_IVOR(13, DataTLBError);
  284. SET_IVOR(14, InstructionTLBError);
  285. SET_IVOR(15, DebugCrit);
  286. /* Establish the interrupt vector base */
  287. lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
  288. mtspr SPRN_IVPR,r4
  289. /* Setup the defaults for TLB entries */
  290. li r2,(MAS4_TSIZED(BOOK3E_PAGESZ_4K))@l
  291. #ifdef CONFIG_E200
  292. oris r2,r2,MAS4_TLBSELD(1)@h
  293. #endif
  294. mtspr SPRN_MAS4, r2
  295. #if 0
  296. /* Enable DOZE */
  297. mfspr r2,SPRN_HID0
  298. oris r2,r2,HID0_DOZE@h
  299. mtspr SPRN_HID0, r2
  300. #endif
  301. #if !defined(CONFIG_BDI_SWITCH)
  302. /*
  303. * The Abatron BDI JTAG debugger does not tolerate others
  304. * mucking with the debug registers.
  305. */
  306. lis r2,DBCR0_IDM@h
  307. mtspr SPRN_DBCR0,r2
  308. isync
  309. /* clear any residual debug events */
  310. li r2,-1
  311. mtspr SPRN_DBSR,r2
  312. #endif
  313. #ifdef CONFIG_SMP
  314. /* Check to see if we're the second processor, and jump
  315. * to the secondary_start code if so
  316. */
  317. mfspr r24,SPRN_PIR
  318. cmpwi r24,0
  319. bne __secondary_start
  320. #endif
  321. /*
  322. * This is where the main kernel code starts.
  323. */
  324. /* ptr to current */
  325. lis r2,init_task@h
  326. ori r2,r2,init_task@l
  327. /* ptr to current thread */
  328. addi r4,r2,THREAD /* init task's THREAD */
  329. mtspr SPRN_SPRG3,r4
  330. /* stack */
  331. lis r1,init_thread_union@h
  332. ori r1,r1,init_thread_union@l
  333. li r0,0
  334. stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
  335. bl early_init
  336. #ifdef CONFIG_RELOCATABLE
  337. lis r3,kernstart_addr@ha
  338. la r3,kernstart_addr@l(r3)
  339. #ifdef CONFIG_PHYS_64BIT
  340. stw r23,0(r3)
  341. stw r25,4(r3)
  342. #else
  343. stw r25,0(r3)
  344. #endif
  345. #endif
  346. /*
  347. * Decide what sort of machine this is and initialize the MMU.
  348. */
  349. mr r3,r31
  350. mr r4,r30
  351. mr r5,r29
  352. mr r6,r28
  353. mr r7,r27
  354. bl machine_init
  355. bl MMU_init
  356. /* Setup PTE pointers for the Abatron bdiGDB */
  357. lis r6, swapper_pg_dir@h
  358. ori r6, r6, swapper_pg_dir@l
  359. lis r5, abatron_pteptrs@h
  360. ori r5, r5, abatron_pteptrs@l
  361. lis r4, KERNELBASE@h
  362. ori r4, r4, KERNELBASE@l
  363. stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
  364. stw r6, 0(r5)
  365. /* Let's move on */
  366. lis r4,start_kernel@h
  367. ori r4,r4,start_kernel@l
  368. lis r3,MSR_KERNEL@h
  369. ori r3,r3,MSR_KERNEL@l
  370. mtspr SPRN_SRR0,r4
  371. mtspr SPRN_SRR1,r3
  372. rfi /* change context and jump to start_kernel */
  373. /* Macros to hide the PTE size differences
  374. *
  375. * FIND_PTE -- walks the page tables given EA & pgdir pointer
  376. * r10 -- EA of fault
  377. * r11 -- PGDIR pointer
  378. * r12 -- free
  379. * label 2: is the bailout case
  380. *
  381. * if we find the pte (fall through):
  382. * r11 is low pte word
  383. * r12 is pointer to the pte
  384. */
  385. #ifdef CONFIG_PTE_64BIT
  386. #define FIND_PTE \
  387. rlwinm r12, r10, 13, 19, 29; /* Compute pgdir/pmd offset */ \
  388. lwzx r11, r12, r11; /* Get pgd/pmd entry */ \
  389. rlwinm. r12, r11, 0, 0, 20; /* Extract pt base address */ \
  390. beq 2f; /* Bail if no table */ \
  391. rlwimi r12, r10, 23, 20, 28; /* Compute pte address */ \
  392. lwz r11, 4(r12); /* Get pte entry */
  393. #else
  394. #define FIND_PTE \
  395. rlwimi r11, r10, 12, 20, 29; /* Create L1 (pgdir/pmd) address */ \
  396. lwz r11, 0(r11); /* Get L1 entry */ \
  397. rlwinm. r12, r11, 0, 0, 19; /* Extract L2 (pte) base address */ \
  398. beq 2f; /* Bail if no table */ \
  399. rlwimi r12, r10, 22, 20, 29; /* Compute PTE address */ \
  400. lwz r11, 0(r12); /* Get Linux PTE */
  401. #endif
  402. /*
  403. * Interrupt vector entry code
  404. *
  405. * The Book E MMUs are always on so we don't need to handle
  406. * interrupts in real mode as with previous PPC processors. In
  407. * this case we handle interrupts in the kernel virtual address
  408. * space.
  409. *
  410. * Interrupt vectors are dynamically placed relative to the
  411. * interrupt prefix as determined by the address of interrupt_base.
  412. * The interrupt vectors offsets are programmed using the labels
  413. * for each interrupt vector entry.
  414. *
  415. * Interrupt vectors must be aligned on a 16 byte boundary.
  416. * We align on a 32 byte cache line boundary for good measure.
  417. */
  418. interrupt_base:
  419. /* Critical Input Interrupt */
  420. CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
  421. /* Machine Check Interrupt */
  422. #ifdef CONFIG_E200
  423. /* no RFMCI, MCSRRs on E200 */
  424. CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
  425. #else
  426. MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
  427. #endif
  428. /* Data Storage Interrupt */
  429. START_EXCEPTION(DataStorage)
  430. NORMAL_EXCEPTION_PROLOG
  431. mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */
  432. stw r5,_ESR(r11)
  433. mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */
  434. andis. r10,r5,(ESR_ILK|ESR_DLK)@h
  435. bne 1f
  436. EXC_XFER_EE_LITE(0x0300, handle_page_fault)
  437. 1:
  438. addi r3,r1,STACK_FRAME_OVERHEAD
  439. EXC_XFER_EE_LITE(0x0300, CacheLockingException)
  440. /* Instruction Storage Interrupt */
  441. INSTRUCTION_STORAGE_EXCEPTION
  442. /* External Input Interrupt */
  443. EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE)
  444. /* Alignment Interrupt */
  445. ALIGNMENT_EXCEPTION
  446. /* Program Interrupt */
  447. PROGRAM_EXCEPTION
  448. /* Floating Point Unavailable Interrupt */
  449. #ifdef CONFIG_PPC_FPU
  450. FP_UNAVAILABLE_EXCEPTION
  451. #else
  452. #ifdef CONFIG_E200
  453. /* E200 treats 'normal' floating point instructions as FP Unavail exception */
  454. EXCEPTION(0x0800, FloatingPointUnavailable, program_check_exception, EXC_XFER_EE)
  455. #else
  456. EXCEPTION(0x0800, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
  457. #endif
  458. #endif
  459. /* System Call Interrupt */
  460. START_EXCEPTION(SystemCall)
  461. NORMAL_EXCEPTION_PROLOG
  462. EXC_XFER_EE_LITE(0x0c00, DoSyscall)
  463. /* Auxillary Processor Unavailable Interrupt */
  464. EXCEPTION(0x2900, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
  465. /* Decrementer Interrupt */
  466. DECREMENTER_EXCEPTION
  467. /* Fixed Internal Timer Interrupt */
  468. /* TODO: Add FIT support */
  469. EXCEPTION(0x3100, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
  470. /* Watchdog Timer Interrupt */
  471. #ifdef CONFIG_BOOKE_WDT
  472. CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException)
  473. #else
  474. CRITICAL_EXCEPTION(0x3200, WatchdogTimer, unknown_exception)
  475. #endif
  476. /* Data TLB Error Interrupt */
  477. START_EXCEPTION(DataTLBError)
  478. mtspr SPRN_SPRG0, r10 /* Save some working registers */
  479. mtspr SPRN_SPRG1, r11
  480. mtspr SPRN_SPRG4W, r12
  481. mtspr SPRN_SPRG5W, r13
  482. mfcr r11
  483. mtspr SPRN_SPRG7W, r11
  484. mfspr r10, SPRN_DEAR /* Get faulting address */
  485. /* If we are faulting a kernel address, we have to use the
  486. * kernel page tables.
  487. */
  488. lis r11, PAGE_OFFSET@h
  489. cmplw 5, r10, r11
  490. blt 5, 3f
  491. lis r11, swapper_pg_dir@h
  492. ori r11, r11, swapper_pg_dir@l
  493. mfspr r12,SPRN_MAS1 /* Set TID to 0 */
  494. rlwinm r12,r12,0,16,1
  495. mtspr SPRN_MAS1,r12
  496. b 4f
  497. /* Get the PGD for the current thread */
  498. 3:
  499. mfspr r11,SPRN_SPRG3
  500. lwz r11,PGDIR(r11)
  501. 4:
  502. /* Mask of required permission bits. Note that while we
  503. * do copy ESR:ST to _PAGE_RW position as trying to write
  504. * to an RO page is pretty common, we don't do it with
  505. * _PAGE_DIRTY. We could do it, but it's a fairly rare
  506. * event so I'd rather take the overhead when it happens
  507. * rather than adding an instruction here. We should measure
  508. * whether the whole thing is worth it in the first place
  509. * as we could avoid loading SPRN_ESR completely in the first
  510. * place...
  511. *
  512. * TODO: Is it worth doing that mfspr & rlwimi in the first
  513. * place or can we save a couple of instructions here ?
  514. */
  515. mfspr r12,SPRN_ESR
  516. li r13,_PAGE_PRESENT|_PAGE_ACCESSED
  517. rlwimi r13,r12,11,29,29
  518. FIND_PTE
  519. andc. r13,r13,r11 /* Check permission */
  520. #ifdef CONFIG_PTE_64BIT
  521. #ifdef CONFIG_SMP
  522. subf r10,r11,r12 /* create false data dep */
  523. lwzx r13,r11,r10 /* Get upper pte bits */
  524. #else
  525. lwz r13,0(r12) /* Get upper pte bits */
  526. #endif
  527. #endif
  528. bne 2f /* Bail if permission/valid mismach */
  529. /* Jump to common tlb load */
  530. b finish_tlb_load
  531. 2:
  532. /* The bailout. Restore registers to pre-exception conditions
  533. * and call the heavyweights to help us out.
  534. */
  535. mfspr r11, SPRN_SPRG7R
  536. mtcr r11
  537. mfspr r13, SPRN_SPRG5R
  538. mfspr r12, SPRN_SPRG4R
  539. mfspr r11, SPRN_SPRG1
  540. mfspr r10, SPRN_SPRG0
  541. b DataStorage
  542. /* Instruction TLB Error Interrupt */
  543. /*
  544. * Nearly the same as above, except we get our
  545. * information from different registers and bailout
  546. * to a different point.
  547. */
  548. START_EXCEPTION(InstructionTLBError)
  549. mtspr SPRN_SPRG0, r10 /* Save some working registers */
  550. mtspr SPRN_SPRG1, r11
  551. mtspr SPRN_SPRG4W, r12
  552. mtspr SPRN_SPRG5W, r13
  553. mfcr r11
  554. mtspr SPRN_SPRG7W, r11
  555. mfspr r10, SPRN_SRR0 /* Get faulting address */
  556. /* If we are faulting a kernel address, we have to use the
  557. * kernel page tables.
  558. */
  559. lis r11, PAGE_OFFSET@h
  560. cmplw 5, r10, r11
  561. blt 5, 3f
  562. lis r11, swapper_pg_dir@h
  563. ori r11, r11, swapper_pg_dir@l
  564. mfspr r12,SPRN_MAS1 /* Set TID to 0 */
  565. rlwinm r12,r12,0,16,1
  566. mtspr SPRN_MAS1,r12
  567. b 4f
  568. /* Get the PGD for the current thread */
  569. 3:
  570. mfspr r11,SPRN_SPRG3
  571. lwz r11,PGDIR(r11)
  572. 4:
  573. /* Make up the required permissions */
  574. li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_HWEXEC
  575. FIND_PTE
  576. andc. r13,r13,r11 /* Check permission */
  577. #ifdef CONFIG_PTE_64BIT
  578. #ifdef CONFIG_SMP
  579. subf r10,r11,r12 /* create false data dep */
  580. lwzx r13,r11,r10 /* Get upper pte bits */
  581. #else
  582. lwz r13,0(r12) /* Get upper pte bits */
  583. #endif
  584. #endif
  585. bne 2f /* Bail if permission mismach */
  586. /* Jump to common TLB load point */
  587. b finish_tlb_load
  588. 2:
  589. /* The bailout. Restore registers to pre-exception conditions
  590. * and call the heavyweights to help us out.
  591. */
  592. mfspr r11, SPRN_SPRG7R
  593. mtcr r11
  594. mfspr r13, SPRN_SPRG5R
  595. mfspr r12, SPRN_SPRG4R
  596. mfspr r11, SPRN_SPRG1
  597. mfspr r10, SPRN_SPRG0
  598. b InstructionStorage
  599. #ifdef CONFIG_SPE
  600. /* SPE Unavailable */
  601. START_EXCEPTION(SPEUnavailable)
  602. NORMAL_EXCEPTION_PROLOG
  603. bne load_up_spe
  604. addi r3,r1,STACK_FRAME_OVERHEAD
  605. EXC_XFER_EE_LITE(0x2010, KernelSPE)
  606. #else
  607. EXCEPTION(0x2020, SPEUnavailable, unknown_exception, EXC_XFER_EE)
  608. #endif /* CONFIG_SPE */
  609. /* SPE Floating Point Data */
  610. #ifdef CONFIG_SPE
  611. EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE);
  612. /* SPE Floating Point Round */
  613. EXCEPTION(0x2050, SPEFloatingPointRound, SPEFloatingPointRoundException, EXC_XFER_EE)
  614. #else
  615. EXCEPTION(0x2040, SPEFloatingPointData, unknown_exception, EXC_XFER_EE)
  616. EXCEPTION(0x2050, SPEFloatingPointRound, unknown_exception, EXC_XFER_EE)
  617. #endif /* CONFIG_SPE */
  618. /* Performance Monitor */
  619. EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
  620. EXCEPTION(0x2070, Doorbell, doorbell_exception, EXC_XFER_STD)
  621. CRITICAL_EXCEPTION(0x2080, CriticalDoorbell, unknown_exception)
  622. /* Debug Interrupt */
  623. DEBUG_DEBUG_EXCEPTION
  624. DEBUG_CRIT_EXCEPTION
  625. /*
  626. * Local functions
  627. */
  628. /*
  629. * Both the instruction and data TLB miss get to this
  630. * point to load the TLB.
  631. * r10 - available to use
  632. * r11 - TLB (info from Linux PTE)
  633. * r12 - available to use
  634. * r13 - upper bits of PTE (if PTE_64BIT) or available to use
  635. * CR5 - results of addr >= PAGE_OFFSET
  636. * MAS0, MAS1 - loaded with proper value when we get here
  637. * MAS2, MAS3 - will need additional info from Linux PTE
  638. * Upon exit, we reload everything and RFI.
  639. */
  640. finish_tlb_load:
  641. /*
  642. * We set execute, because we don't have the granularity to
  643. * properly set this at the page level (Linux problem).
  644. * Many of these bits are software only. Bits we don't set
  645. * here we (properly should) assume have the appropriate value.
  646. */
  647. mfspr r12, SPRN_MAS2
  648. #ifdef CONFIG_PTE_64BIT
  649. rlwimi r12, r11, 26, 24, 31 /* extract ...WIMGE from pte */
  650. #else
  651. rlwimi r12, r11, 26, 27, 31 /* extract WIMGE from pte */
  652. #endif
  653. #ifdef CONFIG_SMP
  654. ori r12, r12, MAS2_M
  655. #endif
  656. mtspr SPRN_MAS2, r12
  657. li r10, (_PAGE_HWEXEC | _PAGE_PRESENT)
  658. rlwimi r10, r11, 31, 29, 29 /* extract _PAGE_DIRTY into SW */
  659. and r12, r11, r10
  660. andi. r10, r11, _PAGE_USER /* Test for _PAGE_USER */
  661. slwi r10, r12, 1
  662. or r10, r10, r12
  663. iseleq r12, r12, r10
  664. #ifdef CONFIG_PTE_64BIT
  665. rlwimi r12, r13, 24, 0, 7 /* grab RPN[32:39] */
  666. rlwimi r12, r11, 24, 8, 19 /* grab RPN[40:51] */
  667. mtspr SPRN_MAS3, r12
  668. BEGIN_MMU_FTR_SECTION
  669. srwi r10, r13, 8 /* grab RPN[8:31] */
  670. mtspr SPRN_MAS7, r10
  671. END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
  672. #else
  673. rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */
  674. mtspr SPRN_MAS3, r11
  675. #endif
  676. #ifdef CONFIG_E200
  677. /* Round robin TLB1 entries assignment */
  678. mfspr r12, SPRN_MAS0
  679. /* Extract TLB1CFG(NENTRY) */
  680. mfspr r11, SPRN_TLB1CFG
  681. andi. r11, r11, 0xfff
  682. /* Extract MAS0(NV) */
  683. andi. r13, r12, 0xfff
  684. addi r13, r13, 1
  685. cmpw 0, r13, r11
  686. addi r12, r12, 1
  687. /* check if we need to wrap */
  688. blt 7f
  689. /* wrap back to first free tlbcam entry */
  690. lis r13, tlbcam_index@ha
  691. lwz r13, tlbcam_index@l(r13)
  692. rlwimi r12, r13, 0, 20, 31
  693. 7:
  694. mtspr SPRN_MAS0,r12
  695. #endif /* CONFIG_E200 */
  696. tlbwe
  697. /* Done...restore registers and get out of here. */
  698. mfspr r11, SPRN_SPRG7R
  699. mtcr r11
  700. mfspr r13, SPRN_SPRG5R
  701. mfspr r12, SPRN_SPRG4R
  702. mfspr r11, SPRN_SPRG1
  703. mfspr r10, SPRN_SPRG0
  704. rfi /* Force context change */
  705. #ifdef CONFIG_SPE
  706. /* Note that the SPE support is closely modeled after the AltiVec
  707. * support. Changes to one are likely to be applicable to the
  708. * other! */
  709. load_up_spe:
  710. /*
  711. * Disable SPE for the task which had SPE previously,
  712. * and save its SPE registers in its thread_struct.
  713. * Enables SPE for use in the kernel on return.
  714. * On SMP we know the SPE units are free, since we give it up every
  715. * switch. -- Kumar
  716. */
  717. mfmsr r5
  718. oris r5,r5,MSR_SPE@h
  719. mtmsr r5 /* enable use of SPE now */
  720. isync
  721. /*
  722. * For SMP, we don't do lazy SPE switching because it just gets too
  723. * horrendously complex, especially when a task switches from one CPU
  724. * to another. Instead we call giveup_spe in switch_to.
  725. */
  726. #ifndef CONFIG_SMP
  727. lis r3,last_task_used_spe@ha
  728. lwz r4,last_task_used_spe@l(r3)
  729. cmpi 0,r4,0
  730. beq 1f
  731. addi r4,r4,THREAD /* want THREAD of last_task_used_spe */
  732. SAVE_32EVRS(0,r10,r4)
  733. evxor evr10, evr10, evr10 /* clear out evr10 */
  734. evmwumiaa evr10, evr10, evr10 /* evr10 <- ACC = 0 * 0 + ACC */
  735. li r5,THREAD_ACC
  736. evstddx evr10, r4, r5 /* save off accumulator */
  737. lwz r5,PT_REGS(r4)
  738. lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  739. lis r10,MSR_SPE@h
  740. andc r4,r4,r10 /* disable SPE for previous task */
  741. stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  742. 1:
  743. #endif /* !CONFIG_SMP */
  744. /* enable use of SPE after return */
  745. oris r9,r9,MSR_SPE@h
  746. mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
  747. li r4,1
  748. li r10,THREAD_ACC
  749. stw r4,THREAD_USED_SPE(r5)
  750. evlddx evr4,r10,r5
  751. evmra evr4,evr4
  752. REST_32EVRS(0,r10,r5)
  753. #ifndef CONFIG_SMP
  754. subi r4,r5,THREAD
  755. stw r4,last_task_used_spe@l(r3)
  756. #endif /* !CONFIG_SMP */
  757. /* restore registers and return */
  758. 2: REST_4GPRS(3, r11)
  759. lwz r10,_CCR(r11)
  760. REST_GPR(1, r11)
  761. mtcr r10
  762. lwz r10,_LINK(r11)
  763. mtlr r10
  764. REST_GPR(10, r11)
  765. mtspr SPRN_SRR1,r9
  766. mtspr SPRN_SRR0,r12
  767. REST_GPR(9, r11)
  768. REST_GPR(12, r11)
  769. lwz r11,GPR11(r11)
  770. rfi
  771. /*
  772. * SPE unavailable trap from kernel - print a message, but let
  773. * the task use SPE in the kernel until it returns to user mode.
  774. */
  775. KernelSPE:
  776. lwz r3,_MSR(r1)
  777. oris r3,r3,MSR_SPE@h
  778. stw r3,_MSR(r1) /* enable use of SPE after return */
  779. lis r3,87f@h
  780. ori r3,r3,87f@l
  781. mr r4,r2 /* current */
  782. lwz r5,_NIP(r1)
  783. bl printk
  784. b ret_from_except
  785. 87: .string "SPE used in kernel (task=%p, pc=%x) \n"
  786. .align 4,0
  787. #endif /* CONFIG_SPE */
  788. /*
  789. * Global functions
  790. */
  791. /* Adjust or setup IVORs for e200 */
  792. _GLOBAL(__setup_e200_ivors)
  793. li r3,DebugDebug@l
  794. mtspr SPRN_IVOR15,r3
  795. li r3,SPEUnavailable@l
  796. mtspr SPRN_IVOR32,r3
  797. li r3,SPEFloatingPointData@l
  798. mtspr SPRN_IVOR33,r3
  799. li r3,SPEFloatingPointRound@l
  800. mtspr SPRN_IVOR34,r3
  801. sync
  802. blr
  803. /* Adjust or setup IVORs for e500v1/v2 */
  804. _GLOBAL(__setup_e500_ivors)
  805. li r3,DebugCrit@l
  806. mtspr SPRN_IVOR15,r3
  807. li r3,SPEUnavailable@l
  808. mtspr SPRN_IVOR32,r3
  809. li r3,SPEFloatingPointData@l
  810. mtspr SPRN_IVOR33,r3
  811. li r3,SPEFloatingPointRound@l
  812. mtspr SPRN_IVOR34,r3
  813. li r3,PerformanceMonitor@l
  814. mtspr SPRN_IVOR35,r3
  815. sync
  816. blr
  817. /* Adjust or setup IVORs for e500mc */
  818. _GLOBAL(__setup_e500mc_ivors)
  819. li r3,DebugDebug@l
  820. mtspr SPRN_IVOR15,r3
  821. li r3,PerformanceMonitor@l
  822. mtspr SPRN_IVOR35,r3
  823. li r3,Doorbell@l
  824. mtspr SPRN_IVOR36,r3
  825. li r3,CriticalDoorbell@l
  826. mtspr SPRN_IVOR37,r3
  827. sync
  828. blr
  829. /*
  830. * extern void loadcam_entry(unsigned int index)
  831. *
  832. * Load TLBCAM[index] entry in to the L2 CAM MMU
  833. */
  834. _GLOBAL(loadcam_entry)
  835. lis r4,TLBCAM@ha
  836. addi r4,r4,TLBCAM@l
  837. mulli r5,r3,TLBCAM_SIZE
  838. add r3,r5,r4
  839. lwz r4,0(r3)
  840. mtspr SPRN_MAS0,r4
  841. lwz r4,4(r3)
  842. mtspr SPRN_MAS1,r4
  843. lwz r4,8(r3)
  844. mtspr SPRN_MAS2,r4
  845. lwz r4,12(r3)
  846. mtspr SPRN_MAS3,r4
  847. tlbwe
  848. isync
  849. blr
  850. /*
  851. * extern void giveup_altivec(struct task_struct *prev)
  852. *
  853. * The e500 core does not have an AltiVec unit.
  854. */
  855. _GLOBAL(giveup_altivec)
  856. blr
  857. #ifdef CONFIG_SPE
  858. /*
  859. * extern void giveup_spe(struct task_struct *prev)
  860. *
  861. */
  862. _GLOBAL(giveup_spe)
  863. mfmsr r5
  864. oris r5,r5,MSR_SPE@h
  865. mtmsr r5 /* enable use of SPE now */
  866. isync
  867. cmpi 0,r3,0
  868. beqlr- /* if no previous owner, done */
  869. addi r3,r3,THREAD /* want THREAD of task */
  870. lwz r5,PT_REGS(r3)
  871. cmpi 0,r5,0
  872. SAVE_32EVRS(0, r4, r3)
  873. evxor evr6, evr6, evr6 /* clear out evr6 */
  874. evmwumiaa evr6, evr6, evr6 /* evr6 <- ACC = 0 * 0 + ACC */
  875. li r4,THREAD_ACC
  876. evstddx evr6, r4, r3 /* save off accumulator */
  877. mfspr r6,SPRN_SPEFSCR
  878. stw r6,THREAD_SPEFSCR(r3) /* save spefscr register value */
  879. beq 1f
  880. lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  881. lis r3,MSR_SPE@h
  882. andc r4,r4,r3 /* disable SPE for previous task */
  883. stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  884. 1:
  885. #ifndef CONFIG_SMP
  886. li r5,0
  887. lis r4,last_task_used_spe@ha
  888. stw r5,last_task_used_spe@l(r4)
  889. #endif /* !CONFIG_SMP */
  890. blr
  891. #endif /* CONFIG_SPE */
  892. /*
  893. * extern void giveup_fpu(struct task_struct *prev)
  894. *
  895. * Not all FSL Book-E cores have an FPU
  896. */
  897. #ifndef CONFIG_PPC_FPU
  898. _GLOBAL(giveup_fpu)
  899. blr
  900. #endif
  901. /*
  902. * extern void abort(void)
  903. *
  904. * At present, this routine just applies a system reset.
  905. */
  906. _GLOBAL(abort)
  907. li r13,0
  908. mtspr SPRN_DBCR0,r13 /* disable all debug events */
  909. isync
  910. mfmsr r13
  911. ori r13,r13,MSR_DE@l /* Enable Debug Events */
  912. mtmsr r13
  913. isync
  914. mfspr r13,SPRN_DBCR0
  915. lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h
  916. mtspr SPRN_DBCR0,r13
  917. isync
  918. _GLOBAL(set_context)
  919. #ifdef CONFIG_BDI_SWITCH
  920. /* Context switch the PTE pointer for the Abatron BDI2000.
  921. * The PGDIR is the second parameter.
  922. */
  923. lis r5, abatron_pteptrs@h
  924. ori r5, r5, abatron_pteptrs@l
  925. stw r4, 0x4(r5)
  926. #endif
  927. mtspr SPRN_PID,r3
  928. isync /* Force context change */
  929. blr
  930. _GLOBAL(flush_dcache_L1)
  931. mfspr r3,SPRN_L1CFG0
  932. rlwinm r5,r3,9,3 /* Extract cache block size */
  933. twlgti r5,1 /* Only 32 and 64 byte cache blocks
  934. * are currently defined.
  935. */
  936. li r4,32
  937. subfic r6,r5,2 /* r6 = log2(1KiB / cache block size) -
  938. * log2(number of ways)
  939. */
  940. slw r5,r4,r5 /* r5 = cache block size */
  941. rlwinm r7,r3,0,0xff /* Extract number of KiB in the cache */
  942. mulli r7,r7,13 /* An 8-way cache will require 13
  943. * loads per set.
  944. */
  945. slw r7,r7,r6
  946. /* save off HID0 and set DCFA */
  947. mfspr r8,SPRN_HID0
  948. ori r9,r8,HID0_DCFA@l
  949. mtspr SPRN_HID0,r9
  950. isync
  951. lis r4,KERNELBASE@h
  952. mtctr r7
  953. 1: lwz r3,0(r4) /* Load... */
  954. add r4,r4,r5
  955. bdnz 1b
  956. msync
  957. lis r4,KERNELBASE@h
  958. mtctr r7
  959. 1: dcbf 0,r4 /* ...and flush. */
  960. add r4,r4,r5
  961. bdnz 1b
  962. /* restore HID0 */
  963. mtspr SPRN_HID0,r8
  964. isync
  965. blr
  966. #ifdef CONFIG_SMP
  967. /* When we get here, r24 needs to hold the CPU # */
  968. .globl __secondary_start
  969. __secondary_start:
  970. lis r3,__secondary_hold_acknowledge@h
  971. ori r3,r3,__secondary_hold_acknowledge@l
  972. stw r24,0(r3)
  973. li r3,0
  974. mr r4,r24 /* Why? */
  975. bl call_setup_cpu
  976. lis r3,tlbcam_index@ha
  977. lwz r3,tlbcam_index@l(r3)
  978. mtctr r3
  979. li r26,0 /* r26 safe? */
  980. /* Load each CAM entry */
  981. 1: mr r3,r26
  982. bl loadcam_entry
  983. addi r26,r26,1
  984. bdnz 1b
  985. /* get current_thread_info and current */
  986. lis r1,secondary_ti@ha
  987. lwz r1,secondary_ti@l(r1)
  988. lwz r2,TI_TASK(r1)
  989. /* stack */
  990. addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
  991. li r0,0
  992. stw r0,0(r1)
  993. /* ptr to current thread */
  994. addi r4,r2,THREAD /* address of our thread_struct */
  995. mtspr SPRN_SPRG3,r4
  996. /* Setup the defaults for TLB entries */
  997. li r4,(MAS4_TSIZED(BOOK3E_PAGESZ_4K))@l
  998. mtspr SPRN_MAS4,r4
  999. /* Jump to start_secondary */
  1000. lis r4,MSR_KERNEL@h
  1001. ori r4,r4,MSR_KERNEL@l
  1002. lis r3,start_secondary@h
  1003. ori r3,r3,start_secondary@l
  1004. mtspr SPRN_SRR0,r3
  1005. mtspr SPRN_SRR1,r4
  1006. sync
  1007. rfi
  1008. sync
  1009. .globl __secondary_hold_acknowledge
  1010. __secondary_hold_acknowledge:
  1011. .long -1
  1012. #endif
  1013. /*
  1014. * We put a few things here that have to be page-aligned. This stuff
  1015. * goes at the beginning of the data segment, which is page-aligned.
  1016. */
  1017. .data
  1018. .align 12
  1019. .globl sdata
  1020. sdata:
  1021. .globl empty_zero_page
  1022. empty_zero_page:
  1023. .space 4096
  1024. .globl swapper_pg_dir
  1025. swapper_pg_dir:
  1026. .space PGD_TABLE_SIZE
  1027. /*
  1028. * Room for two PTE pointers, usually the kernel and current user pointers
  1029. * to their respective root page table.
  1030. */
  1031. abatron_pteptrs:
  1032. .space 8