misc.S 35 KB

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