head.S 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. /*
  2. * Here is where the ball gets rolling as far as the kernel is concerned.
  3. * When control is transferred to _start, the bootload has already
  4. * loaded us to the correct address. All that's left to do here is
  5. * to set up the kernel's global pointer and jump to the kernel
  6. * entry point.
  7. *
  8. * Copyright (C) 1998-2001, 2003, 2005 Hewlett-Packard Co
  9. * David Mosberger-Tang <davidm@hpl.hp.com>
  10. * Stephane Eranian <eranian@hpl.hp.com>
  11. * Copyright (C) 1999 VA Linux Systems
  12. * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  13. * Copyright (C) 1999 Intel Corp.
  14. * Copyright (C) 1999 Asit Mallick <Asit.K.Mallick@intel.com>
  15. * Copyright (C) 1999 Don Dugger <Don.Dugger@intel.com>
  16. * Copyright (C) 2002 Fenghua Yu <fenghua.yu@intel.com>
  17. * -Optimize __ia64_save_fpu() and __ia64_load_fpu() for Itanium 2.
  18. * Copyright (C) 2004 Ashok Raj <ashok.raj@intel.com>
  19. * Support for CPU Hotplug
  20. */
  21. #include <asm/asmmacro.h>
  22. #include <asm/fpu.h>
  23. #include <asm/kregs.h>
  24. #include <asm/mmu_context.h>
  25. #include <asm/asm-offsets.h>
  26. #include <asm/pal.h>
  27. #include <asm/pgtable.h>
  28. #include <asm/processor.h>
  29. #include <asm/ptrace.h>
  30. #include <asm/mca_asm.h>
  31. #include <linux/init.h>
  32. #include <linux/linkage.h>
  33. #ifdef CONFIG_HOTPLUG_CPU
  34. #define SAL_PSR_BITS_TO_SET \
  35. (IA64_PSR_AC | IA64_PSR_BN | IA64_PSR_MFH | IA64_PSR_MFL)
  36. #define SAVE_FROM_REG(src, ptr, dest) \
  37. mov dest=src;; \
  38. st8 [ptr]=dest,0x08
  39. #define RESTORE_REG(reg, ptr, _tmp) \
  40. ld8 _tmp=[ptr],0x08;; \
  41. mov reg=_tmp
  42. #define SAVE_BREAK_REGS(ptr, _idx, _breg, _dest)\
  43. mov ar.lc=IA64_NUM_DBG_REGS-1;; \
  44. mov _idx=0;; \
  45. 1: \
  46. SAVE_FROM_REG(_breg[_idx], ptr, _dest);; \
  47. add _idx=1,_idx;; \
  48. br.cloop.sptk.many 1b
  49. #define RESTORE_BREAK_REGS(ptr, _idx, _breg, _tmp, _lbl)\
  50. mov ar.lc=IA64_NUM_DBG_REGS-1;; \
  51. mov _idx=0;; \
  52. _lbl: RESTORE_REG(_breg[_idx], ptr, _tmp);; \
  53. add _idx=1, _idx;; \
  54. br.cloop.sptk.many _lbl
  55. #define SAVE_ONE_RR(num, _reg, _tmp) \
  56. movl _tmp=(num<<61);; \
  57. mov _reg=rr[_tmp]
  58. #define SAVE_REGION_REGS(_tmp, _r0, _r1, _r2, _r3, _r4, _r5, _r6, _r7) \
  59. SAVE_ONE_RR(0,_r0, _tmp);; \
  60. SAVE_ONE_RR(1,_r1, _tmp);; \
  61. SAVE_ONE_RR(2,_r2, _tmp);; \
  62. SAVE_ONE_RR(3,_r3, _tmp);; \
  63. SAVE_ONE_RR(4,_r4, _tmp);; \
  64. SAVE_ONE_RR(5,_r5, _tmp);; \
  65. SAVE_ONE_RR(6,_r6, _tmp);; \
  66. SAVE_ONE_RR(7,_r7, _tmp);;
  67. #define STORE_REGION_REGS(ptr, _r0, _r1, _r2, _r3, _r4, _r5, _r6, _r7) \
  68. st8 [ptr]=_r0, 8;; \
  69. st8 [ptr]=_r1, 8;; \
  70. st8 [ptr]=_r2, 8;; \
  71. st8 [ptr]=_r3, 8;; \
  72. st8 [ptr]=_r4, 8;; \
  73. st8 [ptr]=_r5, 8;; \
  74. st8 [ptr]=_r6, 8;; \
  75. st8 [ptr]=_r7, 8;;
  76. #define RESTORE_REGION_REGS(ptr, _idx1, _idx2, _tmp) \
  77. mov ar.lc=0x08-1;; \
  78. movl _idx1=0x00;; \
  79. RestRR: \
  80. dep.z _idx2=_idx1,61,3;; \
  81. ld8 _tmp=[ptr],8;; \
  82. mov rr[_idx2]=_tmp;; \
  83. srlz.d;; \
  84. add _idx1=1,_idx1;; \
  85. br.cloop.sptk.few RestRR
  86. #define SET_AREA_FOR_BOOTING_CPU(reg1, reg2) \
  87. movl reg1=sal_state_for_booting_cpu;; \
  88. ld8 reg2=[reg1];;
  89. /*
  90. * Adjust region registers saved before starting to save
  91. * break regs and rest of the states that need to be preserved.
  92. */
  93. #define SAL_TO_OS_BOOT_HANDOFF_STATE_SAVE(_reg1,_reg2,_pred) \
  94. SAVE_FROM_REG(b0,_reg1,_reg2);; \
  95. SAVE_FROM_REG(b1,_reg1,_reg2);; \
  96. SAVE_FROM_REG(b2,_reg1,_reg2);; \
  97. SAVE_FROM_REG(b3,_reg1,_reg2);; \
  98. SAVE_FROM_REG(b4,_reg1,_reg2);; \
  99. SAVE_FROM_REG(b5,_reg1,_reg2);; \
  100. st8 [_reg1]=r1,0x08;; \
  101. st8 [_reg1]=r12,0x08;; \
  102. st8 [_reg1]=r13,0x08;; \
  103. SAVE_FROM_REG(ar.fpsr,_reg1,_reg2);; \
  104. SAVE_FROM_REG(ar.pfs,_reg1,_reg2);; \
  105. SAVE_FROM_REG(ar.rnat,_reg1,_reg2);; \
  106. SAVE_FROM_REG(ar.unat,_reg1,_reg2);; \
  107. SAVE_FROM_REG(ar.bspstore,_reg1,_reg2);; \
  108. SAVE_FROM_REG(cr.dcr,_reg1,_reg2);; \
  109. SAVE_FROM_REG(cr.iva,_reg1,_reg2);; \
  110. SAVE_FROM_REG(cr.pta,_reg1,_reg2);; \
  111. SAVE_FROM_REG(cr.itv,_reg1,_reg2);; \
  112. SAVE_FROM_REG(cr.pmv,_reg1,_reg2);; \
  113. SAVE_FROM_REG(cr.cmcv,_reg1,_reg2);; \
  114. SAVE_FROM_REG(cr.lrr0,_reg1,_reg2);; \
  115. SAVE_FROM_REG(cr.lrr1,_reg1,_reg2);; \
  116. st8 [_reg1]=r4,0x08;; \
  117. st8 [_reg1]=r5,0x08;; \
  118. st8 [_reg1]=r6,0x08;; \
  119. st8 [_reg1]=r7,0x08;; \
  120. st8 [_reg1]=_pred,0x08;; \
  121. SAVE_FROM_REG(ar.lc, _reg1, _reg2);; \
  122. stf.spill.nta [_reg1]=f2,16;; \
  123. stf.spill.nta [_reg1]=f3,16;; \
  124. stf.spill.nta [_reg1]=f4,16;; \
  125. stf.spill.nta [_reg1]=f5,16;; \
  126. stf.spill.nta [_reg1]=f16,16;; \
  127. stf.spill.nta [_reg1]=f17,16;; \
  128. stf.spill.nta [_reg1]=f18,16;; \
  129. stf.spill.nta [_reg1]=f19,16;; \
  130. stf.spill.nta [_reg1]=f20,16;; \
  131. stf.spill.nta [_reg1]=f21,16;; \
  132. stf.spill.nta [_reg1]=f22,16;; \
  133. stf.spill.nta [_reg1]=f23,16;; \
  134. stf.spill.nta [_reg1]=f24,16;; \
  135. stf.spill.nta [_reg1]=f25,16;; \
  136. stf.spill.nta [_reg1]=f26,16;; \
  137. stf.spill.nta [_reg1]=f27,16;; \
  138. stf.spill.nta [_reg1]=f28,16;; \
  139. stf.spill.nta [_reg1]=f29,16;; \
  140. stf.spill.nta [_reg1]=f30,16;; \
  141. stf.spill.nta [_reg1]=f31,16;;
  142. #else
  143. #define SET_AREA_FOR_BOOTING_CPU(a1, a2)
  144. #define SAL_TO_OS_BOOT_HANDOFF_STATE_SAVE(a1,a2, a3)
  145. #define SAVE_REGION_REGS(_tmp, _r0, _r1, _r2, _r3, _r4, _r5, _r6, _r7)
  146. #define STORE_REGION_REGS(ptr, _r0, _r1, _r2, _r3, _r4, _r5, _r6, _r7)
  147. #endif
  148. #define SET_ONE_RR(num, pgsize, _tmp1, _tmp2, vhpt) \
  149. movl _tmp1=(num << 61);; \
  150. mov _tmp2=((ia64_rid(IA64_REGION_ID_KERNEL, (num<<61)) << 8) | (pgsize << 2) | vhpt);; \
  151. mov rr[_tmp1]=_tmp2
  152. __PAGE_ALIGNED_DATA
  153. .global empty_zero_page
  154. empty_zero_page:
  155. .skip PAGE_SIZE
  156. .global swapper_pg_dir
  157. swapper_pg_dir:
  158. .skip PAGE_SIZE
  159. .rodata
  160. halt_msg:
  161. stringz "Halting kernel\n"
  162. __REF
  163. .global start_ap
  164. /*
  165. * Start the kernel. When the bootloader passes control to _start(), r28
  166. * points to the address of the boot parameter area. Execution reaches
  167. * here in physical mode.
  168. */
  169. GLOBAL_ENTRY(_start)
  170. start_ap:
  171. .prologue
  172. .save rp, r0 // terminate unwind chain with a NULL rp
  173. .body
  174. rsm psr.i | psr.ic
  175. ;;
  176. srlz.i
  177. ;;
  178. {
  179. flushrs // must be first insn in group
  180. srlz.i
  181. }
  182. ;;
  183. /*
  184. * Save the region registers, predicate before they get clobbered
  185. */
  186. SAVE_REGION_REGS(r2, r8,r9,r10,r11,r12,r13,r14,r15);
  187. mov r25=pr;;
  188. /*
  189. * Initialize kernel region registers:
  190. * rr[0]: VHPT enabled, page size = PAGE_SHIFT
  191. * rr[1]: VHPT enabled, page size = PAGE_SHIFT
  192. * rr[2]: VHPT enabled, page size = PAGE_SHIFT
  193. * rr[3]: VHPT enabled, page size = PAGE_SHIFT
  194. * rr[4]: VHPT enabled, page size = PAGE_SHIFT
  195. * rr[5]: VHPT enabled, page size = PAGE_SHIFT
  196. * rr[6]: VHPT disabled, page size = IA64_GRANULE_SHIFT
  197. * rr[7]: VHPT disabled, page size = IA64_GRANULE_SHIFT
  198. * We initialize all of them to prevent inadvertently assuming
  199. * something about the state of address translation early in boot.
  200. */
  201. SET_ONE_RR(0, PAGE_SHIFT, r2, r16, 1);;
  202. SET_ONE_RR(1, PAGE_SHIFT, r2, r16, 1);;
  203. SET_ONE_RR(2, PAGE_SHIFT, r2, r16, 1);;
  204. SET_ONE_RR(3, PAGE_SHIFT, r2, r16, 1);;
  205. SET_ONE_RR(4, PAGE_SHIFT, r2, r16, 1);;
  206. SET_ONE_RR(5, PAGE_SHIFT, r2, r16, 1);;
  207. SET_ONE_RR(6, IA64_GRANULE_SHIFT, r2, r16, 0);;
  208. SET_ONE_RR(7, IA64_GRANULE_SHIFT, r2, r16, 0);;
  209. /*
  210. * Now pin mappings into the TLB for kernel text and data
  211. */
  212. mov r18=KERNEL_TR_PAGE_SHIFT<<2
  213. movl r17=KERNEL_START
  214. ;;
  215. mov cr.itir=r18
  216. mov cr.ifa=r17
  217. mov r16=IA64_TR_KERNEL
  218. mov r3=ip
  219. movl r18=PAGE_KERNEL
  220. ;;
  221. dep r2=0,r3,0,KERNEL_TR_PAGE_SHIFT
  222. ;;
  223. or r18=r2,r18
  224. ;;
  225. srlz.i
  226. ;;
  227. itr.i itr[r16]=r18
  228. ;;
  229. itr.d dtr[r16]=r18
  230. ;;
  231. srlz.i
  232. /*
  233. * Switch into virtual mode:
  234. */
  235. movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN \
  236. |IA64_PSR_DI)
  237. ;;
  238. mov cr.ipsr=r16
  239. movl r17=1f
  240. ;;
  241. mov cr.iip=r17
  242. mov cr.ifs=r0
  243. ;;
  244. rfi
  245. ;;
  246. 1: // now we are in virtual mode
  247. SET_AREA_FOR_BOOTING_CPU(r2, r16);
  248. STORE_REGION_REGS(r16, r8,r9,r10,r11,r12,r13,r14,r15);
  249. SAL_TO_OS_BOOT_HANDOFF_STATE_SAVE(r16,r17,r25)
  250. ;;
  251. // set IVT entry point---can't access I/O ports without it
  252. movl r3=ia64_ivt
  253. ;;
  254. mov cr.iva=r3
  255. movl r2=FPSR_DEFAULT
  256. ;;
  257. srlz.i
  258. movl gp=__gp
  259. mov ar.fpsr=r2
  260. ;;
  261. #define isAP p2 // are we an Application Processor?
  262. #define isBP p3 // are we the Bootstrap Processor?
  263. #ifdef CONFIG_SMP
  264. /*
  265. * Find the init_task for the currently booting CPU. At poweron, and in
  266. * UP mode, task_for_booting_cpu is NULL.
  267. */
  268. movl r3=task_for_booting_cpu
  269. ;;
  270. ld8 r3=[r3]
  271. movl r2=init_task
  272. ;;
  273. cmp.eq isBP,isAP=r3,r0
  274. ;;
  275. (isAP) mov r2=r3
  276. #else
  277. movl r2=init_task
  278. cmp.eq isBP,isAP=r0,r0
  279. #endif
  280. ;;
  281. tpa r3=r2 // r3 == phys addr of task struct
  282. mov r16=-1
  283. (isBP) br.cond.dpnt .load_current // BP stack is on region 5 --- no need to map it
  284. // load mapping for stack (virtaddr in r2, physaddr in r3)
  285. rsm psr.ic
  286. movl r17=PAGE_KERNEL
  287. ;;
  288. srlz.d
  289. dep r18=0,r3,0,12
  290. ;;
  291. or r18=r17,r18
  292. dep r2=-1,r3,61,3 // IMVA of task
  293. ;;
  294. mov r17=rr[r2]
  295. shr.u r16=r3,IA64_GRANULE_SHIFT
  296. ;;
  297. dep r17=0,r17,8,24
  298. ;;
  299. mov cr.itir=r17
  300. mov cr.ifa=r2
  301. mov r19=IA64_TR_CURRENT_STACK
  302. ;;
  303. itr.d dtr[r19]=r18
  304. ;;
  305. ssm psr.ic
  306. srlz.d
  307. ;;
  308. .load_current:
  309. // load the "current" pointer (r13) and ar.k6 with the current task
  310. mov IA64_KR(CURRENT)=r2 // virtual address
  311. mov IA64_KR(CURRENT_STACK)=r16
  312. mov r13=r2
  313. /*
  314. * Reserve space at the top of the stack for "struct pt_regs". Kernel
  315. * threads don't store interesting values in that structure, but the space
  316. * still needs to be there because time-critical stuff such as the context
  317. * switching can be implemented more efficiently (for example, __switch_to()
  318. * always sets the psr.dfh bit of the task it is switching to).
  319. */
  320. addl r12=IA64_STK_OFFSET-IA64_PT_REGS_SIZE-16,r2
  321. addl r2=IA64_RBS_OFFSET,r2 // initialize the RSE
  322. mov ar.rsc=0 // place RSE in enforced lazy mode
  323. ;;
  324. loadrs // clear the dirty partition
  325. movl r19=__phys_per_cpu_start
  326. mov r18=PERCPU_PAGE_SIZE
  327. ;;
  328. #ifndef CONFIG_SMP
  329. add r19=r19,r18
  330. ;;
  331. #else
  332. (isAP) br.few 2f
  333. movl r20=__cpu0_per_cpu
  334. ;;
  335. shr.u r18=r18,3
  336. 1:
  337. ld8 r21=[r19],8;;
  338. st8[r20]=r21,8
  339. adds r18=-1,r18;;
  340. cmp4.lt p7,p6=0,r18
  341. (p7) br.cond.dptk.few 1b
  342. mov r19=r20
  343. ;;
  344. 2:
  345. #endif
  346. tpa r19=r19
  347. ;;
  348. .pred.rel.mutex isBP,isAP
  349. (isBP) mov IA64_KR(PER_CPU_DATA)=r19 // per-CPU base for cpu0
  350. (isAP) mov IA64_KR(PER_CPU_DATA)=r0 // clear physical per-CPU base
  351. ;;
  352. mov ar.bspstore=r2 // establish the new RSE stack
  353. ;;
  354. mov ar.rsc=0x3 // place RSE in eager mode
  355. (isBP) dep r28=-1,r28,61,3 // make address virtual
  356. (isBP) movl r2=ia64_boot_param
  357. ;;
  358. (isBP) st8 [r2]=r28 // save the address of the boot param area passed by the bootloader
  359. #ifdef CONFIG_SMP
  360. (isAP) br.call.sptk.many rp=start_secondary
  361. .ret0:
  362. (isAP) br.cond.sptk self
  363. #endif
  364. // This is executed by the bootstrap processor (bsp) only:
  365. #ifdef CONFIG_IA64_FW_EMU
  366. // initialize PAL & SAL emulator:
  367. br.call.sptk.many rp=sys_fw_init
  368. .ret1:
  369. #endif
  370. br.call.sptk.many rp=start_kernel
  371. .ret2: addl r3=@ltoff(halt_msg),gp
  372. ;;
  373. alloc r2=ar.pfs,8,0,2,0
  374. ;;
  375. ld8 out0=[r3]
  376. br.call.sptk.many b0=console_print
  377. self: hint @pause
  378. br.sptk.many self // endless loop
  379. END(_start)
  380. .text
  381. GLOBAL_ENTRY(ia64_save_debug_regs)
  382. alloc r16=ar.pfs,1,0,0,0
  383. mov r20=ar.lc // preserve ar.lc
  384. mov ar.lc=IA64_NUM_DBG_REGS-1
  385. mov r18=0
  386. add r19=IA64_NUM_DBG_REGS*8,in0
  387. ;;
  388. 1: mov r16=dbr[r18]
  389. #ifdef CONFIG_ITANIUM
  390. ;;
  391. srlz.d
  392. #endif
  393. mov r17=ibr[r18]
  394. add r18=1,r18
  395. ;;
  396. st8.nta [in0]=r16,8
  397. st8.nta [r19]=r17,8
  398. br.cloop.sptk.many 1b
  399. ;;
  400. mov ar.lc=r20 // restore ar.lc
  401. br.ret.sptk.many rp
  402. END(ia64_save_debug_regs)
  403. GLOBAL_ENTRY(ia64_load_debug_regs)
  404. alloc r16=ar.pfs,1,0,0,0
  405. lfetch.nta [in0]
  406. mov r20=ar.lc // preserve ar.lc
  407. add r19=IA64_NUM_DBG_REGS*8,in0
  408. mov ar.lc=IA64_NUM_DBG_REGS-1
  409. mov r18=-1
  410. ;;
  411. 1: ld8.nta r16=[in0],8
  412. ld8.nta r17=[r19],8
  413. add r18=1,r18
  414. ;;
  415. mov dbr[r18]=r16
  416. #ifdef CONFIG_ITANIUM
  417. ;;
  418. srlz.d // Errata 132 (NoFix status)
  419. #endif
  420. mov ibr[r18]=r17
  421. br.cloop.sptk.many 1b
  422. ;;
  423. mov ar.lc=r20 // restore ar.lc
  424. br.ret.sptk.many rp
  425. END(ia64_load_debug_regs)
  426. GLOBAL_ENTRY(__ia64_save_fpu)
  427. alloc r2=ar.pfs,1,4,0,0
  428. adds loc0=96*16-16,in0
  429. adds loc1=96*16-16-128,in0
  430. ;;
  431. stf.spill.nta [loc0]=f127,-256
  432. stf.spill.nta [loc1]=f119,-256
  433. ;;
  434. stf.spill.nta [loc0]=f111,-256
  435. stf.spill.nta [loc1]=f103,-256
  436. ;;
  437. stf.spill.nta [loc0]=f95,-256
  438. stf.spill.nta [loc1]=f87,-256
  439. ;;
  440. stf.spill.nta [loc0]=f79,-256
  441. stf.spill.nta [loc1]=f71,-256
  442. ;;
  443. stf.spill.nta [loc0]=f63,-256
  444. stf.spill.nta [loc1]=f55,-256
  445. adds loc2=96*16-32,in0
  446. ;;
  447. stf.spill.nta [loc0]=f47,-256
  448. stf.spill.nta [loc1]=f39,-256
  449. adds loc3=96*16-32-128,in0
  450. ;;
  451. stf.spill.nta [loc2]=f126,-256
  452. stf.spill.nta [loc3]=f118,-256
  453. ;;
  454. stf.spill.nta [loc2]=f110,-256
  455. stf.spill.nta [loc3]=f102,-256
  456. ;;
  457. stf.spill.nta [loc2]=f94,-256
  458. stf.spill.nta [loc3]=f86,-256
  459. ;;
  460. stf.spill.nta [loc2]=f78,-256
  461. stf.spill.nta [loc3]=f70,-256
  462. ;;
  463. stf.spill.nta [loc2]=f62,-256
  464. stf.spill.nta [loc3]=f54,-256
  465. adds loc0=96*16-48,in0
  466. ;;
  467. stf.spill.nta [loc2]=f46,-256
  468. stf.spill.nta [loc3]=f38,-256
  469. adds loc1=96*16-48-128,in0
  470. ;;
  471. stf.spill.nta [loc0]=f125,-256
  472. stf.spill.nta [loc1]=f117,-256
  473. ;;
  474. stf.spill.nta [loc0]=f109,-256
  475. stf.spill.nta [loc1]=f101,-256
  476. ;;
  477. stf.spill.nta [loc0]=f93,-256
  478. stf.spill.nta [loc1]=f85,-256
  479. ;;
  480. stf.spill.nta [loc0]=f77,-256
  481. stf.spill.nta [loc1]=f69,-256
  482. ;;
  483. stf.spill.nta [loc0]=f61,-256
  484. stf.spill.nta [loc1]=f53,-256
  485. adds loc2=96*16-64,in0
  486. ;;
  487. stf.spill.nta [loc0]=f45,-256
  488. stf.spill.nta [loc1]=f37,-256
  489. adds loc3=96*16-64-128,in0
  490. ;;
  491. stf.spill.nta [loc2]=f124,-256
  492. stf.spill.nta [loc3]=f116,-256
  493. ;;
  494. stf.spill.nta [loc2]=f108,-256
  495. stf.spill.nta [loc3]=f100,-256
  496. ;;
  497. stf.spill.nta [loc2]=f92,-256
  498. stf.spill.nta [loc3]=f84,-256
  499. ;;
  500. stf.spill.nta [loc2]=f76,-256
  501. stf.spill.nta [loc3]=f68,-256
  502. ;;
  503. stf.spill.nta [loc2]=f60,-256
  504. stf.spill.nta [loc3]=f52,-256
  505. adds loc0=96*16-80,in0
  506. ;;
  507. stf.spill.nta [loc2]=f44,-256
  508. stf.spill.nta [loc3]=f36,-256
  509. adds loc1=96*16-80-128,in0
  510. ;;
  511. stf.spill.nta [loc0]=f123,-256
  512. stf.spill.nta [loc1]=f115,-256
  513. ;;
  514. stf.spill.nta [loc0]=f107,-256
  515. stf.spill.nta [loc1]=f99,-256
  516. ;;
  517. stf.spill.nta [loc0]=f91,-256
  518. stf.spill.nta [loc1]=f83,-256
  519. ;;
  520. stf.spill.nta [loc0]=f75,-256
  521. stf.spill.nta [loc1]=f67,-256
  522. ;;
  523. stf.spill.nta [loc0]=f59,-256
  524. stf.spill.nta [loc1]=f51,-256
  525. adds loc2=96*16-96,in0
  526. ;;
  527. stf.spill.nta [loc0]=f43,-256
  528. stf.spill.nta [loc1]=f35,-256
  529. adds loc3=96*16-96-128,in0
  530. ;;
  531. stf.spill.nta [loc2]=f122,-256
  532. stf.spill.nta [loc3]=f114,-256
  533. ;;
  534. stf.spill.nta [loc2]=f106,-256
  535. stf.spill.nta [loc3]=f98,-256
  536. ;;
  537. stf.spill.nta [loc2]=f90,-256
  538. stf.spill.nta [loc3]=f82,-256
  539. ;;
  540. stf.spill.nta [loc2]=f74,-256
  541. stf.spill.nta [loc3]=f66,-256
  542. ;;
  543. stf.spill.nta [loc2]=f58,-256
  544. stf.spill.nta [loc3]=f50,-256
  545. adds loc0=96*16-112,in0
  546. ;;
  547. stf.spill.nta [loc2]=f42,-256
  548. stf.spill.nta [loc3]=f34,-256
  549. adds loc1=96*16-112-128,in0
  550. ;;
  551. stf.spill.nta [loc0]=f121,-256
  552. stf.spill.nta [loc1]=f113,-256
  553. ;;
  554. stf.spill.nta [loc0]=f105,-256
  555. stf.spill.nta [loc1]=f97,-256
  556. ;;
  557. stf.spill.nta [loc0]=f89,-256
  558. stf.spill.nta [loc1]=f81,-256
  559. ;;
  560. stf.spill.nta [loc0]=f73,-256
  561. stf.spill.nta [loc1]=f65,-256
  562. ;;
  563. stf.spill.nta [loc0]=f57,-256
  564. stf.spill.nta [loc1]=f49,-256
  565. adds loc2=96*16-128,in0
  566. ;;
  567. stf.spill.nta [loc0]=f41,-256
  568. stf.spill.nta [loc1]=f33,-256
  569. adds loc3=96*16-128-128,in0
  570. ;;
  571. stf.spill.nta [loc2]=f120,-256
  572. stf.spill.nta [loc3]=f112,-256
  573. ;;
  574. stf.spill.nta [loc2]=f104,-256
  575. stf.spill.nta [loc3]=f96,-256
  576. ;;
  577. stf.spill.nta [loc2]=f88,-256
  578. stf.spill.nta [loc3]=f80,-256
  579. ;;
  580. stf.spill.nta [loc2]=f72,-256
  581. stf.spill.nta [loc3]=f64,-256
  582. ;;
  583. stf.spill.nta [loc2]=f56,-256
  584. stf.spill.nta [loc3]=f48,-256
  585. ;;
  586. stf.spill.nta [loc2]=f40
  587. stf.spill.nta [loc3]=f32
  588. br.ret.sptk.many rp
  589. END(__ia64_save_fpu)
  590. GLOBAL_ENTRY(__ia64_load_fpu)
  591. alloc r2=ar.pfs,1,2,0,0
  592. adds r3=128,in0
  593. adds r14=256,in0
  594. adds r15=384,in0
  595. mov loc0=512
  596. mov loc1=-1024+16
  597. ;;
  598. ldf.fill.nta f32=[in0],loc0
  599. ldf.fill.nta f40=[ r3],loc0
  600. ldf.fill.nta f48=[r14],loc0
  601. ldf.fill.nta f56=[r15],loc0
  602. ;;
  603. ldf.fill.nta f64=[in0],loc0
  604. ldf.fill.nta f72=[ r3],loc0
  605. ldf.fill.nta f80=[r14],loc0
  606. ldf.fill.nta f88=[r15],loc0
  607. ;;
  608. ldf.fill.nta f96=[in0],loc1
  609. ldf.fill.nta f104=[ r3],loc1
  610. ldf.fill.nta f112=[r14],loc1
  611. ldf.fill.nta f120=[r15],loc1
  612. ;;
  613. ldf.fill.nta f33=[in0],loc0
  614. ldf.fill.nta f41=[ r3],loc0
  615. ldf.fill.nta f49=[r14],loc0
  616. ldf.fill.nta f57=[r15],loc0
  617. ;;
  618. ldf.fill.nta f65=[in0],loc0
  619. ldf.fill.nta f73=[ r3],loc0
  620. ldf.fill.nta f81=[r14],loc0
  621. ldf.fill.nta f89=[r15],loc0
  622. ;;
  623. ldf.fill.nta f97=[in0],loc1
  624. ldf.fill.nta f105=[ r3],loc1
  625. ldf.fill.nta f113=[r14],loc1
  626. ldf.fill.nta f121=[r15],loc1
  627. ;;
  628. ldf.fill.nta f34=[in0],loc0
  629. ldf.fill.nta f42=[ r3],loc0
  630. ldf.fill.nta f50=[r14],loc0
  631. ldf.fill.nta f58=[r15],loc0
  632. ;;
  633. ldf.fill.nta f66=[in0],loc0
  634. ldf.fill.nta f74=[ r3],loc0
  635. ldf.fill.nta f82=[r14],loc0
  636. ldf.fill.nta f90=[r15],loc0
  637. ;;
  638. ldf.fill.nta f98=[in0],loc1
  639. ldf.fill.nta f106=[ r3],loc1
  640. ldf.fill.nta f114=[r14],loc1
  641. ldf.fill.nta f122=[r15],loc1
  642. ;;
  643. ldf.fill.nta f35=[in0],loc0
  644. ldf.fill.nta f43=[ r3],loc0
  645. ldf.fill.nta f51=[r14],loc0
  646. ldf.fill.nta f59=[r15],loc0
  647. ;;
  648. ldf.fill.nta f67=[in0],loc0
  649. ldf.fill.nta f75=[ r3],loc0
  650. ldf.fill.nta f83=[r14],loc0
  651. ldf.fill.nta f91=[r15],loc0
  652. ;;
  653. ldf.fill.nta f99=[in0],loc1
  654. ldf.fill.nta f107=[ r3],loc1
  655. ldf.fill.nta f115=[r14],loc1
  656. ldf.fill.nta f123=[r15],loc1
  657. ;;
  658. ldf.fill.nta f36=[in0],loc0
  659. ldf.fill.nta f44=[ r3],loc0
  660. ldf.fill.nta f52=[r14],loc0
  661. ldf.fill.nta f60=[r15],loc0
  662. ;;
  663. ldf.fill.nta f68=[in0],loc0
  664. ldf.fill.nta f76=[ r3],loc0
  665. ldf.fill.nta f84=[r14],loc0
  666. ldf.fill.nta f92=[r15],loc0
  667. ;;
  668. ldf.fill.nta f100=[in0],loc1
  669. ldf.fill.nta f108=[ r3],loc1
  670. ldf.fill.nta f116=[r14],loc1
  671. ldf.fill.nta f124=[r15],loc1
  672. ;;
  673. ldf.fill.nta f37=[in0],loc0
  674. ldf.fill.nta f45=[ r3],loc0
  675. ldf.fill.nta f53=[r14],loc0
  676. ldf.fill.nta f61=[r15],loc0
  677. ;;
  678. ldf.fill.nta f69=[in0],loc0
  679. ldf.fill.nta f77=[ r3],loc0
  680. ldf.fill.nta f85=[r14],loc0
  681. ldf.fill.nta f93=[r15],loc0
  682. ;;
  683. ldf.fill.nta f101=[in0],loc1
  684. ldf.fill.nta f109=[ r3],loc1
  685. ldf.fill.nta f117=[r14],loc1
  686. ldf.fill.nta f125=[r15],loc1
  687. ;;
  688. ldf.fill.nta f38 =[in0],loc0
  689. ldf.fill.nta f46 =[ r3],loc0
  690. ldf.fill.nta f54 =[r14],loc0
  691. ldf.fill.nta f62 =[r15],loc0
  692. ;;
  693. ldf.fill.nta f70 =[in0],loc0
  694. ldf.fill.nta f78 =[ r3],loc0
  695. ldf.fill.nta f86 =[r14],loc0
  696. ldf.fill.nta f94 =[r15],loc0
  697. ;;
  698. ldf.fill.nta f102=[in0],loc1
  699. ldf.fill.nta f110=[ r3],loc1
  700. ldf.fill.nta f118=[r14],loc1
  701. ldf.fill.nta f126=[r15],loc1
  702. ;;
  703. ldf.fill.nta f39 =[in0],loc0
  704. ldf.fill.nta f47 =[ r3],loc0
  705. ldf.fill.nta f55 =[r14],loc0
  706. ldf.fill.nta f63 =[r15],loc0
  707. ;;
  708. ldf.fill.nta f71 =[in0],loc0
  709. ldf.fill.nta f79 =[ r3],loc0
  710. ldf.fill.nta f87 =[r14],loc0
  711. ldf.fill.nta f95 =[r15],loc0
  712. ;;
  713. ldf.fill.nta f103=[in0]
  714. ldf.fill.nta f111=[ r3]
  715. ldf.fill.nta f119=[r14]
  716. ldf.fill.nta f127=[r15]
  717. br.ret.sptk.many rp
  718. END(__ia64_load_fpu)
  719. GLOBAL_ENTRY(__ia64_init_fpu)
  720. stf.spill [sp]=f0 // M3
  721. mov f32=f0 // F
  722. nop.b 0
  723. ldfps f33,f34=[sp] // M0
  724. ldfps f35,f36=[sp] // M1
  725. mov f37=f0 // F
  726. ;;
  727. setf.s f38=r0 // M2
  728. setf.s f39=r0 // M3
  729. mov f40=f0 // F
  730. ldfps f41,f42=[sp] // M0
  731. ldfps f43,f44=[sp] // M1
  732. mov f45=f0 // F
  733. setf.s f46=r0 // M2
  734. setf.s f47=r0 // M3
  735. mov f48=f0 // F
  736. ldfps f49,f50=[sp] // M0
  737. ldfps f51,f52=[sp] // M1
  738. mov f53=f0 // F
  739. setf.s f54=r0 // M2
  740. setf.s f55=r0 // M3
  741. mov f56=f0 // F
  742. ldfps f57,f58=[sp] // M0
  743. ldfps f59,f60=[sp] // M1
  744. mov f61=f0 // F
  745. setf.s f62=r0 // M2
  746. setf.s f63=r0 // M3
  747. mov f64=f0 // F
  748. ldfps f65,f66=[sp] // M0
  749. ldfps f67,f68=[sp] // M1
  750. mov f69=f0 // F
  751. setf.s f70=r0 // M2
  752. setf.s f71=r0 // M3
  753. mov f72=f0 // F
  754. ldfps f73,f74=[sp] // M0
  755. ldfps f75,f76=[sp] // M1
  756. mov f77=f0 // F
  757. setf.s f78=r0 // M2
  758. setf.s f79=r0 // M3
  759. mov f80=f0 // F
  760. ldfps f81,f82=[sp] // M0
  761. ldfps f83,f84=[sp] // M1
  762. mov f85=f0 // F
  763. setf.s f86=r0 // M2
  764. setf.s f87=r0 // M3
  765. mov f88=f0 // F
  766. /*
  767. * When the instructions are cached, it would be faster to initialize
  768. * the remaining registers with simply mov instructions (F-unit).
  769. * This gets the time down to ~29 cycles. However, this would use up
  770. * 33 bundles, whereas continuing with the above pattern yields
  771. * 10 bundles and ~30 cycles.
  772. */
  773. ldfps f89,f90=[sp] // M0
  774. ldfps f91,f92=[sp] // M1
  775. mov f93=f0 // F
  776. setf.s f94=r0 // M2
  777. setf.s f95=r0 // M3
  778. mov f96=f0 // F
  779. ldfps f97,f98=[sp] // M0
  780. ldfps f99,f100=[sp] // M1
  781. mov f101=f0 // F
  782. setf.s f102=r0 // M2
  783. setf.s f103=r0 // M3
  784. mov f104=f0 // F
  785. ldfps f105,f106=[sp] // M0
  786. ldfps f107,f108=[sp] // M1
  787. mov f109=f0 // F
  788. setf.s f110=r0 // M2
  789. setf.s f111=r0 // M3
  790. mov f112=f0 // F
  791. ldfps f113,f114=[sp] // M0
  792. ldfps f115,f116=[sp] // M1
  793. mov f117=f0 // F
  794. setf.s f118=r0 // M2
  795. setf.s f119=r0 // M3
  796. mov f120=f0 // F
  797. ldfps f121,f122=[sp] // M0
  798. ldfps f123,f124=[sp] // M1
  799. mov f125=f0 // F
  800. setf.s f126=r0 // M2
  801. setf.s f127=r0 // M3
  802. br.ret.sptk.many rp // F
  803. END(__ia64_init_fpu)
  804. /*
  805. * Switch execution mode from virtual to physical
  806. *
  807. * Inputs:
  808. * r16 = new psr to establish
  809. * Output:
  810. * r19 = old virtual address of ar.bsp
  811. * r20 = old virtual address of sp
  812. *
  813. * Note: RSE must already be in enforced lazy mode
  814. */
  815. GLOBAL_ENTRY(ia64_switch_mode_phys)
  816. {
  817. rsm psr.i | psr.ic // disable interrupts and interrupt collection
  818. mov r15=ip
  819. }
  820. ;;
  821. {
  822. flushrs // must be first insn in group
  823. srlz.i
  824. }
  825. ;;
  826. mov cr.ipsr=r16 // set new PSR
  827. add r3=1f-ia64_switch_mode_phys,r15
  828. mov r19=ar.bsp
  829. mov r20=sp
  830. mov r14=rp // get return address into a general register
  831. ;;
  832. // going to physical mode, use tpa to translate virt->phys
  833. tpa r17=r19
  834. tpa r3=r3
  835. tpa sp=sp
  836. tpa r14=r14
  837. ;;
  838. mov r18=ar.rnat // save ar.rnat
  839. mov ar.bspstore=r17 // this steps on ar.rnat
  840. mov cr.iip=r3
  841. mov cr.ifs=r0
  842. ;;
  843. mov ar.rnat=r18 // restore ar.rnat
  844. rfi // must be last insn in group
  845. ;;
  846. 1: mov rp=r14
  847. br.ret.sptk.many rp
  848. END(ia64_switch_mode_phys)
  849. /*
  850. * Switch execution mode from physical to virtual
  851. *
  852. * Inputs:
  853. * r16 = new psr to establish
  854. * r19 = new bspstore to establish
  855. * r20 = new sp to establish
  856. *
  857. * Note: RSE must already be in enforced lazy mode
  858. */
  859. GLOBAL_ENTRY(ia64_switch_mode_virt)
  860. {
  861. rsm psr.i | psr.ic // disable interrupts and interrupt collection
  862. mov r15=ip
  863. }
  864. ;;
  865. {
  866. flushrs // must be first insn in group
  867. srlz.i
  868. }
  869. ;;
  870. mov cr.ipsr=r16 // set new PSR
  871. add r3=1f-ia64_switch_mode_virt,r15
  872. mov r14=rp // get return address into a general register
  873. ;;
  874. // going to virtual
  875. // - for code addresses, set upper bits of addr to KERNEL_START
  876. // - for stack addresses, copy from input argument
  877. movl r18=KERNEL_START
  878. dep r3=0,r3,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
  879. dep r14=0,r14,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
  880. mov sp=r20
  881. ;;
  882. or r3=r3,r18
  883. or r14=r14,r18
  884. ;;
  885. mov r18=ar.rnat // save ar.rnat
  886. mov ar.bspstore=r19 // this steps on ar.rnat
  887. mov cr.iip=r3
  888. mov cr.ifs=r0
  889. ;;
  890. mov ar.rnat=r18 // restore ar.rnat
  891. rfi // must be last insn in group
  892. ;;
  893. 1: mov rp=r14
  894. br.ret.sptk.many rp
  895. END(ia64_switch_mode_virt)
  896. GLOBAL_ENTRY(ia64_delay_loop)
  897. .prologue
  898. { nop 0 // work around GAS unwind info generation bug...
  899. .save ar.lc,r2
  900. mov r2=ar.lc
  901. .body
  902. ;;
  903. mov ar.lc=r32
  904. }
  905. ;;
  906. // force loop to be 32-byte aligned (GAS bug means we cannot use .align
  907. // inside function body without corrupting unwind info).
  908. { nop 0 }
  909. 1: br.cloop.sptk.few 1b
  910. ;;
  911. mov ar.lc=r2
  912. br.ret.sptk.many rp
  913. END(ia64_delay_loop)
  914. /*
  915. * Return a CPU-local timestamp in nano-seconds. This timestamp is
  916. * NOT synchronized across CPUs its return value must never be
  917. * compared against the values returned on another CPU. The usage in
  918. * kernel/sched/core.c ensures that.
  919. *
  920. * The return-value of sched_clock() is NOT supposed to wrap-around.
  921. * If it did, it would cause some scheduling hiccups (at the worst).
  922. * Fortunately, with a 64-bit cycle-counter ticking at 100GHz, even
  923. * that would happen only once every 5+ years.
  924. *
  925. * The code below basically calculates:
  926. *
  927. * (ia64_get_itc() * local_cpu_data->nsec_per_cyc) >> IA64_NSEC_PER_CYC_SHIFT
  928. *
  929. * except that the multiplication and the shift are done with 128-bit
  930. * intermediate precision so that we can produce a full 64-bit result.
  931. */
  932. GLOBAL_ENTRY(ia64_native_sched_clock)
  933. addl r8=THIS_CPU(ia64_cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
  934. mov.m r9=ar.itc // fetch cycle-counter (35 cyc)
  935. ;;
  936. ldf8 f8=[r8]
  937. ;;
  938. setf.sig f9=r9 // certain to stall, so issue it _after_ ldf8...
  939. ;;
  940. xmpy.lu f10=f9,f8 // calculate low 64 bits of 128-bit product (4 cyc)
  941. xmpy.hu f11=f9,f8 // calculate high 64 bits of 128-bit product
  942. ;;
  943. getf.sig r8=f10 // (5 cyc)
  944. getf.sig r9=f11
  945. ;;
  946. shrp r8=r9,r8,IA64_NSEC_PER_CYC_SHIFT
  947. br.ret.sptk.many rp
  948. END(ia64_native_sched_clock)
  949. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  950. GLOBAL_ENTRY(cycle_to_cputime)
  951. alloc r16=ar.pfs,1,0,0,0
  952. addl r8=THIS_CPU(ia64_cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
  953. ;;
  954. ldf8 f8=[r8]
  955. ;;
  956. setf.sig f9=r32
  957. ;;
  958. xmpy.lu f10=f9,f8 // calculate low 64 bits of 128-bit product (4 cyc)
  959. xmpy.hu f11=f9,f8 // calculate high 64 bits of 128-bit product
  960. ;;
  961. getf.sig r8=f10 // (5 cyc)
  962. getf.sig r9=f11
  963. ;;
  964. shrp r8=r9,r8,IA64_NSEC_PER_CYC_SHIFT
  965. br.ret.sptk.many rp
  966. END(cycle_to_cputime)
  967. #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
  968. #ifdef CONFIG_IA64_BRL_EMU
  969. /*
  970. * Assembly routines used by brl_emu.c to set preserved register state.
  971. */
  972. #define SET_REG(reg) \
  973. GLOBAL_ENTRY(ia64_set_##reg); \
  974. alloc r16=ar.pfs,1,0,0,0; \
  975. mov reg=r32; \
  976. ;; \
  977. br.ret.sptk.many rp; \
  978. END(ia64_set_##reg)
  979. SET_REG(b1);
  980. SET_REG(b2);
  981. SET_REG(b3);
  982. SET_REG(b4);
  983. SET_REG(b5);
  984. #endif /* CONFIG_IA64_BRL_EMU */
  985. #ifdef CONFIG_SMP
  986. #ifdef CONFIG_HOTPLUG_CPU
  987. GLOBAL_ENTRY(ia64_jump_to_sal)
  988. alloc r16=ar.pfs,1,0,0,0;;
  989. rsm psr.i | psr.ic
  990. {
  991. flushrs
  992. srlz.i
  993. }
  994. tpa r25=in0
  995. movl r18=tlb_purge_done;;
  996. DATA_VA_TO_PA(r18);;
  997. mov b1=r18 // Return location
  998. movl r18=ia64_do_tlb_purge;;
  999. DATA_VA_TO_PA(r18);;
  1000. mov b2=r18 // doing tlb_flush work
  1001. mov ar.rsc=0 // Put RSE in enforced lazy, LE mode
  1002. movl r17=1f;;
  1003. DATA_VA_TO_PA(r17);;
  1004. mov cr.iip=r17
  1005. movl r16=SAL_PSR_BITS_TO_SET;;
  1006. mov cr.ipsr=r16
  1007. mov cr.ifs=r0;;
  1008. rfi;; // note: this unmask MCA/INIT (psr.mc)
  1009. 1:
  1010. /*
  1011. * Invalidate all TLB data/inst
  1012. */
  1013. br.sptk.many b2;; // jump to tlb purge code
  1014. tlb_purge_done:
  1015. RESTORE_REGION_REGS(r25, r17,r18,r19);;
  1016. RESTORE_REG(b0, r25, r17);;
  1017. RESTORE_REG(b1, r25, r17);;
  1018. RESTORE_REG(b2, r25, r17);;
  1019. RESTORE_REG(b3, r25, r17);;
  1020. RESTORE_REG(b4, r25, r17);;
  1021. RESTORE_REG(b5, r25, r17);;
  1022. ld8 r1=[r25],0x08;;
  1023. ld8 r12=[r25],0x08;;
  1024. ld8 r13=[r25],0x08;;
  1025. RESTORE_REG(ar.fpsr, r25, r17);;
  1026. RESTORE_REG(ar.pfs, r25, r17);;
  1027. RESTORE_REG(ar.rnat, r25, r17);;
  1028. RESTORE_REG(ar.unat, r25, r17);;
  1029. RESTORE_REG(ar.bspstore, r25, r17);;
  1030. RESTORE_REG(cr.dcr, r25, r17);;
  1031. RESTORE_REG(cr.iva, r25, r17);;
  1032. RESTORE_REG(cr.pta, r25, r17);;
  1033. srlz.d;; // required not to violate RAW dependency
  1034. RESTORE_REG(cr.itv, r25, r17);;
  1035. RESTORE_REG(cr.pmv, r25, r17);;
  1036. RESTORE_REG(cr.cmcv, r25, r17);;
  1037. RESTORE_REG(cr.lrr0, r25, r17);;
  1038. RESTORE_REG(cr.lrr1, r25, r17);;
  1039. ld8 r4=[r25],0x08;;
  1040. ld8 r5=[r25],0x08;;
  1041. ld8 r6=[r25],0x08;;
  1042. ld8 r7=[r25],0x08;;
  1043. ld8 r17=[r25],0x08;;
  1044. mov pr=r17,-1;;
  1045. RESTORE_REG(ar.lc, r25, r17);;
  1046. /*
  1047. * Now Restore floating point regs
  1048. */
  1049. ldf.fill.nta f2=[r25],16;;
  1050. ldf.fill.nta f3=[r25],16;;
  1051. ldf.fill.nta f4=[r25],16;;
  1052. ldf.fill.nta f5=[r25],16;;
  1053. ldf.fill.nta f16=[r25],16;;
  1054. ldf.fill.nta f17=[r25],16;;
  1055. ldf.fill.nta f18=[r25],16;;
  1056. ldf.fill.nta f19=[r25],16;;
  1057. ldf.fill.nta f20=[r25],16;;
  1058. ldf.fill.nta f21=[r25],16;;
  1059. ldf.fill.nta f22=[r25],16;;
  1060. ldf.fill.nta f23=[r25],16;;
  1061. ldf.fill.nta f24=[r25],16;;
  1062. ldf.fill.nta f25=[r25],16;;
  1063. ldf.fill.nta f26=[r25],16;;
  1064. ldf.fill.nta f27=[r25],16;;
  1065. ldf.fill.nta f28=[r25],16;;
  1066. ldf.fill.nta f29=[r25],16;;
  1067. ldf.fill.nta f30=[r25],16;;
  1068. ldf.fill.nta f31=[r25],16;;
  1069. /*
  1070. * Now that we have done all the register restores
  1071. * we are now ready for the big DIVE to SAL Land
  1072. */
  1073. ssm psr.ic;;
  1074. srlz.d;;
  1075. br.ret.sptk.many b0;;
  1076. END(ia64_jump_to_sal)
  1077. #endif /* CONFIG_HOTPLUG_CPU */
  1078. #endif /* CONFIG_SMP */