misc.S 33 KB

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