head_fsl_booke.S 29 KB

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