misc.S 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  1. /*
  2. * arch/ppc/kernel/misc.S
  3. *
  4. *
  5. *
  6. * This file contains miscellaneous low-level functions.
  7. * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  8. *
  9. * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
  10. * and Paul Mackerras.
  11. * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
  12. * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version
  17. * 2 of the License, or (at your option) any later version.
  18. *
  19. */
  20. #include <linux/config.h>
  21. #include <linux/sys.h>
  22. #include <asm/unistd.h>
  23. #include <asm/errno.h>
  24. #include <asm/processor.h>
  25. #include <asm/page.h>
  26. #include <asm/cache.h>
  27. #include <asm/ppc_asm.h>
  28. #include <asm/asm-offsets.h>
  29. #include <asm/cputable.h>
  30. .text
  31. /*
  32. * Returns (address we were linked at) - (address we are running at)
  33. * for use before the text and data are mapped to KERNELBASE.
  34. */
  35. _GLOBAL(reloc_offset)
  36. mflr r0
  37. bl 1f
  38. 1: mflr r3
  39. LOADADDR(r4,1b)
  40. sub r3,r4,r3
  41. mtlr r0
  42. blr
  43. _GLOBAL(get_msr)
  44. mfmsr r3
  45. blr
  46. _GLOBAL(get_dar)
  47. mfdar r3
  48. blr
  49. _GLOBAL(get_srr0)
  50. mfsrr0 r3
  51. blr
  52. _GLOBAL(get_srr1)
  53. mfsrr1 r3
  54. blr
  55. _GLOBAL(get_sp)
  56. mr r3,r1
  57. blr
  58. #ifdef CONFIG_IRQSTACKS
  59. _GLOBAL(call_do_softirq)
  60. mflr r0
  61. std r0,16(r1)
  62. stdu r1,THREAD_SIZE-112(r3)
  63. mr r1,r3
  64. bl .__do_softirq
  65. ld r1,0(r1)
  66. ld r0,16(r1)
  67. mtlr r0
  68. blr
  69. _GLOBAL(call_handle_IRQ_event)
  70. mflr r0
  71. std r0,16(r1)
  72. stdu r1,THREAD_SIZE-112(r6)
  73. mr r1,r6
  74. bl .handle_IRQ_event
  75. ld r1,0(r1)
  76. ld r0,16(r1)
  77. mtlr r0
  78. blr
  79. #endif /* CONFIG_IRQSTACKS */
  80. /*
  81. * To be called by C code which needs to do some operations with MMU
  82. * disabled. Note that interrupts have to be disabled by the caller
  83. * prior to calling us. The code called _MUST_ be in the RMO of course
  84. * and part of the linear mapping as we don't attempt to translate the
  85. * stack pointer at all. The function is called with the stack switched
  86. * to this CPU emergency stack
  87. *
  88. * prototype is void *call_with_mmu_off(void *func, void *data);
  89. *
  90. * the called function is expected to be of the form
  91. *
  92. * void *called(void *data);
  93. */
  94. _GLOBAL(call_with_mmu_off)
  95. mflr r0 /* get link, save it on stackframe */
  96. std r0,16(r1)
  97. mr r1,r5 /* save old stack ptr */
  98. ld r1,PACAEMERGSP(r13) /* get emerg. stack */
  99. subi r1,r1,STACK_FRAME_OVERHEAD
  100. std r0,16(r1) /* save link on emerg. stack */
  101. std r5,0(r1) /* save old stack ptr in backchain */
  102. ld r3,0(r3) /* get to real function ptr (assume same TOC) */
  103. bl 2f /* we need LR to return, continue at label 2 */
  104. ld r0,16(r1) /* we return here from the call, get LR and */
  105. ld r1,0(r1) /* .. old stack ptr */
  106. mtspr SPRN_SRR0,r0 /* and get back to virtual mode with these */
  107. mfmsr r4
  108. ori r4,r4,MSR_IR|MSR_DR
  109. mtspr SPRN_SRR1,r4
  110. rfid
  111. 2: mtspr SPRN_SRR0,r3 /* coming from above, enter real mode */
  112. mr r3,r4 /* get parameter */
  113. mfmsr r0
  114. ori r0,r0,MSR_IR|MSR_DR
  115. xori r0,r0,MSR_IR|MSR_DR
  116. mtspr SPRN_SRR1,r0
  117. rfid
  118. .section ".toc","aw"
  119. PPC64_CACHES:
  120. .tc ppc64_caches[TC],ppc64_caches
  121. .section ".text"
  122. /*
  123. * Write any modified data cache blocks out to memory
  124. * and invalidate the corresponding instruction cache blocks.
  125. *
  126. * flush_icache_range(unsigned long start, unsigned long stop)
  127. *
  128. * flush all bytes from start through stop-1 inclusive
  129. */
  130. _KPROBE(__flush_icache_range)
  131. /*
  132. * Flush the data cache to memory
  133. *
  134. * Different systems have different cache line sizes
  135. * and in some cases i-cache and d-cache line sizes differ from
  136. * each other.
  137. */
  138. ld r10,PPC64_CACHES@toc(r2)
  139. lwz r7,DCACHEL1LINESIZE(r10)/* Get cache line size */
  140. addi r5,r7,-1
  141. andc r6,r3,r5 /* round low to line bdy */
  142. subf r8,r6,r4 /* compute length */
  143. add r8,r8,r5 /* ensure we get enough */
  144. lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of cache line size */
  145. srw. r8,r8,r9 /* compute line count */
  146. beqlr /* nothing to do? */
  147. mtctr r8
  148. 1: dcbst 0,r6
  149. add r6,r6,r7
  150. bdnz 1b
  151. sync
  152. /* Now invalidate the instruction cache */
  153. lwz r7,ICACHEL1LINESIZE(r10) /* Get Icache line size */
  154. addi r5,r7,-1
  155. andc r6,r3,r5 /* round low to line bdy */
  156. subf r8,r6,r4 /* compute length */
  157. add r8,r8,r5
  158. lwz r9,ICACHEL1LOGLINESIZE(r10) /* Get log-2 of Icache line size */
  159. srw. r8,r8,r9 /* compute line count */
  160. beqlr /* nothing to do? */
  161. mtctr r8
  162. 2: icbi 0,r6
  163. add r6,r6,r7
  164. bdnz 2b
  165. isync
  166. blr
  167. .previous .text
  168. /*
  169. * Like above, but only do the D-cache.
  170. *
  171. * flush_dcache_range(unsigned long start, unsigned long stop)
  172. *
  173. * flush all bytes from start to stop-1 inclusive
  174. */
  175. _GLOBAL(flush_dcache_range)
  176. /*
  177. * Flush the data cache to memory
  178. *
  179. * Different systems have different cache line sizes
  180. */
  181. ld r10,PPC64_CACHES@toc(r2)
  182. lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
  183. addi r5,r7,-1
  184. andc r6,r3,r5 /* round low to line bdy */
  185. subf r8,r6,r4 /* compute length */
  186. add r8,r8,r5 /* ensure we get enough */
  187. lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of dcache line size */
  188. srw. r8,r8,r9 /* compute line count */
  189. beqlr /* nothing to do? */
  190. mtctr r8
  191. 0: dcbst 0,r6
  192. add r6,r6,r7
  193. bdnz 0b
  194. sync
  195. blr
  196. /*
  197. * Like above, but works on non-mapped physical addresses.
  198. * Use only for non-LPAR setups ! It also assumes real mode
  199. * is cacheable. Used for flushing out the DART before using
  200. * it as uncacheable memory
  201. *
  202. * flush_dcache_phys_range(unsigned long start, unsigned long stop)
  203. *
  204. * flush all bytes from start to stop-1 inclusive
  205. */
  206. _GLOBAL(flush_dcache_phys_range)
  207. ld r10,PPC64_CACHES@toc(r2)
  208. lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
  209. addi r5,r7,-1
  210. andc r6,r3,r5 /* round low to line bdy */
  211. subf r8,r6,r4 /* compute length */
  212. add r8,r8,r5 /* ensure we get enough */
  213. lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of dcache line size */
  214. srw. r8,r8,r9 /* compute line count */
  215. beqlr /* nothing to do? */
  216. mfmsr r5 /* Disable MMU Data Relocation */
  217. ori r0,r5,MSR_DR
  218. xori r0,r0,MSR_DR
  219. sync
  220. mtmsr r0
  221. sync
  222. isync
  223. mtctr r8
  224. 0: dcbst 0,r6
  225. add r6,r6,r7
  226. bdnz 0b
  227. sync
  228. isync
  229. mtmsr r5 /* Re-enable MMU Data Relocation */
  230. sync
  231. isync
  232. blr
  233. _GLOBAL(flush_inval_dcache_range)
  234. ld r10,PPC64_CACHES@toc(r2)
  235. lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
  236. addi r5,r7,-1
  237. andc r6,r3,r5 /* round low to line bdy */
  238. subf r8,r6,r4 /* compute length */
  239. add r8,r8,r5 /* ensure we get enough */
  240. lwz r9,DCACHEL1LOGLINESIZE(r10)/* Get log-2 of dcache line size */
  241. srw. r8,r8,r9 /* compute line count */
  242. beqlr /* nothing to do? */
  243. sync
  244. isync
  245. mtctr r8
  246. 0: dcbf 0,r6
  247. add r6,r6,r7
  248. bdnz 0b
  249. sync
  250. isync
  251. blr
  252. /*
  253. * Flush a particular page from the data cache to RAM.
  254. * Note: this is necessary because the instruction cache does *not*
  255. * snoop from the data cache.
  256. *
  257. * void __flush_dcache_icache(void *page)
  258. */
  259. _GLOBAL(__flush_dcache_icache)
  260. /*
  261. * Flush the data cache to memory
  262. *
  263. * Different systems have different cache line sizes
  264. */
  265. /* Flush the dcache */
  266. ld r7,PPC64_CACHES@toc(r2)
  267. clrrdi r3,r3,PAGE_SHIFT /* Page align */
  268. lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */
  269. lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */
  270. mr r6,r3
  271. mtctr r4
  272. 0: dcbst 0,r6
  273. add r6,r6,r5
  274. bdnz 0b
  275. sync
  276. /* Now invalidate the icache */
  277. lwz r4,ICACHEL1LINESPERPAGE(r7) /* Get # icache lines per page */
  278. lwz r5,ICACHEL1LINESIZE(r7) /* Get icache line size */
  279. mtctr r4
  280. 1: icbi 0,r3
  281. add r3,r3,r5
  282. bdnz 1b
  283. isync
  284. blr
  285. /*
  286. * I/O string operations
  287. *
  288. * insb(port, buf, len)
  289. * outsb(port, buf, len)
  290. * insw(port, buf, len)
  291. * outsw(port, buf, len)
  292. * insl(port, buf, len)
  293. * outsl(port, buf, len)
  294. * insw_ns(port, buf, len)
  295. * outsw_ns(port, buf, len)
  296. * insl_ns(port, buf, len)
  297. * outsl_ns(port, buf, len)
  298. *
  299. * The *_ns versions don't do byte-swapping.
  300. */
  301. _GLOBAL(_insb)
  302. cmpwi 0,r5,0
  303. mtctr r5
  304. subi r4,r4,1
  305. blelr-
  306. 00: lbz r5,0(r3)
  307. eieio
  308. stbu r5,1(r4)
  309. bdnz 00b
  310. twi 0,r5,0
  311. isync
  312. blr
  313. _GLOBAL(_outsb)
  314. cmpwi 0,r5,0
  315. mtctr r5
  316. subi r4,r4,1
  317. blelr-
  318. 00: lbzu r5,1(r4)
  319. stb r5,0(r3)
  320. bdnz 00b
  321. sync
  322. blr
  323. _GLOBAL(_insw)
  324. cmpwi 0,r5,0
  325. mtctr r5
  326. subi r4,r4,2
  327. blelr-
  328. 00: lhbrx r5,0,r3
  329. eieio
  330. sthu r5,2(r4)
  331. bdnz 00b
  332. twi 0,r5,0
  333. isync
  334. blr
  335. _GLOBAL(_outsw)
  336. cmpwi 0,r5,0
  337. mtctr r5
  338. subi r4,r4,2
  339. blelr-
  340. 00: lhzu r5,2(r4)
  341. sthbrx r5,0,r3
  342. bdnz 00b
  343. sync
  344. blr
  345. _GLOBAL(_insl)
  346. cmpwi 0,r5,0
  347. mtctr r5
  348. subi r4,r4,4
  349. blelr-
  350. 00: lwbrx r5,0,r3
  351. eieio
  352. stwu r5,4(r4)
  353. bdnz 00b
  354. twi 0,r5,0
  355. isync
  356. blr
  357. _GLOBAL(_outsl)
  358. cmpwi 0,r5,0
  359. mtctr r5
  360. subi r4,r4,4
  361. blelr-
  362. 00: lwzu r5,4(r4)
  363. stwbrx r5,0,r3
  364. bdnz 00b
  365. sync
  366. blr
  367. /* _GLOBAL(ide_insw) now in drivers/ide/ide-iops.c */
  368. _GLOBAL(_insw_ns)
  369. cmpwi 0,r5,0
  370. mtctr r5
  371. subi r4,r4,2
  372. blelr-
  373. 00: lhz r5,0(r3)
  374. eieio
  375. sthu r5,2(r4)
  376. bdnz 00b
  377. twi 0,r5,0
  378. isync
  379. blr
  380. /* _GLOBAL(ide_outsw) now in drivers/ide/ide-iops.c */
  381. _GLOBAL(_outsw_ns)
  382. cmpwi 0,r5,0
  383. mtctr r5
  384. subi r4,r4,2
  385. blelr-
  386. 00: lhzu r5,2(r4)
  387. sth r5,0(r3)
  388. bdnz 00b
  389. sync
  390. blr
  391. _GLOBAL(_insl_ns)
  392. cmpwi 0,r5,0
  393. mtctr r5
  394. subi r4,r4,4
  395. blelr-
  396. 00: lwz r5,0(r3)
  397. eieio
  398. stwu r5,4(r4)
  399. bdnz 00b
  400. twi 0,r5,0
  401. isync
  402. blr
  403. _GLOBAL(_outsl_ns)
  404. cmpwi 0,r5,0
  405. mtctr r5
  406. subi r4,r4,4
  407. blelr-
  408. 00: lwzu r5,4(r4)
  409. stw r5,0(r3)
  410. bdnz 00b
  411. sync
  412. blr
  413. _GLOBAL(cvt_fd)
  414. lfd 0,0(r5) /* load up fpscr value */
  415. mtfsf 0xff,0
  416. lfs 0,0(r3)
  417. stfd 0,0(r4)
  418. mffs 0 /* save new fpscr value */
  419. stfd 0,0(r5)
  420. blr
  421. _GLOBAL(cvt_df)
  422. lfd 0,0(r5) /* load up fpscr value */
  423. mtfsf 0xff,0
  424. lfd 0,0(r3)
  425. stfs 0,0(r4)
  426. mffs 0 /* save new fpscr value */
  427. stfd 0,0(r5)
  428. blr
  429. /*
  430. * identify_cpu and calls setup_cpu
  431. * In: r3 = base of the cpu_specs array
  432. * r4 = address of cur_cpu_spec
  433. * r5 = relocation offset
  434. */
  435. _GLOBAL(identify_cpu)
  436. mfpvr r7
  437. 1:
  438. lwz r8,CPU_SPEC_PVR_MASK(r3)
  439. and r8,r8,r7
  440. lwz r9,CPU_SPEC_PVR_VALUE(r3)
  441. cmplw 0,r9,r8
  442. beq 1f
  443. addi r3,r3,CPU_SPEC_ENTRY_SIZE
  444. b 1b
  445. 1:
  446. add r0,r3,r5
  447. std r0,0(r4)
  448. ld r4,CPU_SPEC_SETUP(r3)
  449. sub r4,r4,r5
  450. ld r4,0(r4)
  451. sub r4,r4,r5
  452. mtctr r4
  453. /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */
  454. mr r4,r3
  455. mr r3,r5
  456. bctr
  457. /*
  458. * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
  459. * and writes nop's over sections of code that don't apply for this cpu.
  460. * r3 = data offset (not changed)
  461. */
  462. _GLOBAL(do_cpu_ftr_fixups)
  463. /* Get CPU 0 features */
  464. LOADADDR(r6,cur_cpu_spec)
  465. sub r6,r6,r3
  466. ld r4,0(r6)
  467. sub r4,r4,r3
  468. ld r4,CPU_SPEC_FEATURES(r4)
  469. /* Get the fixup table */
  470. LOADADDR(r6,__start___ftr_fixup)
  471. sub r6,r6,r3
  472. LOADADDR(r7,__stop___ftr_fixup)
  473. sub r7,r7,r3
  474. /* Do the fixup */
  475. 1: cmpld r6,r7
  476. bgelr
  477. addi r6,r6,32
  478. ld r8,-32(r6) /* mask */
  479. and r8,r8,r4
  480. ld r9,-24(r6) /* value */
  481. cmpld r8,r9
  482. beq 1b
  483. ld r8,-16(r6) /* section begin */
  484. ld r9,-8(r6) /* section end */
  485. subf. r9,r8,r9
  486. beq 1b
  487. /* write nops over the section of code */
  488. /* todo: if large section, add a branch at the start of it */
  489. srwi r9,r9,2
  490. mtctr r9
  491. sub r8,r8,r3
  492. lis r0,0x60000000@h /* nop */
  493. 3: stw r0,0(r8)
  494. andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
  495. beq 2f
  496. dcbst 0,r8 /* suboptimal, but simpler */
  497. sync
  498. icbi 0,r8
  499. 2: addi r8,r8,4
  500. bdnz 3b
  501. sync /* additional sync needed on g4 */
  502. isync
  503. b 1b
  504. #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
  505. /*
  506. * Do an IO access in real mode
  507. */
  508. _GLOBAL(real_readb)
  509. mfmsr r7
  510. ori r0,r7,MSR_DR
  511. xori r0,r0,MSR_DR
  512. sync
  513. mtmsrd r0
  514. sync
  515. isync
  516. mfspr r6,SPRN_HID4
  517. rldicl r5,r6,32,0
  518. ori r5,r5,0x100
  519. rldicl r5,r5,32,0
  520. sync
  521. mtspr SPRN_HID4,r5
  522. isync
  523. slbia
  524. isync
  525. lbz r3,0(r3)
  526. sync
  527. mtspr SPRN_HID4,r6
  528. isync
  529. slbia
  530. isync
  531. mtmsrd r7
  532. sync
  533. isync
  534. blr
  535. /*
  536. * Do an IO access in real mode
  537. */
  538. _GLOBAL(real_writeb)
  539. mfmsr r7
  540. ori r0,r7,MSR_DR
  541. xori r0,r0,MSR_DR
  542. sync
  543. mtmsrd r0
  544. sync
  545. isync
  546. mfspr r6,SPRN_HID4
  547. rldicl r5,r6,32,0
  548. ori r5,r5,0x100
  549. rldicl r5,r5,32,0
  550. sync
  551. mtspr SPRN_HID4,r5
  552. isync
  553. slbia
  554. isync
  555. stb r3,0(r4)
  556. sync
  557. mtspr SPRN_HID4,r6
  558. isync
  559. slbia
  560. isync
  561. mtmsrd r7
  562. sync
  563. isync
  564. blr
  565. #endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
  566. /*
  567. * Create a kernel thread
  568. * kernel_thread(fn, arg, flags)
  569. */
  570. _GLOBAL(kernel_thread)
  571. std r29,-24(r1)
  572. std r30,-16(r1)
  573. stdu r1,-STACK_FRAME_OVERHEAD(r1)
  574. mr r29,r3
  575. mr r30,r4
  576. ori r3,r5,CLONE_VM /* flags */
  577. oris r3,r3,(CLONE_UNTRACED>>16)
  578. li r4,0 /* new sp (unused) */
  579. li r0,__NR_clone
  580. sc
  581. cmpdi 0,r3,0 /* parent or child? */
  582. bne 1f /* return if parent */
  583. li r0,0
  584. stdu r0,-STACK_FRAME_OVERHEAD(r1)
  585. ld r2,8(r29)
  586. ld r29,0(r29)
  587. mtlr r29 /* fn addr in lr */
  588. mr r3,r30 /* load arg and call fn */
  589. blrl
  590. li r0,__NR_exit /* exit after child exits */
  591. li r3,0
  592. sc
  593. 1: addi r1,r1,STACK_FRAME_OVERHEAD
  594. ld r29,-24(r1)
  595. ld r30,-16(r1)
  596. blr
  597. /*
  598. * disable_kernel_fp()
  599. * Disable the FPU.
  600. */
  601. _GLOBAL(disable_kernel_fp)
  602. mfmsr r3
  603. rldicl r0,r3,(63-MSR_FP_LG),1
  604. rldicl r3,r0,(MSR_FP_LG+1),0
  605. mtmsrd r3 /* disable use of fpu now */
  606. isync
  607. blr
  608. /*
  609. * giveup_fpu(tsk)
  610. * Disable FP for the task given as the argument,
  611. * and save the floating-point registers in its thread_struct.
  612. * Enables the FPU for use in the kernel on return.
  613. */
  614. _GLOBAL(giveup_fpu)
  615. mfmsr r5
  616. ori r5,r5,MSR_FP
  617. mtmsrd r5 /* enable use of fpu now */
  618. isync
  619. cmpdi 0,r3,0
  620. beqlr- /* if no previous owner, done */
  621. addi r3,r3,THREAD /* want THREAD of task */
  622. ld r5,PT_REGS(r3)
  623. cmpdi 0,r5,0
  624. SAVE_32FPRS(0, r3)
  625. mffs fr0
  626. stfd fr0,THREAD_FPSCR(r3)
  627. beq 1f
  628. ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  629. li r3,MSR_FP|MSR_FE0|MSR_FE1
  630. andc r4,r4,r3 /* disable FP for previous task */
  631. std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  632. 1:
  633. #ifndef CONFIG_SMP
  634. li r5,0
  635. ld r4,last_task_used_math@got(r2)
  636. std r5,0(r4)
  637. #endif /* CONFIG_SMP */
  638. blr
  639. #ifdef CONFIG_ALTIVEC
  640. #if 0 /* this has no callers for now */
  641. /*
  642. * disable_kernel_altivec()
  643. * Disable the VMX.
  644. */
  645. _GLOBAL(disable_kernel_altivec)
  646. mfmsr r3
  647. rldicl r0,r3,(63-MSR_VEC_LG),1
  648. rldicl r3,r0,(MSR_VEC_LG+1),0
  649. mtmsrd r3 /* disable use of VMX now */
  650. isync
  651. blr
  652. #endif /* 0 */
  653. /*
  654. * giveup_altivec(tsk)
  655. * Disable VMX for the task given as the argument,
  656. * and save the vector registers in its thread_struct.
  657. * Enables the VMX for use in the kernel on return.
  658. */
  659. _GLOBAL(giveup_altivec)
  660. mfmsr r5
  661. oris r5,r5,MSR_VEC@h
  662. mtmsrd r5 /* enable use of VMX now */
  663. isync
  664. cmpdi 0,r3,0
  665. beqlr- /* if no previous owner, done */
  666. addi r3,r3,THREAD /* want THREAD of task */
  667. ld r5,PT_REGS(r3)
  668. cmpdi 0,r5,0
  669. SAVE_32VRS(0,r4,r3)
  670. mfvscr vr0
  671. li r4,THREAD_VSCR
  672. stvx vr0,r4,r3
  673. beq 1f
  674. ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  675. lis r3,MSR_VEC@h
  676. andc r4,r4,r3 /* disable FP for previous task */
  677. std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
  678. 1:
  679. #ifndef CONFIG_SMP
  680. li r5,0
  681. ld r4,last_task_used_altivec@got(r2)
  682. std r5,0(r4)
  683. #endif /* CONFIG_SMP */
  684. blr
  685. #endif /* CONFIG_ALTIVEC */
  686. _GLOBAL(__setup_cpu_power3)
  687. blr
  688. /* kexec_wait(phys_cpu)
  689. *
  690. * wait for the flag to change, indicating this kernel is going away but
  691. * the slave code for the next one is at addresses 0 to 100.
  692. *
  693. * This is used by all slaves.
  694. *
  695. * Physical (hardware) cpu id should be in r3.
  696. */
  697. _GLOBAL(kexec_wait)
  698. bl 1f
  699. 1: mflr r5
  700. addi r5,r5,kexec_flag-1b
  701. 99: HMT_LOW
  702. #ifdef CONFIG_KEXEC /* use no memory without kexec */
  703. lwz r4,0(r5)
  704. cmpwi 0,r4,0
  705. bnea 0x60
  706. #endif
  707. b 99b
  708. /* this can be in text because we won't change it until we are
  709. * running in real anyways
  710. */
  711. kexec_flag:
  712. .long 0
  713. #ifdef CONFIG_KEXEC
  714. /* kexec_smp_wait(void)
  715. *
  716. * call with interrupts off
  717. * note: this is a terminal routine, it does not save lr
  718. *
  719. * get phys id from paca
  720. * set paca id to -1 to say we got here
  721. * switch to real mode
  722. * join other cpus in kexec_wait(phys_id)
  723. */
  724. _GLOBAL(kexec_smp_wait)
  725. lhz r3,PACAHWCPUID(r13)
  726. li r4,-1
  727. sth r4,PACAHWCPUID(r13) /* let others know we left */
  728. bl real_mode
  729. b .kexec_wait
  730. /*
  731. * switch to real mode (turn mmu off)
  732. * we use the early kernel trick that the hardware ignores bits
  733. * 0 and 1 (big endian) of the effective address in real mode
  734. *
  735. * don't overwrite r3 here, it is live for kexec_wait above.
  736. */
  737. real_mode: /* assume normal blr return */
  738. 1: li r9,MSR_RI
  739. li r10,MSR_DR|MSR_IR
  740. mflr r11 /* return address to SRR0 */
  741. mfmsr r12
  742. andc r9,r12,r9
  743. andc r10,r12,r10
  744. mtmsrd r9,1
  745. mtspr SPRN_SRR1,r10
  746. mtspr SPRN_SRR0,r11
  747. rfid
  748. /*
  749. * kexec_sequence(newstack, start, image, control, clear_all())
  750. *
  751. * does the grungy work with stack switching and real mode switches
  752. * also does simple calls to other code
  753. */
  754. _GLOBAL(kexec_sequence)
  755. mflr r0
  756. std r0,16(r1)
  757. /* switch stacks to newstack -- &kexec_stack.stack */
  758. stdu r1,THREAD_SIZE-112(r3)
  759. mr r1,r3
  760. li r0,0
  761. std r0,16(r1)
  762. /* save regs for local vars on new stack.
  763. * yes, we won't go back, but ...
  764. */
  765. std r31,-8(r1)
  766. std r30,-16(r1)
  767. std r29,-24(r1)
  768. std r28,-32(r1)
  769. std r27,-40(r1)
  770. std r26,-48(r1)
  771. std r25,-56(r1)
  772. stdu r1,-112-64(r1)
  773. /* save args into preserved regs */
  774. mr r31,r3 /* newstack (both) */
  775. mr r30,r4 /* start (real) */
  776. mr r29,r5 /* image (virt) */
  777. mr r28,r6 /* control, unused */
  778. mr r27,r7 /* clear_all() fn desc */
  779. mr r26,r8 /* spare */
  780. lhz r25,PACAHWCPUID(r13) /* get our phys cpu from paca */
  781. /* disable interrupts, we are overwriting kernel data next */
  782. mfmsr r3
  783. rlwinm r3,r3,0,17,15
  784. mtmsrd r3,1
  785. /* copy dest pages, flush whole dest image */
  786. mr r3,r29
  787. bl .kexec_copy_flush /* (image) */
  788. /* turn off mmu */
  789. bl real_mode
  790. /* clear out hardware hash page table and tlb */
  791. ld r5,0(r27) /* deref function descriptor */
  792. mtctr r5
  793. bctrl /* ppc_md.hash_clear_all(void); */
  794. /*
  795. * kexec image calling is:
  796. * the first 0x100 bytes of the entry point are copied to 0
  797. *
  798. * all slaves branch to slave = 0x60 (absolute)
  799. * slave(phys_cpu_id);
  800. *
  801. * master goes to start = entry point
  802. * start(phys_cpu_id, start, 0);
  803. *
  804. *
  805. * a wrapper is needed to call existing kernels, here is an approximate
  806. * description of one method:
  807. *
  808. * v2: (2.6.10)
  809. * start will be near the boot_block (maybe 0x100 bytes before it?)
  810. * it will have a 0x60, which will b to boot_block, where it will wait
  811. * and 0 will store phys into struct boot-block and load r3 from there,
  812. * copy kernel 0-0x100 and tell slaves to back down to 0x60 again
  813. *
  814. * v1: (2.6.9)
  815. * boot block will have all cpus scanning device tree to see if they
  816. * are the boot cpu ?????
  817. * other device tree differences (prop sizes, va vs pa, etc)...
  818. */
  819. /* copy 0x100 bytes starting at start to 0 */
  820. li r3,0
  821. mr r4,r30
  822. li r5,0x100
  823. li r6,0
  824. bl .copy_and_flush /* (dest, src, copy limit, start offset) */
  825. 1: /* assume normal blr return */
  826. /* release other cpus to the new kernel secondary start at 0x60 */
  827. mflr r5
  828. li r6,1
  829. stw r6,kexec_flag-1b(5)
  830. mr r3,r25 # my phys cpu
  831. mr r4,r30 # start, aka phys mem offset
  832. mtlr 4
  833. li r5,0
  834. blr /* image->start(physid, image->start, 0); */
  835. #endif /* CONFIG_KEXEC */
  836. /* Why isn't this a) automatic, b) written in 'C'? */
  837. .balign 8
  838. _GLOBAL(sys_call_table32)
  839. .llong .sys_restart_syscall /* 0 */
  840. .llong .sys_exit
  841. .llong .ppc_fork
  842. .llong .sys_read
  843. .llong .sys_write
  844. .llong .compat_sys_open /* 5 */
  845. .llong .sys_close
  846. .llong .sys32_waitpid
  847. .llong .sys32_creat
  848. .llong .sys_link
  849. .llong .sys_unlink /* 10 */
  850. .llong .sys32_execve
  851. .llong .sys_chdir
  852. .llong .compat_sys_time
  853. .llong .sys_mknod
  854. .llong .sys_chmod /* 15 */
  855. .llong .sys_lchown
  856. .llong .sys_ni_syscall /* old break syscall */
  857. .llong .sys_ni_syscall /* old stat syscall */
  858. .llong .ppc32_lseek
  859. .llong .sys_getpid /* 20 */
  860. .llong .compat_sys_mount
  861. .llong .sys_oldumount
  862. .llong .sys_setuid
  863. .llong .sys_getuid
  864. .llong .compat_sys_stime /* 25 */
  865. .llong .sys32_ptrace
  866. .llong .sys_alarm
  867. .llong .sys_ni_syscall /* old fstat syscall */
  868. .llong .sys32_pause
  869. .llong .compat_sys_utime /* 30 */
  870. .llong .sys_ni_syscall /* old stty syscall */
  871. .llong .sys_ni_syscall /* old gtty syscall */
  872. .llong .sys32_access
  873. .llong .sys32_nice
  874. .llong .sys_ni_syscall /* 35 - old ftime syscall */
  875. .llong .sys_sync
  876. .llong .sys32_kill
  877. .llong .sys_rename
  878. .llong .sys32_mkdir
  879. .llong .sys_rmdir /* 40 */
  880. .llong .sys_dup
  881. .llong .sys_pipe
  882. .llong .compat_sys_times
  883. .llong .sys_ni_syscall /* old prof syscall */
  884. .llong .sys_brk /* 45 */
  885. .llong .sys_setgid
  886. .llong .sys_getgid
  887. .llong .sys_signal
  888. .llong .sys_geteuid
  889. .llong .sys_getegid /* 50 */
  890. .llong .sys_acct
  891. .llong .sys_umount
  892. .llong .sys_ni_syscall /* old lock syscall */
  893. .llong .compat_sys_ioctl
  894. .llong .compat_sys_fcntl /* 55 */
  895. .llong .sys_ni_syscall /* old mpx syscall */
  896. .llong .sys32_setpgid
  897. .llong .sys_ni_syscall /* old ulimit syscall */
  898. .llong .sys32_olduname
  899. .llong .sys32_umask /* 60 */
  900. .llong .sys_chroot
  901. .llong .sys_ustat
  902. .llong .sys_dup2
  903. .llong .sys_getppid
  904. .llong .sys_getpgrp /* 65 */
  905. .llong .sys_setsid
  906. .llong .sys32_sigaction
  907. .llong .sys_sgetmask
  908. .llong .sys32_ssetmask
  909. .llong .sys_setreuid /* 70 */
  910. .llong .sys_setregid
  911. .llong .ppc32_sigsuspend
  912. .llong .compat_sys_sigpending
  913. .llong .sys32_sethostname
  914. .llong .compat_sys_setrlimit /* 75 */
  915. .llong .compat_sys_old_getrlimit
  916. .llong .compat_sys_getrusage
  917. .llong .sys32_gettimeofday
  918. .llong .sys32_settimeofday
  919. .llong .sys32_getgroups /* 80 */
  920. .llong .sys32_setgroups
  921. .llong .sys_ni_syscall /* old select syscall */
  922. .llong .sys_symlink
  923. .llong .sys_ni_syscall /* old lstat syscall */
  924. .llong .sys32_readlink /* 85 */
  925. .llong .sys_uselib
  926. .llong .sys_swapon
  927. .llong .sys_reboot
  928. .llong .old32_readdir
  929. .llong .sys_mmap /* 90 */
  930. .llong .sys_munmap
  931. .llong .sys_truncate
  932. .llong .sys_ftruncate
  933. .llong .sys_fchmod
  934. .llong .sys_fchown /* 95 */
  935. .llong .sys32_getpriority
  936. .llong .sys32_setpriority
  937. .llong .sys_ni_syscall /* old profil syscall */
  938. .llong .compat_sys_statfs
  939. .llong .compat_sys_fstatfs /* 100 */
  940. .llong .sys_ni_syscall /* old ioperm syscall */
  941. .llong .compat_sys_socketcall
  942. .llong .sys32_syslog
  943. .llong .compat_sys_setitimer
  944. .llong .compat_sys_getitimer /* 105 */
  945. .llong .compat_sys_newstat
  946. .llong .compat_sys_newlstat
  947. .llong .compat_sys_newfstat
  948. .llong .sys32_uname
  949. .llong .sys_ni_syscall /* 110 old iopl syscall */
  950. .llong .sys_vhangup
  951. .llong .sys_ni_syscall /* old idle syscall */
  952. .llong .sys_ni_syscall /* old vm86 syscall */
  953. .llong .compat_sys_wait4
  954. .llong .sys_swapoff /* 115 */
  955. .llong .sys32_sysinfo
  956. .llong .sys32_ipc
  957. .llong .sys_fsync
  958. .llong .ppc32_sigreturn
  959. .llong .ppc_clone /* 120 */
  960. .llong .sys32_setdomainname
  961. .llong .ppc64_newuname
  962. .llong .sys_ni_syscall /* old modify_ldt syscall */
  963. .llong .sys32_adjtimex
  964. .llong .sys_mprotect /* 125 */
  965. .llong .compat_sys_sigprocmask
  966. .llong .sys_ni_syscall /* old create_module syscall */
  967. .llong .sys_init_module
  968. .llong .sys_delete_module
  969. .llong .sys_ni_syscall /* 130 old get_kernel_syms syscall */
  970. .llong .sys_quotactl
  971. .llong .sys32_getpgid
  972. .llong .sys_fchdir
  973. .llong .sys_bdflush
  974. .llong .sys32_sysfs /* 135 */
  975. .llong .ppc64_personality
  976. .llong .sys_ni_syscall /* for afs_syscall */
  977. .llong .sys_setfsuid
  978. .llong .sys_setfsgid
  979. .llong .sys_llseek /* 140 */
  980. .llong .sys32_getdents
  981. .llong .ppc32_select
  982. .llong .sys_flock
  983. .llong .sys_msync
  984. .llong .compat_sys_readv /* 145 */
  985. .llong .compat_sys_writev
  986. .llong .sys32_getsid
  987. .llong .sys_fdatasync
  988. .llong .sys32_sysctl
  989. .llong .sys_mlock /* 150 */
  990. .llong .sys_munlock
  991. .llong .sys_mlockall
  992. .llong .sys_munlockall
  993. .llong .sys32_sched_setparam
  994. .llong .sys32_sched_getparam /* 155 */
  995. .llong .sys32_sched_setscheduler
  996. .llong .sys32_sched_getscheduler
  997. .llong .sys_sched_yield
  998. .llong .sys32_sched_get_priority_max
  999. .llong .sys32_sched_get_priority_min /* 160 */
  1000. .llong .sys32_sched_rr_get_interval
  1001. .llong .compat_sys_nanosleep
  1002. .llong .sys_mremap
  1003. .llong .sys_setresuid
  1004. .llong .sys_getresuid /* 165 */
  1005. .llong .sys_ni_syscall /* old query_module syscall */
  1006. .llong .sys_poll
  1007. .llong .compat_sys_nfsservctl
  1008. .llong .sys_setresgid
  1009. .llong .sys_getresgid /* 170 */
  1010. .llong .sys32_prctl
  1011. .llong .ppc32_rt_sigreturn
  1012. .llong .sys32_rt_sigaction
  1013. .llong .sys32_rt_sigprocmask
  1014. .llong .sys32_rt_sigpending /* 175 */
  1015. .llong .compat_sys_rt_sigtimedwait
  1016. .llong .sys32_rt_sigqueueinfo
  1017. .llong .ppc32_rt_sigsuspend
  1018. .llong .sys32_pread64
  1019. .llong .sys32_pwrite64 /* 180 */
  1020. .llong .sys_chown
  1021. .llong .sys_getcwd
  1022. .llong .sys_capget
  1023. .llong .sys_capset
  1024. .llong .sys32_sigaltstack /* 185 */
  1025. .llong .sys32_sendfile
  1026. .llong .sys_ni_syscall /* reserved for streams1 */
  1027. .llong .sys_ni_syscall /* reserved for streams2 */
  1028. .llong .ppc_vfork
  1029. .llong .compat_sys_getrlimit /* 190 */
  1030. .llong .sys32_readahead
  1031. .llong .sys32_mmap2
  1032. .llong .sys32_truncate64
  1033. .llong .sys32_ftruncate64
  1034. .llong .sys_stat64 /* 195 */
  1035. .llong .sys_lstat64
  1036. .llong .sys_fstat64
  1037. .llong .sys32_pciconfig_read
  1038. .llong .sys32_pciconfig_write
  1039. .llong .sys32_pciconfig_iobase /* 200 - pciconfig_iobase */
  1040. .llong .sys_ni_syscall /* reserved for MacOnLinux */
  1041. .llong .sys_getdents64
  1042. .llong .sys_pivot_root
  1043. .llong .compat_sys_fcntl64
  1044. .llong .sys_madvise /* 205 */
  1045. .llong .sys_mincore
  1046. .llong .sys_gettid
  1047. .llong .sys_tkill
  1048. .llong .sys_setxattr
  1049. .llong .sys_lsetxattr /* 210 */
  1050. .llong .sys_fsetxattr
  1051. .llong .sys_getxattr
  1052. .llong .sys_lgetxattr
  1053. .llong .sys_fgetxattr
  1054. .llong .sys_listxattr /* 215 */
  1055. .llong .sys_llistxattr
  1056. .llong .sys_flistxattr
  1057. .llong .sys_removexattr
  1058. .llong .sys_lremovexattr
  1059. .llong .sys_fremovexattr /* 220 */
  1060. .llong .compat_sys_futex
  1061. .llong .compat_sys_sched_setaffinity
  1062. .llong .compat_sys_sched_getaffinity
  1063. .llong .sys_ni_syscall
  1064. .llong .sys_ni_syscall /* 225 - reserved for tux */
  1065. .llong .sys32_sendfile64
  1066. .llong .compat_sys_io_setup
  1067. .llong .sys_io_destroy
  1068. .llong .compat_sys_io_getevents
  1069. .llong .compat_sys_io_submit
  1070. .llong .sys_io_cancel
  1071. .llong .sys_set_tid_address
  1072. .llong .ppc32_fadvise64
  1073. .llong .sys_exit_group
  1074. .llong .ppc32_lookup_dcookie /* 235 */
  1075. .llong .sys_epoll_create
  1076. .llong .sys_epoll_ctl
  1077. .llong .sys_epoll_wait
  1078. .llong .sys_remap_file_pages
  1079. .llong .ppc32_timer_create /* 240 */
  1080. .llong .compat_sys_timer_settime
  1081. .llong .compat_sys_timer_gettime
  1082. .llong .sys_timer_getoverrun
  1083. .llong .sys_timer_delete
  1084. .llong .compat_sys_clock_settime /* 245 */
  1085. .llong .compat_sys_clock_gettime
  1086. .llong .compat_sys_clock_getres
  1087. .llong .compat_sys_clock_nanosleep
  1088. .llong .ppc32_swapcontext
  1089. .llong .sys32_tgkill /* 250 */
  1090. .llong .sys32_utimes
  1091. .llong .compat_sys_statfs64
  1092. .llong .compat_sys_fstatfs64
  1093. .llong .ppc32_fadvise64_64 /* 32bit only fadvise64_64 */
  1094. .llong .ppc_rtas /* 255 */
  1095. .llong .sys_ni_syscall /* 256 reserved for sys_debug_setcontext */
  1096. .llong .sys_ni_syscall /* 257 reserved for vserver */
  1097. .llong .sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */
  1098. .llong .compat_sys_mbind
  1099. .llong .compat_sys_get_mempolicy /* 260 */
  1100. .llong .compat_sys_set_mempolicy
  1101. .llong .compat_sys_mq_open
  1102. .llong .sys_mq_unlink
  1103. .llong .compat_sys_mq_timedsend
  1104. .llong .compat_sys_mq_timedreceive /* 265 */
  1105. .llong .compat_sys_mq_notify
  1106. .llong .compat_sys_mq_getsetattr
  1107. .llong .compat_sys_kexec_load
  1108. .llong .sys32_add_key
  1109. .llong .sys32_request_key /* 270 */
  1110. .llong .compat_sys_keyctl
  1111. .llong .compat_sys_waitid
  1112. .llong .sys32_ioprio_set
  1113. .llong .sys32_ioprio_get
  1114. .llong .sys_inotify_init /* 275 */
  1115. .llong .sys_inotify_add_watch
  1116. .llong .sys_inotify_rm_watch
  1117. .balign 8
  1118. _GLOBAL(sys_call_table)
  1119. .llong .sys_restart_syscall /* 0 */
  1120. .llong .sys_exit
  1121. .llong .ppc_fork
  1122. .llong .sys_read
  1123. .llong .sys_write
  1124. .llong .sys_open /* 5 */
  1125. .llong .sys_close
  1126. .llong .sys_waitpid
  1127. .llong .sys_creat
  1128. .llong .sys_link
  1129. .llong .sys_unlink /* 10 */
  1130. .llong .sys_execve
  1131. .llong .sys_chdir
  1132. .llong .sys64_time
  1133. .llong .sys_mknod
  1134. .llong .sys_chmod /* 15 */
  1135. .llong .sys_lchown
  1136. .llong .sys_ni_syscall /* old break syscall */
  1137. .llong .sys_ni_syscall /* old stat syscall */
  1138. .llong .sys_lseek
  1139. .llong .sys_getpid /* 20 */
  1140. .llong .sys_mount
  1141. .llong .sys_ni_syscall /* old umount syscall */
  1142. .llong .sys_setuid
  1143. .llong .sys_getuid
  1144. .llong .sys_stime /* 25 */
  1145. .llong .sys_ptrace
  1146. .llong .sys_alarm
  1147. .llong .sys_ni_syscall /* old fstat syscall */
  1148. .llong .sys_pause
  1149. .llong .sys_utime /* 30 */
  1150. .llong .sys_ni_syscall /* old stty syscall */
  1151. .llong .sys_ni_syscall /* old gtty syscall */
  1152. .llong .sys_access
  1153. .llong .sys_nice
  1154. .llong .sys_ni_syscall /* 35 - old ftime syscall */
  1155. .llong .sys_sync
  1156. .llong .sys_kill
  1157. .llong .sys_rename
  1158. .llong .sys_mkdir
  1159. .llong .sys_rmdir /* 40 */
  1160. .llong .sys_dup
  1161. .llong .sys_pipe
  1162. .llong .sys_times
  1163. .llong .sys_ni_syscall /* old prof syscall */
  1164. .llong .sys_brk /* 45 */
  1165. .llong .sys_setgid
  1166. .llong .sys_getgid
  1167. .llong .sys_signal
  1168. .llong .sys_geteuid
  1169. .llong .sys_getegid /* 50 */
  1170. .llong .sys_acct
  1171. .llong .sys_umount
  1172. .llong .sys_ni_syscall /* old lock syscall */
  1173. .llong .sys_ioctl
  1174. .llong .sys_fcntl /* 55 */
  1175. .llong .sys_ni_syscall /* old mpx syscall */
  1176. .llong .sys_setpgid
  1177. .llong .sys_ni_syscall /* old ulimit syscall */
  1178. .llong .sys_ni_syscall /* old uname syscall */
  1179. .llong .sys_umask /* 60 */
  1180. .llong .sys_chroot
  1181. .llong .sys_ustat
  1182. .llong .sys_dup2
  1183. .llong .sys_getppid
  1184. .llong .sys_getpgrp /* 65 */
  1185. .llong .sys_setsid
  1186. .llong .sys_ni_syscall
  1187. .llong .sys_sgetmask
  1188. .llong .sys_ssetmask
  1189. .llong .sys_setreuid /* 70 */
  1190. .llong .sys_setregid
  1191. .llong .sys_ni_syscall
  1192. .llong .sys_ni_syscall
  1193. .llong .sys_sethostname
  1194. .llong .sys_setrlimit /* 75 */
  1195. .llong .sys_ni_syscall /* old getrlimit syscall */
  1196. .llong .sys_getrusage
  1197. .llong .sys_gettimeofday
  1198. .llong .sys_settimeofday
  1199. .llong .sys_getgroups /* 80 */
  1200. .llong .sys_setgroups
  1201. .llong .sys_ni_syscall /* old select syscall */
  1202. .llong .sys_symlink
  1203. .llong .sys_ni_syscall /* old lstat syscall */
  1204. .llong .sys_readlink /* 85 */
  1205. .llong .sys_uselib
  1206. .llong .sys_swapon
  1207. .llong .sys_reboot
  1208. .llong .sys_ni_syscall /* old readdir syscall */
  1209. .llong .sys_mmap /* 90 */
  1210. .llong .sys_munmap
  1211. .llong .sys_truncate
  1212. .llong .sys_ftruncate
  1213. .llong .sys_fchmod
  1214. .llong .sys_fchown /* 95 */
  1215. .llong .sys_getpriority
  1216. .llong .sys_setpriority
  1217. .llong .sys_ni_syscall /* old profil syscall holder */
  1218. .llong .sys_statfs
  1219. .llong .sys_fstatfs /* 100 */
  1220. .llong .sys_ni_syscall /* old ioperm syscall */
  1221. .llong .sys_socketcall
  1222. .llong .sys_syslog
  1223. .llong .sys_setitimer
  1224. .llong .sys_getitimer /* 105 */
  1225. .llong .sys_newstat
  1226. .llong .sys_newlstat
  1227. .llong .sys_newfstat
  1228. .llong .sys_ni_syscall /* old uname syscall */
  1229. .llong .sys_ni_syscall /* 110 old iopl syscall */
  1230. .llong .sys_vhangup
  1231. .llong .sys_ni_syscall /* old idle syscall */
  1232. .llong .sys_ni_syscall /* old vm86 syscall */
  1233. .llong .sys_wait4
  1234. .llong .sys_swapoff /* 115 */
  1235. .llong .sys_sysinfo
  1236. .llong .sys_ipc
  1237. .llong .sys_fsync
  1238. .llong .sys_ni_syscall
  1239. .llong .ppc_clone /* 120 */
  1240. .llong .sys_setdomainname
  1241. .llong .ppc64_newuname
  1242. .llong .sys_ni_syscall /* old modify_ldt syscall */
  1243. .llong .sys_adjtimex
  1244. .llong .sys_mprotect /* 125 */
  1245. .llong .sys_ni_syscall
  1246. .llong .sys_ni_syscall /* old create_module syscall */
  1247. .llong .sys_init_module
  1248. .llong .sys_delete_module
  1249. .llong .sys_ni_syscall /* 130 old get_kernel_syms syscall */
  1250. .llong .sys_quotactl
  1251. .llong .sys_getpgid
  1252. .llong .sys_fchdir
  1253. .llong .sys_bdflush
  1254. .llong .sys_sysfs /* 135 */
  1255. .llong .ppc64_personality
  1256. .llong .sys_ni_syscall /* for afs_syscall */
  1257. .llong .sys_setfsuid
  1258. .llong .sys_setfsgid
  1259. .llong .sys_llseek /* 140 */
  1260. .llong .sys_getdents
  1261. .llong .sys_select
  1262. .llong .sys_flock
  1263. .llong .sys_msync
  1264. .llong .sys_readv /* 145 */
  1265. .llong .sys_writev
  1266. .llong .sys_getsid
  1267. .llong .sys_fdatasync
  1268. .llong .sys_sysctl
  1269. .llong .sys_mlock /* 150 */
  1270. .llong .sys_munlock
  1271. .llong .sys_mlockall
  1272. .llong .sys_munlockall
  1273. .llong .sys_sched_setparam
  1274. .llong .sys_sched_getparam /* 155 */
  1275. .llong .sys_sched_setscheduler
  1276. .llong .sys_sched_getscheduler
  1277. .llong .sys_sched_yield
  1278. .llong .sys_sched_get_priority_max
  1279. .llong .sys_sched_get_priority_min /* 160 */
  1280. .llong .sys_sched_rr_get_interval
  1281. .llong .sys_nanosleep
  1282. .llong .sys_mremap
  1283. .llong .sys_setresuid
  1284. .llong .sys_getresuid /* 165 */
  1285. .llong .sys_ni_syscall /* old query_module syscall */
  1286. .llong .sys_poll
  1287. .llong .sys_nfsservctl
  1288. .llong .sys_setresgid
  1289. .llong .sys_getresgid /* 170 */
  1290. .llong .sys_prctl
  1291. .llong .ppc64_rt_sigreturn
  1292. .llong .sys_rt_sigaction
  1293. .llong .sys_rt_sigprocmask
  1294. .llong .sys_rt_sigpending /* 175 */
  1295. .llong .sys_rt_sigtimedwait
  1296. .llong .sys_rt_sigqueueinfo
  1297. .llong .ppc64_rt_sigsuspend
  1298. .llong .sys_pread64
  1299. .llong .sys_pwrite64 /* 180 */
  1300. .llong .sys_chown
  1301. .llong .sys_getcwd
  1302. .llong .sys_capget
  1303. .llong .sys_capset
  1304. .llong .sys_sigaltstack /* 185 */
  1305. .llong .sys_sendfile64
  1306. .llong .sys_ni_syscall /* reserved for streams1 */
  1307. .llong .sys_ni_syscall /* reserved for streams2 */
  1308. .llong .ppc_vfork
  1309. .llong .sys_getrlimit /* 190 */
  1310. .llong .sys_readahead
  1311. .llong .sys_ni_syscall /* 32bit only mmap2 */
  1312. .llong .sys_ni_syscall /* 32bit only truncate64 */
  1313. .llong .sys_ni_syscall /* 32bit only ftruncate64 */
  1314. .llong .sys_ni_syscall /* 195 - 32bit only stat64 */
  1315. .llong .sys_ni_syscall /* 32bit only lstat64 */
  1316. .llong .sys_ni_syscall /* 32bit only fstat64 */
  1317. .llong .sys_pciconfig_read
  1318. .llong .sys_pciconfig_write
  1319. .llong .sys_pciconfig_iobase /* 200 - pciconfig_iobase */
  1320. .llong .sys_ni_syscall /* reserved for MacOnLinux */
  1321. .llong .sys_getdents64
  1322. .llong .sys_pivot_root
  1323. .llong .sys_ni_syscall /* 32bit only fcntl64 */
  1324. .llong .sys_madvise /* 205 */
  1325. .llong .sys_mincore
  1326. .llong .sys_gettid
  1327. .llong .sys_tkill
  1328. .llong .sys_setxattr
  1329. .llong .sys_lsetxattr /* 210 */
  1330. .llong .sys_fsetxattr
  1331. .llong .sys_getxattr
  1332. .llong .sys_lgetxattr
  1333. .llong .sys_fgetxattr
  1334. .llong .sys_listxattr /* 215 */
  1335. .llong .sys_llistxattr
  1336. .llong .sys_flistxattr
  1337. .llong .sys_removexattr
  1338. .llong .sys_lremovexattr
  1339. .llong .sys_fremovexattr /* 220 */
  1340. .llong .sys_futex
  1341. .llong .sys_sched_setaffinity
  1342. .llong .sys_sched_getaffinity
  1343. .llong .sys_ni_syscall
  1344. .llong .sys_ni_syscall /* 225 - reserved for tux */
  1345. .llong .sys_ni_syscall /* 32bit only sendfile64 */
  1346. .llong .sys_io_setup
  1347. .llong .sys_io_destroy
  1348. .llong .sys_io_getevents
  1349. .llong .sys_io_submit /* 230 */
  1350. .llong .sys_io_cancel
  1351. .llong .sys_set_tid_address
  1352. .llong .sys_fadvise64
  1353. .llong .sys_exit_group
  1354. .llong .sys_lookup_dcookie /* 235 */
  1355. .llong .sys_epoll_create
  1356. .llong .sys_epoll_ctl
  1357. .llong .sys_epoll_wait
  1358. .llong .sys_remap_file_pages
  1359. .llong .sys_timer_create /* 240 */
  1360. .llong .sys_timer_settime
  1361. .llong .sys_timer_gettime
  1362. .llong .sys_timer_getoverrun
  1363. .llong .sys_timer_delete
  1364. .llong .sys_clock_settime /* 245 */
  1365. .llong .sys_clock_gettime
  1366. .llong .sys_clock_getres
  1367. .llong .sys_clock_nanosleep
  1368. .llong .ppc64_swapcontext
  1369. .llong .sys_tgkill /* 250 */
  1370. .llong .sys_utimes
  1371. .llong .sys_statfs64
  1372. .llong .sys_fstatfs64
  1373. .llong .sys_ni_syscall /* 32bit only fadvise64_64 */
  1374. .llong .ppc_rtas /* 255 */
  1375. .llong .sys_ni_syscall /* 256 reserved for sys_debug_setcontext */
  1376. .llong .sys_ni_syscall /* 257 reserved for vserver */
  1377. .llong .sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */
  1378. .llong .sys_mbind
  1379. .llong .sys_get_mempolicy /* 260 */
  1380. .llong .sys_set_mempolicy
  1381. .llong .sys_mq_open
  1382. .llong .sys_mq_unlink
  1383. .llong .sys_mq_timedsend
  1384. .llong .sys_mq_timedreceive /* 265 */
  1385. .llong .sys_mq_notify
  1386. .llong .sys_mq_getsetattr
  1387. .llong .sys_kexec_load
  1388. .llong .sys_add_key
  1389. .llong .sys_request_key /* 270 */
  1390. .llong .sys_keyctl
  1391. .llong .sys_waitid
  1392. .llong .sys_ioprio_set
  1393. .llong .sys_ioprio_get
  1394. .llong .sys_inotify_init /* 275 */
  1395. .llong .sys_inotify_add_watch
  1396. .llong .sys_inotify_rm_watch