head_fsl_booke.S 28 KB

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