head_fsl_booke.S 28 KB

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