misc.S 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. /*
  2. * This file contains miscellaneous low-level functions.
  3. * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  4. *
  5. * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
  6. * and Paul Mackerras.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. *
  13. */
  14. #include <linux/config.h>
  15. #include <linux/sys.h>
  16. #include <asm/unistd.h>
  17. #include <asm/errno.h>
  18. #include <asm/processor.h>
  19. #include <asm/page.h>
  20. #include <asm/cache.h>
  21. #include <asm/cputable.h>
  22. #include <asm/mmu.h>
  23. #include <asm/ppc_asm.h>
  24. #include <asm/thread_info.h>
  25. #include <asm/asm-offsets.h>
  26. #ifdef CONFIG_8xx
  27. #define ISYNC_8xx isync
  28. #else
  29. #define ISYNC_8xx
  30. #endif
  31. .text
  32. .align 5
  33. _GLOBAL(__delay)
  34. cmpwi 0,r3,0
  35. mtctr r3
  36. beqlr
  37. 1: bdnz 1b
  38. blr
  39. /*
  40. * Returns (address we're running at) - (address we were linked at)
  41. * for use before the text and data are mapped to KERNELBASE.
  42. */
  43. _GLOBAL(reloc_offset)
  44. mflr r0
  45. bl 1f
  46. 1: mflr r3
  47. lis r4,1b@ha
  48. addi r4,r4,1b@l
  49. subf r3,r4,r3
  50. mtlr r0
  51. blr
  52. /*
  53. * add_reloc_offset(x) returns x + reloc_offset().
  54. */
  55. _GLOBAL(add_reloc_offset)
  56. mflr r0
  57. bl 1f
  58. 1: mflr r5
  59. lis r4,1b@ha
  60. addi r4,r4,1b@l
  61. subf r5,r4,r5
  62. add r3,r3,r5
  63. mtlr r0
  64. blr
  65. /*
  66. * sub_reloc_offset(x) returns x - reloc_offset().
  67. */
  68. _GLOBAL(sub_reloc_offset)
  69. mflr r0
  70. bl 1f
  71. 1: mflr r5
  72. lis r4,1b@ha
  73. addi r4,r4,1b@l
  74. subf r5,r4,r5
  75. subf r3,r5,r3
  76. mtlr r0
  77. blr
  78. /*
  79. * reloc_got2 runs through the .got2 section adding an offset
  80. * to each entry.
  81. */
  82. _GLOBAL(reloc_got2)
  83. mflr r11
  84. lis r7,__got2_start@ha
  85. addi r7,r7,__got2_start@l
  86. lis r8,__got2_end@ha
  87. addi r8,r8,__got2_end@l
  88. subf r8,r7,r8
  89. srwi. r8,r8,2
  90. beqlr
  91. mtctr r8
  92. bl 1f
  93. 1: mflr r0
  94. lis r4,1b@ha
  95. addi r4,r4,1b@l
  96. subf r0,r4,r0
  97. add r7,r0,r7
  98. 2: lwz r0,0(r7)
  99. add r0,r0,r3
  100. stw r0,0(r7)
  101. addi r7,r7,4
  102. bdnz 2b
  103. mtlr r11
  104. blr
  105. /*
  106. * identify_cpu,
  107. * called with r3 = data offset and r4 = CPU number
  108. * doesn't change r3
  109. */
  110. _GLOBAL(identify_cpu)
  111. addis r8,r3,cpu_specs@ha
  112. addi r8,r8,cpu_specs@l
  113. mfpvr r7
  114. 1:
  115. lwz r5,CPU_SPEC_PVR_MASK(r8)
  116. and r5,r5,r7
  117. lwz r6,CPU_SPEC_PVR_VALUE(r8)
  118. cmplw 0,r6,r5
  119. beq 1f
  120. addi r8,r8,CPU_SPEC_ENTRY_SIZE
  121. b 1b
  122. 1:
  123. addis r6,r3,cur_cpu_spec@ha
  124. addi r6,r6,cur_cpu_spec@l
  125. sub r8,r8,r3
  126. stw r8,0(r6)
  127. blr
  128. /*
  129. * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
  130. * and writes nop's over sections of code that don't apply for this cpu.
  131. * r3 = data offset (not changed)
  132. */
  133. _GLOBAL(do_cpu_ftr_fixups)
  134. /* Get CPU 0 features */
  135. addis r6,r3,cur_cpu_spec@ha
  136. addi r6,r6,cur_cpu_spec@l
  137. lwz r4,0(r6)
  138. add r4,r4,r3
  139. lwz r4,CPU_SPEC_FEATURES(r4)
  140. /* Get the fixup table */
  141. addis r6,r3,__start___ftr_fixup@ha
  142. addi r6,r6,__start___ftr_fixup@l
  143. addis r7,r3,__stop___ftr_fixup@ha
  144. addi r7,r7,__stop___ftr_fixup@l
  145. /* Do the fixup */
  146. 1: cmplw 0,r6,r7
  147. bgelr
  148. addi r6,r6,16
  149. lwz r8,-16(r6) /* mask */
  150. and r8,r8,r4
  151. lwz r9,-12(r6) /* value */
  152. cmplw 0,r8,r9
  153. beq 1b
  154. lwz r8,-8(r6) /* section begin */
  155. lwz r9,-4(r6) /* section end */
  156. subf. r9,r8,r9
  157. beq 1b
  158. /* write nops over the section of code */
  159. /* todo: if large section, add a branch at the start of it */
  160. srwi r9,r9,2
  161. mtctr r9
  162. add r8,r8,r3
  163. lis r0,0x60000000@h /* nop */
  164. 3: stw r0,0(r8)
  165. andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
  166. beq 2f
  167. dcbst 0,r8 /* suboptimal, but simpler */
  168. sync
  169. icbi 0,r8
  170. 2: addi r8,r8,4
  171. bdnz 3b
  172. sync /* additional sync needed on g4 */
  173. isync
  174. b 1b
  175. /*
  176. * call_setup_cpu - call the setup_cpu function for this cpu
  177. * r3 = data offset, r24 = cpu number
  178. *
  179. * Setup function is called with:
  180. * r3 = data offset
  181. * r4 = ptr to CPU spec (relocated)
  182. */
  183. _GLOBAL(call_setup_cpu)
  184. addis r4,r3,cur_cpu_spec@ha
  185. addi r4,r4,cur_cpu_spec@l
  186. lwz r4,0(r4)
  187. add r4,r4,r3
  188. lwz r5,CPU_SPEC_SETUP(r4)
  189. cmpi 0,r5,0
  190. add r5,r5,r3
  191. beqlr
  192. mtctr r5
  193. bctr
  194. #if defined(CONFIG_CPU_FREQ_PMAC) && defined(CONFIG_6xx)
  195. /* This gets called by via-pmu.c to switch the PLL selection
  196. * on 750fx CPU. This function should really be moved to some
  197. * other place (as most of the cpufreq code in via-pmu
  198. */
  199. _GLOBAL(low_choose_750fx_pll)
  200. /* Clear MSR:EE */
  201. mfmsr r7
  202. rlwinm r0,r7,0,17,15
  203. mtmsr r0
  204. /* If switching to PLL1, disable HID0:BTIC */
  205. cmplwi cr0,r3,0
  206. beq 1f
  207. mfspr r5,SPRN_HID0
  208. rlwinm r5,r5,0,27,25
  209. sync
  210. mtspr SPRN_HID0,r5
  211. isync
  212. sync
  213. 1:
  214. /* Calc new HID1 value */
  215. mfspr r4,SPRN_HID1 /* Build a HID1:PS bit from parameter */
  216. rlwinm r5,r3,16,15,15 /* Clear out HID1:PS from value read */
  217. rlwinm r4,r4,0,16,14 /* Could have I used rlwimi here ? */
  218. or r4,r4,r5
  219. mtspr SPRN_HID1,r4
  220. /* Store new HID1 image */
  221. rlwinm r6,r1,0,0,18
  222. lwz r6,TI_CPU(r6)
  223. slwi r6,r6,2
  224. addis r6,r6,nap_save_hid1@ha
  225. stw r4,nap_save_hid1@l(r6)
  226. /* If switching to PLL0, enable HID0:BTIC */
  227. cmplwi cr0,r3,0
  228. bne 1f
  229. mfspr r5,SPRN_HID0
  230. ori r5,r5,HID0_BTIC
  231. sync
  232. mtspr SPRN_HID0,r5
  233. isync
  234. sync
  235. 1:
  236. /* Return */
  237. mtmsr r7
  238. blr
  239. _GLOBAL(low_choose_7447a_dfs)
  240. /* Clear MSR:EE */
  241. mfmsr r7
  242. rlwinm r0,r7,0,17,15
  243. mtmsr r0
  244. /* Calc new HID1 value */
  245. mfspr r4,SPRN_HID1
  246. insrwi r4,r3,1,9 /* insert parameter into bit 9 */
  247. sync
  248. mtspr SPRN_HID1,r4
  249. sync
  250. isync
  251. /* Return */
  252. mtmsr r7
  253. blr
  254. #endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */
  255. /*
  256. * complement mask on the msr then "or" some values on.
  257. * _nmask_and_or_msr(nmask, value_to_or)
  258. */
  259. _GLOBAL(_nmask_and_or_msr)
  260. mfmsr r0 /* Get current msr */
  261. andc r0,r0,r3 /* And off the bits set in r3 (first parm) */
  262. or r0,r0,r4 /* Or on the bits in r4 (second parm) */
  263. SYNC /* Some chip revs have problems here... */
  264. mtmsr r0 /* Update machine state */
  265. isync
  266. blr /* Done */
  267. /*
  268. * Flush MMU TLB
  269. */
  270. _GLOBAL(_tlbia)
  271. #if defined(CONFIG_40x)
  272. sync /* Flush to memory before changing mapping */
  273. tlbia
  274. isync /* Flush shadow TLB */
  275. #elif defined(CONFIG_44x)
  276. li r3,0
  277. sync
  278. /* Load high watermark */
  279. lis r4,tlb_44x_hwater@ha
  280. lwz r5,tlb_44x_hwater@l(r4)
  281. 1: tlbwe r3,r3,PPC44x_TLB_PAGEID
  282. addi r3,r3,1
  283. cmpw 0,r3,r5
  284. ble 1b
  285. isync
  286. #elif defined(CONFIG_FSL_BOOKE)
  287. /* Invalidate all entries in TLB0 */
  288. li r3, 0x04
  289. tlbivax 0,3
  290. /* Invalidate all entries in TLB1 */
  291. li r3, 0x0c
  292. tlbivax 0,3
  293. /* Invalidate all entries in TLB2 */
  294. li r3, 0x14
  295. tlbivax 0,3
  296. /* Invalidate all entries in TLB3 */
  297. li r3, 0x1c
  298. tlbivax 0,3
  299. msync
  300. #ifdef CONFIG_SMP
  301. tlbsync
  302. #endif /* CONFIG_SMP */
  303. #else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
  304. #if defined(CONFIG_SMP)
  305. rlwinm r8,r1,0,0,18
  306. lwz r8,TI_CPU(r8)
  307. oris r8,r8,10
  308. mfmsr r10
  309. SYNC
  310. rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
  311. rlwinm r0,r0,0,28,26 /* clear DR */
  312. mtmsr r0
  313. SYNC_601
  314. isync
  315. lis r9,mmu_hash_lock@h
  316. ori r9,r9,mmu_hash_lock@l
  317. tophys(r9,r9)
  318. 10: lwarx r7,0,r9
  319. cmpwi 0,r7,0
  320. bne- 10b
  321. stwcx. r8,0,r9
  322. bne- 10b
  323. sync
  324. tlbia
  325. sync
  326. TLBSYNC
  327. li r0,0
  328. stw r0,0(r9) /* clear mmu_hash_lock */
  329. mtmsr r10
  330. SYNC_601
  331. isync
  332. #else /* CONFIG_SMP */
  333. sync
  334. tlbia
  335. sync
  336. #endif /* CONFIG_SMP */
  337. #endif /* ! defined(CONFIG_40x) */
  338. blr
  339. /*
  340. * Flush MMU TLB for a particular address
  341. */
  342. _GLOBAL(_tlbie)
  343. #if defined(CONFIG_40x)
  344. tlbsx. r3, 0, r3
  345. bne 10f
  346. sync
  347. /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
  348. * Since 25 is the V bit in the TLB_TAG, loading this value will invalidate
  349. * the TLB entry. */
  350. tlbwe r3, r3, TLB_TAG
  351. isync
  352. 10:
  353. #elif defined(CONFIG_44x)
  354. mfspr r4,SPRN_MMUCR
  355. mfspr r5,SPRN_PID /* Get PID */
  356. rlwimi r4,r5,0,24,31 /* Set TID */
  357. mtspr SPRN_MMUCR,r4
  358. tlbsx. r3, 0, r3
  359. bne 10f
  360. sync
  361. /* There are only 64 TLB entries, so r3 < 64,
  362. * which means bit 22, is clear. Since 22 is
  363. * the V bit in the TLB_PAGEID, loading this
  364. * value will invalidate the TLB entry.
  365. */
  366. tlbwe r3, r3, PPC44x_TLB_PAGEID
  367. isync
  368. 10:
  369. #elif defined(CONFIG_FSL_BOOKE)
  370. rlwinm r4, r3, 0, 0, 19
  371. ori r5, r4, 0x08 /* TLBSEL = 1 */
  372. ori r6, r4, 0x10 /* TLBSEL = 2 */
  373. ori r7, r4, 0x18 /* TLBSEL = 3 */
  374. tlbivax 0, r4
  375. tlbivax 0, r5
  376. tlbivax 0, r6
  377. tlbivax 0, r7
  378. msync
  379. #if defined(CONFIG_SMP)
  380. tlbsync
  381. #endif /* CONFIG_SMP */
  382. #else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
  383. #if defined(CONFIG_SMP)
  384. rlwinm r8,r1,0,0,18
  385. lwz r8,TI_CPU(r8)
  386. oris r8,r8,11
  387. mfmsr r10
  388. SYNC
  389. rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
  390. rlwinm r0,r0,0,28,26 /* clear DR */
  391. mtmsr r0
  392. SYNC_601
  393. isync
  394. lis r9,mmu_hash_lock@h
  395. ori r9,r9,mmu_hash_lock@l
  396. tophys(r9,r9)
  397. 10: lwarx r7,0,r9
  398. cmpwi 0,r7,0
  399. bne- 10b
  400. stwcx. r8,0,r9
  401. bne- 10b
  402. eieio
  403. tlbie r3
  404. sync
  405. TLBSYNC
  406. li r0,0
  407. stw r0,0(r9) /* clear mmu_hash_lock */
  408. mtmsr r10
  409. SYNC_601
  410. isync
  411. #else /* CONFIG_SMP */
  412. tlbie r3
  413. sync
  414. #endif /* CONFIG_SMP */
  415. #endif /* ! CONFIG_40x */
  416. blr
  417. /*
  418. * Flush instruction cache.
  419. * This is a no-op on the 601.
  420. */
  421. _GLOBAL(flush_instruction_cache)
  422. #if defined(CONFIG_8xx)
  423. isync
  424. lis r5, IDC_INVALL@h
  425. mtspr SPRN_IC_CST, r5
  426. #elif defined(CONFIG_4xx)
  427. #ifdef CONFIG_403GCX
  428. li r3, 512
  429. mtctr r3
  430. lis r4, KERNELBASE@h
  431. 1: iccci 0, r4
  432. addi r4, r4, 16
  433. bdnz 1b
  434. #else
  435. lis r3, KERNELBASE@h
  436. iccci 0,r3
  437. #endif
  438. #elif CONFIG_FSL_BOOKE
  439. BEGIN_FTR_SECTION
  440. mfspr r3,SPRN_L1CSR0
  441. ori r3,r3,L1CSR0_CFI|L1CSR0_CLFC
  442. /* msync; isync recommended here */
  443. mtspr SPRN_L1CSR0,r3
  444. isync
  445. blr
  446. END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
  447. mfspr r3,SPRN_L1CSR1
  448. ori r3,r3,L1CSR1_ICFI|L1CSR1_ICLFR
  449. mtspr SPRN_L1CSR1,r3
  450. #else
  451. mfspr r3,SPRN_PVR
  452. rlwinm r3,r3,16,16,31
  453. cmpwi 0,r3,1
  454. beqlr /* for 601, do nothing */
  455. /* 603/604 processor - use invalidate-all bit in HID0 */
  456. mfspr r3,SPRN_HID0
  457. ori r3,r3,HID0_ICFI
  458. mtspr SPRN_HID0,r3
  459. #endif /* CONFIG_8xx/4xx */
  460. isync
  461. blr
  462. /*
  463. * Write any modified data cache blocks out to memory
  464. * and invalidate the corresponding instruction cache blocks.
  465. * This is a no-op on the 601.
  466. *
  467. * __flush_icache_range(unsigned long start, unsigned long stop)
  468. */
  469. _GLOBAL(__flush_icache_range)
  470. BEGIN_FTR_SECTION
  471. blr /* for 601, do nothing */
  472. END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
  473. li r5,L1_CACHE_BYTES-1
  474. andc r3,r3,r5
  475. subf r4,r3,r4
  476. add r4,r4,r5
  477. srwi. r4,r4,L1_CACHE_SHIFT
  478. beqlr
  479. mtctr r4
  480. mr r6,r3
  481. 1: dcbst 0,r3
  482. addi r3,r3,L1_CACHE_BYTES
  483. bdnz 1b
  484. sync /* wait for dcbst's to get to ram */
  485. mtctr r4
  486. 2: icbi 0,r6
  487. addi r6,r6,L1_CACHE_BYTES
  488. bdnz 2b
  489. sync /* additional sync needed on g4 */
  490. isync
  491. blr
  492. /*
  493. * Write any modified data cache blocks out to memory.
  494. * Does not invalidate the corresponding cache lines (especially for
  495. * any corresponding instruction cache).
  496. *
  497. * clean_dcache_range(unsigned long start, unsigned long stop)
  498. */
  499. _GLOBAL(clean_dcache_range)
  500. li r5,L1_CACHE_BYTES-1
  501. andc r3,r3,r5
  502. subf r4,r3,r4
  503. add r4,r4,r5
  504. srwi. r4,r4,L1_CACHE_SHIFT
  505. beqlr
  506. mtctr r4
  507. 1: dcbst 0,r3
  508. addi r3,r3,L1_CACHE_BYTES
  509. bdnz 1b
  510. sync /* wait for dcbst's to get to ram */
  511. blr
  512. /*
  513. * Write any modified data cache blocks out to memory and invalidate them.
  514. * Does not invalidate the corresponding instruction cache blocks.
  515. *
  516. * flush_dcache_range(unsigned long start, unsigned long stop)
  517. */
  518. _GLOBAL(flush_dcache_range)
  519. li r5,L1_CACHE_BYTES-1
  520. andc r3,r3,r5
  521. subf r4,r3,r4
  522. add r4,r4,r5
  523. srwi. r4,r4,L1_CACHE_SHIFT
  524. beqlr
  525. mtctr r4
  526. 1: dcbf 0,r3
  527. addi r3,r3,L1_CACHE_BYTES
  528. bdnz 1b
  529. sync /* wait for dcbst's to get to ram */
  530. blr
  531. /*
  532. * Like above, but invalidate the D-cache. This is used by the 8xx
  533. * to invalidate the cache so the PPC core doesn't get stale data
  534. * from the CPM (no cache snooping here :-).
  535. *
  536. * invalidate_dcache_range(unsigned long start, unsigned long stop)
  537. */
  538. _GLOBAL(invalidate_dcache_range)
  539. li r5,L1_CACHE_BYTES-1
  540. andc r3,r3,r5
  541. subf r4,r3,r4
  542. add r4,r4,r5
  543. srwi. r4,r4,L1_CACHE_SHIFT
  544. beqlr
  545. mtctr r4
  546. 1: dcbi 0,r3
  547. addi r3,r3,L1_CACHE_BYTES
  548. bdnz 1b
  549. sync /* wait for dcbi's to get to ram */
  550. blr
  551. #ifdef CONFIG_NOT_COHERENT_CACHE
  552. /*
  553. * 40x cores have 8K or 16K dcache and 32 byte line size.
  554. * 44x has a 32K dcache and 32 byte line size.
  555. * 8xx has 1, 2, 4, 8K variants.
  556. * For now, cover the worst case of the 44x.
  557. * Must be called with external interrupts disabled.
  558. */
  559. #define CACHE_NWAYS 64
  560. #define CACHE_NLINES 16
  561. _GLOBAL(flush_dcache_all)
  562. li r4, (2 * CACHE_NWAYS * CACHE_NLINES)
  563. mtctr r4
  564. lis r5, KERNELBASE@h
  565. 1: lwz r3, 0(r5) /* Load one word from every line */
  566. addi r5, r5, L1_CACHE_BYTES
  567. bdnz 1b
  568. blr
  569. #endif /* CONFIG_NOT_COHERENT_CACHE */
  570. /*
  571. * Flush a particular page from the data cache to RAM.
  572. * Note: this is necessary because the instruction cache does *not*
  573. * snoop from the data cache.
  574. * This is a no-op on the 601 which has a unified cache.
  575. *
  576. * void __flush_dcache_icache(void *page)
  577. */
  578. _GLOBAL(__flush_dcache_icache)
  579. BEGIN_FTR_SECTION
  580. blr /* for 601, do nothing */
  581. END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
  582. rlwinm r3,r3,0,0,19 /* Get page base address */
  583. li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
  584. mtctr r4
  585. mr r6,r3
  586. 0: dcbst 0,r3 /* Write line to ram */
  587. addi r3,r3,L1_CACHE_BYTES
  588. bdnz 0b
  589. sync
  590. mtctr r4
  591. 1: icbi 0,r6
  592. addi r6,r6,L1_CACHE_BYTES
  593. bdnz 1b
  594. sync
  595. isync
  596. blr
  597. /*
  598. * Flush a particular page from the data cache to RAM, identified
  599. * by its physical address. We turn off the MMU so we can just use
  600. * the physical address (this may be a highmem page without a kernel
  601. * mapping).
  602. *
  603. * void __flush_dcache_icache_phys(unsigned long physaddr)
  604. */
  605. _GLOBAL(__flush_dcache_icache_phys)
  606. BEGIN_FTR_SECTION
  607. blr /* for 601, do nothing */
  608. END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
  609. mfmsr r10
  610. rlwinm r0,r10,0,28,26 /* clear DR */
  611. mtmsr r0
  612. isync
  613. rlwinm r3,r3,0,0,19 /* Get page base address */
  614. li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
  615. mtctr r4
  616. mr r6,r3
  617. 0: dcbst 0,r3 /* Write line to ram */
  618. addi r3,r3,L1_CACHE_BYTES
  619. bdnz 0b
  620. sync
  621. mtctr r4
  622. 1: icbi 0,r6
  623. addi r6,r6,L1_CACHE_BYTES
  624. bdnz 1b
  625. sync
  626. mtmsr r10 /* restore DR */
  627. isync
  628. blr
  629. /*
  630. * Clear pages using the dcbz instruction, which doesn't cause any
  631. * memory traffic (except to write out any cache lines which get
  632. * displaced). This only works on cacheable memory.
  633. *
  634. * void clear_pages(void *page, int order) ;
  635. */
  636. _GLOBAL(clear_pages)
  637. li r0,4096/L1_CACHE_BYTES
  638. slw r0,r0,r4
  639. mtctr r0
  640. #ifdef CONFIG_8xx
  641. li r4, 0
  642. 1: stw r4, 0(r3)
  643. stw r4, 4(r3)
  644. stw r4, 8(r3)
  645. stw r4, 12(r3)
  646. #else
  647. 1: dcbz 0,r3
  648. #endif
  649. addi r3,r3,L1_CACHE_BYTES
  650. bdnz 1b
  651. blr
  652. /*
  653. * Copy a whole page. We use the dcbz instruction on the destination
  654. * to reduce memory traffic (it eliminates the unnecessary reads of
  655. * the destination into cache). This requires that the destination
  656. * is cacheable.
  657. */
  658. #define COPY_16_BYTES \
  659. lwz r6,4(r4); \
  660. lwz r7,8(r4); \
  661. lwz r8,12(r4); \
  662. lwzu r9,16(r4); \
  663. stw r6,4(r3); \
  664. stw r7,8(r3); \
  665. stw r8,12(r3); \
  666. stwu r9,16(r3)
  667. _GLOBAL(copy_page)
  668. addi r3,r3,-4
  669. addi r4,r4,-4
  670. #ifdef CONFIG_8xx
  671. /* don't use prefetch on 8xx */
  672. li r0,4096/L1_CACHE_BYTES
  673. mtctr r0
  674. 1: COPY_16_BYTES
  675. bdnz 1b
  676. blr
  677. #else /* not 8xx, we can prefetch */
  678. li r5,4
  679. #if MAX_COPY_PREFETCH > 1
  680. li r0,MAX_COPY_PREFETCH
  681. li r11,4
  682. mtctr r0
  683. 11: dcbt r11,r4
  684. addi r11,r11,L1_CACHE_BYTES
  685. bdnz 11b
  686. #else /* MAX_COPY_PREFETCH == 1 */
  687. dcbt r5,r4
  688. li r11,L1_CACHE_BYTES+4
  689. #endif /* MAX_COPY_PREFETCH */
  690. li r0,4096/L1_CACHE_BYTES - MAX_COPY_PREFETCH
  691. crclr 4*cr0+eq
  692. 2:
  693. mtctr r0
  694. 1:
  695. dcbt r11,r4
  696. dcbz r5,r3
  697. COPY_16_BYTES
  698. #if L1_CACHE_BYTES >= 32
  699. COPY_16_BYTES
  700. #if L1_CACHE_BYTES >= 64
  701. COPY_16_BYTES
  702. COPY_16_BYTES
  703. #if L1_CACHE_BYTES >= 128
  704. COPY_16_BYTES
  705. COPY_16_BYTES
  706. COPY_16_BYTES
  707. COPY_16_BYTES
  708. #endif
  709. #endif
  710. #endif
  711. bdnz 1b
  712. beqlr
  713. crnot 4*cr0+eq,4*cr0+eq
  714. li r0,MAX_COPY_PREFETCH
  715. li r11,4
  716. b 2b
  717. #endif /* CONFIG_8xx */
  718. /*
  719. * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
  720. * void atomic_set_mask(atomic_t mask, atomic_t *addr);
  721. */
  722. _GLOBAL(atomic_clear_mask)
  723. 10: lwarx r5,0,r4
  724. andc r5,r5,r3
  725. PPC405_ERR77(0,r4)
  726. stwcx. r5,0,r4
  727. bne- 10b
  728. blr
  729. _GLOBAL(atomic_set_mask)
  730. 10: lwarx r5,0,r4
  731. or r5,r5,r3
  732. PPC405_ERR77(0,r4)
  733. stwcx. r5,0,r4
  734. bne- 10b
  735. blr
  736. /*
  737. * I/O string operations
  738. *
  739. * insb(port, buf, len)
  740. * outsb(port, buf, len)
  741. * insw(port, buf, len)
  742. * outsw(port, buf, len)
  743. * insl(port, buf, len)
  744. * outsl(port, buf, len)
  745. * insw_ns(port, buf, len)
  746. * outsw_ns(port, buf, len)
  747. * insl_ns(port, buf, len)
  748. * outsl_ns(port, buf, len)
  749. *
  750. * The *_ns versions don't do byte-swapping.
  751. */
  752. _GLOBAL(_insb)
  753. cmpwi 0,r5,0
  754. mtctr r5
  755. subi r4,r4,1
  756. blelr-
  757. 00: lbz r5,0(r3)
  758. 01: eieio
  759. 02: stbu r5,1(r4)
  760. ISYNC_8xx
  761. .section .fixup,"ax"
  762. 03: blr
  763. .text
  764. .section __ex_table, "a"
  765. .align 2
  766. .long 00b, 03b
  767. .long 01b, 03b
  768. .long 02b, 03b
  769. .text
  770. bdnz 00b
  771. blr
  772. _GLOBAL(_outsb)
  773. cmpwi 0,r5,0
  774. mtctr r5
  775. subi r4,r4,1
  776. blelr-
  777. 00: lbzu r5,1(r4)
  778. 01: stb r5,0(r3)
  779. 02: eieio
  780. ISYNC_8xx
  781. .section .fixup,"ax"
  782. 03: blr
  783. .text
  784. .section __ex_table, "a"
  785. .align 2
  786. .long 00b, 03b
  787. .long 01b, 03b
  788. .long 02b, 03b
  789. .text
  790. bdnz 00b
  791. blr
  792. _GLOBAL(_insw)
  793. cmpwi 0,r5,0
  794. mtctr r5
  795. subi r4,r4,2
  796. blelr-
  797. 00: lhbrx r5,0,r3
  798. 01: eieio
  799. 02: sthu r5,2(r4)
  800. ISYNC_8xx
  801. .section .fixup,"ax"
  802. 03: blr
  803. .text
  804. .section __ex_table, "a"
  805. .align 2
  806. .long 00b, 03b
  807. .long 01b, 03b
  808. .long 02b, 03b
  809. .text
  810. bdnz 00b
  811. blr
  812. _GLOBAL(_outsw)
  813. cmpwi 0,r5,0
  814. mtctr r5
  815. subi r4,r4,2
  816. blelr-
  817. 00: lhzu r5,2(r4)
  818. 01: eieio
  819. 02: sthbrx r5,0,r3
  820. ISYNC_8xx
  821. .section .fixup,"ax"
  822. 03: blr
  823. .text
  824. .section __ex_table, "a"
  825. .align 2
  826. .long 00b, 03b
  827. .long 01b, 03b
  828. .long 02b, 03b
  829. .text
  830. bdnz 00b
  831. blr
  832. _GLOBAL(_insl)
  833. cmpwi 0,r5,0
  834. mtctr r5
  835. subi r4,r4,4
  836. blelr-
  837. 00: lwbrx r5,0,r3
  838. 01: eieio
  839. 02: stwu r5,4(r4)
  840. ISYNC_8xx
  841. .section .fixup,"ax"
  842. 03: blr
  843. .text
  844. .section __ex_table, "a"
  845. .align 2
  846. .long 00b, 03b
  847. .long 01b, 03b
  848. .long 02b, 03b
  849. .text
  850. bdnz 00b
  851. blr
  852. _GLOBAL(_outsl)
  853. cmpwi 0,r5,0
  854. mtctr r5
  855. subi r4,r4,4
  856. blelr-
  857. 00: lwzu r5,4(r4)
  858. 01: stwbrx r5,0,r3
  859. 02: eieio
  860. ISYNC_8xx
  861. .section .fixup,"ax"
  862. 03: blr
  863. .text
  864. .section __ex_table, "a"
  865. .align 2
  866. .long 00b, 03b
  867. .long 01b, 03b
  868. .long 02b, 03b
  869. .text
  870. bdnz 00b
  871. blr
  872. _GLOBAL(__ide_mm_insw)
  873. _GLOBAL(_insw_ns)
  874. cmpwi 0,r5,0
  875. mtctr r5
  876. subi r4,r4,2
  877. blelr-
  878. 00: lhz r5,0(r3)
  879. 01: eieio
  880. 02: sthu r5,2(r4)
  881. ISYNC_8xx
  882. .section .fixup,"ax"
  883. 03: blr
  884. .text
  885. .section __ex_table, "a"
  886. .align 2
  887. .long 00b, 03b
  888. .long 01b, 03b
  889. .long 02b, 03b
  890. .text
  891. bdnz 00b
  892. blr
  893. _GLOBAL(__ide_mm_outsw)
  894. _GLOBAL(_outsw_ns)
  895. cmpwi 0,r5,0
  896. mtctr r5
  897. subi r4,r4,2
  898. blelr-
  899. 00: lhzu r5,2(r4)
  900. 01: sth r5,0(r3)
  901. 02: eieio
  902. ISYNC_8xx
  903. .section .fixup,"ax"
  904. 03: blr
  905. .text
  906. .section __ex_table, "a"
  907. .align 2
  908. .long 00b, 03b
  909. .long 01b, 03b
  910. .long 02b, 03b
  911. .text
  912. bdnz 00b
  913. blr
  914. _GLOBAL(__ide_mm_insl)
  915. _GLOBAL(_insl_ns)
  916. cmpwi 0,r5,0
  917. mtctr r5
  918. subi r4,r4,4
  919. blelr-
  920. 00: lwz r5,0(r3)
  921. 01: eieio
  922. 02: stwu r5,4(r4)
  923. ISYNC_8xx
  924. .section .fixup,"ax"
  925. 03: blr
  926. .text
  927. .section __ex_table, "a"
  928. .align 2
  929. .long 00b, 03b
  930. .long 01b, 03b
  931. .long 02b, 03b
  932. .text
  933. bdnz 00b
  934. blr
  935. _GLOBAL(__ide_mm_outsl)
  936. _GLOBAL(_outsl_ns)
  937. cmpwi 0,r5,0
  938. mtctr r5
  939. subi r4,r4,4
  940. blelr-
  941. 00: lwzu r5,4(r4)
  942. 01: stw r5,0(r3)
  943. 02: eieio
  944. ISYNC_8xx
  945. .section .fixup,"ax"
  946. 03: blr
  947. .text
  948. .section __ex_table, "a"
  949. .align 2
  950. .long 00b, 03b
  951. .long 01b, 03b
  952. .long 02b, 03b
  953. .text
  954. bdnz 00b
  955. blr
  956. /*
  957. * Extended precision shifts.
  958. *
  959. * Updated to be valid for shift counts from 0 to 63 inclusive.
  960. * -- Gabriel
  961. *
  962. * R3/R4 has 64 bit value
  963. * R5 has shift count
  964. * result in R3/R4
  965. *
  966. * ashrdi3: arithmetic right shift (sign propagation)
  967. * lshrdi3: logical right shift
  968. * ashldi3: left shift
  969. */
  970. _GLOBAL(__ashrdi3)
  971. subfic r6,r5,32
  972. srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
  973. addi r7,r5,32 # could be xori, or addi with -32
  974. slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
  975. rlwinm r8,r7,0,32 # t3 = (count < 32) ? 32 : 0
  976. sraw r7,r3,r7 # t2 = MSW >> (count-32)
  977. or r4,r4,r6 # LSW |= t1
  978. slw r7,r7,r8 # t2 = (count < 32) ? 0 : t2
  979. sraw r3,r3,r5 # MSW = MSW >> count
  980. or r4,r4,r7 # LSW |= t2
  981. blr
  982. _GLOBAL(__ashldi3)
  983. subfic r6,r5,32
  984. slw r3,r3,r5 # MSW = count > 31 ? 0 : MSW << count
  985. addi r7,r5,32 # could be xori, or addi with -32
  986. srw r6,r4,r6 # t1 = count > 31 ? 0 : LSW >> (32-count)
  987. slw r7,r4,r7 # t2 = count < 32 ? 0 : LSW << (count-32)
  988. or r3,r3,r6 # MSW |= t1
  989. slw r4,r4,r5 # LSW = LSW << count
  990. or r3,r3,r7 # MSW |= t2
  991. blr
  992. _GLOBAL(__lshrdi3)
  993. subfic r6,r5,32
  994. srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
  995. addi r7,r5,32 # could be xori, or addi with -32
  996. slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
  997. srw r7,r3,r7 # t2 = count < 32 ? 0 : MSW >> (count-32)
  998. or r4,r4,r6 # LSW |= t1
  999. srw r3,r3,r5 # MSW = MSW >> count
  1000. or r4,r4,r7 # LSW |= t2
  1001. blr
  1002. _GLOBAL(abs)
  1003. srawi r4,r3,31
  1004. xor r3,r3,r4
  1005. sub r3,r3,r4
  1006. blr
  1007. _GLOBAL(_get_SP)
  1008. mr r3,r1 /* Close enough */
  1009. blr
  1010. /*
  1011. * Create a kernel thread
  1012. * kernel_thread(fn, arg, flags)
  1013. */
  1014. _GLOBAL(kernel_thread)
  1015. stwu r1,-16(r1)
  1016. stw r30,8(r1)
  1017. stw r31,12(r1)
  1018. mr r30,r3 /* function */
  1019. mr r31,r4 /* argument */
  1020. ori r3,r5,CLONE_VM /* flags */
  1021. oris r3,r3,CLONE_UNTRACED>>16
  1022. li r4,0 /* new sp (unused) */
  1023. li r0,__NR_clone
  1024. sc
  1025. cmpwi 0,r3,0 /* parent or child? */
  1026. bne 1f /* return if parent */
  1027. li r0,0 /* make top-level stack frame */
  1028. stwu r0,-16(r1)
  1029. mtlr r30 /* fn addr in lr */
  1030. mr r3,r31 /* load arg and call fn */
  1031. PPC440EP_ERR42
  1032. blrl
  1033. li r0,__NR_exit /* exit if function returns */
  1034. li r3,0
  1035. sc
  1036. 1: lwz r30,8(r1)
  1037. lwz r31,12(r1)
  1038. addi r1,r1,16
  1039. blr
  1040. /*
  1041. * This routine is just here to keep GCC happy - sigh...
  1042. */
  1043. _GLOBAL(__main)
  1044. blr
  1045. #define SYSCALL(name) \
  1046. _GLOBAL(name) \
  1047. li r0,__NR_##name; \
  1048. sc; \
  1049. bnslr; \
  1050. lis r4,errno@ha; \
  1051. stw r3,errno@l(r4); \
  1052. li r3,-1; \
  1053. blr
  1054. SYSCALL(execve)
  1055. /* Why isn't this a) automatic, b) written in 'C'? */
  1056. .data
  1057. .align 4
  1058. _GLOBAL(sys_call_table)
  1059. .long sys_restart_syscall /* 0 */
  1060. .long sys_exit
  1061. .long ppc_fork
  1062. .long sys_read
  1063. .long sys_write
  1064. .long sys_open /* 5 */
  1065. .long sys_close
  1066. .long sys_waitpid
  1067. .long sys_creat
  1068. .long sys_link
  1069. .long sys_unlink /* 10 */
  1070. .long sys_execve
  1071. .long sys_chdir
  1072. .long sys_time
  1073. .long sys_mknod
  1074. .long sys_chmod /* 15 */
  1075. .long sys_lchown
  1076. .long sys_ni_syscall /* old break syscall holder */
  1077. .long sys_stat
  1078. .long sys_lseek
  1079. .long sys_getpid /* 20 */
  1080. .long sys_mount
  1081. .long sys_oldumount
  1082. .long sys_setuid
  1083. .long sys_getuid
  1084. .long sys_stime /* 25 */
  1085. .long sys_ptrace
  1086. .long sys_alarm
  1087. .long sys_fstat
  1088. .long sys_pause
  1089. .long sys_utime /* 30 */
  1090. .long sys_ni_syscall /* old stty syscall holder */
  1091. .long sys_ni_syscall /* old gtty syscall holder */
  1092. .long sys_access
  1093. .long sys_nice
  1094. .long sys_ni_syscall /* 35 */ /* old ftime syscall holder */
  1095. .long sys_sync
  1096. .long sys_kill
  1097. .long sys_rename
  1098. .long sys_mkdir
  1099. .long sys_rmdir /* 40 */
  1100. .long sys_dup
  1101. .long sys_pipe
  1102. .long sys_times
  1103. .long sys_ni_syscall /* old prof syscall holder */
  1104. .long sys_brk /* 45 */
  1105. .long sys_setgid
  1106. .long sys_getgid
  1107. .long sys_signal
  1108. .long sys_geteuid
  1109. .long sys_getegid /* 50 */
  1110. .long sys_acct
  1111. .long sys_umount /* recycled never used phys() */
  1112. .long sys_ni_syscall /* old lock syscall holder */
  1113. .long sys_ioctl
  1114. .long sys_fcntl /* 55 */
  1115. .long sys_ni_syscall /* old mpx syscall holder */
  1116. .long sys_setpgid
  1117. .long sys_ni_syscall /* old ulimit syscall holder */
  1118. .long sys_olduname
  1119. .long sys_umask /* 60 */
  1120. .long sys_chroot
  1121. .long sys_ustat
  1122. .long sys_dup2
  1123. .long sys_getppid
  1124. .long sys_getpgrp /* 65 */
  1125. .long sys_setsid
  1126. .long sys_sigaction
  1127. .long sys_sgetmask
  1128. .long sys_ssetmask
  1129. .long sys_setreuid /* 70 */
  1130. .long sys_setregid
  1131. .long ppc_sigsuspend
  1132. .long sys_sigpending
  1133. .long sys_sethostname
  1134. .long sys_setrlimit /* 75 */
  1135. .long sys_old_getrlimit
  1136. .long sys_getrusage
  1137. .long sys_gettimeofday
  1138. .long sys_settimeofday
  1139. .long sys_getgroups /* 80 */
  1140. .long sys_setgroups
  1141. .long ppc_select
  1142. .long sys_symlink
  1143. .long sys_lstat
  1144. .long sys_readlink /* 85 */
  1145. .long sys_uselib
  1146. .long sys_swapon
  1147. .long sys_reboot
  1148. .long old_readdir
  1149. .long sys_mmap /* 90 */
  1150. .long sys_munmap
  1151. .long sys_truncate
  1152. .long sys_ftruncate
  1153. .long sys_fchmod
  1154. .long sys_fchown /* 95 */
  1155. .long sys_getpriority
  1156. .long sys_setpriority
  1157. .long sys_ni_syscall /* old profil syscall holder */
  1158. .long sys_statfs
  1159. .long sys_fstatfs /* 100 */
  1160. .long sys_ni_syscall
  1161. .long sys_socketcall
  1162. .long sys_syslog
  1163. .long sys_setitimer
  1164. .long sys_getitimer /* 105 */
  1165. .long sys_newstat
  1166. .long sys_newlstat
  1167. .long sys_newfstat
  1168. .long sys_uname
  1169. .long sys_ni_syscall /* 110 */
  1170. .long sys_vhangup
  1171. .long sys_ni_syscall /* old 'idle' syscall */
  1172. .long sys_ni_syscall
  1173. .long sys_wait4
  1174. .long sys_swapoff /* 115 */
  1175. .long sys_sysinfo
  1176. .long sys_ipc
  1177. .long sys_fsync
  1178. .long sys_sigreturn
  1179. .long ppc_clone /* 120 */
  1180. .long sys_setdomainname
  1181. .long sys_newuname
  1182. .long sys_ni_syscall
  1183. .long sys_adjtimex
  1184. .long sys_mprotect /* 125 */
  1185. .long sys_sigprocmask
  1186. .long sys_ni_syscall /* old sys_create_module */
  1187. .long sys_init_module
  1188. .long sys_delete_module
  1189. .long sys_ni_syscall /* old sys_get_kernel_syms */ /* 130 */
  1190. .long sys_quotactl
  1191. .long sys_getpgid
  1192. .long sys_fchdir
  1193. .long sys_bdflush
  1194. .long sys_sysfs /* 135 */
  1195. .long sys_personality
  1196. .long sys_ni_syscall /* for afs_syscall */
  1197. .long sys_setfsuid
  1198. .long sys_setfsgid
  1199. .long sys_llseek /* 140 */
  1200. .long sys_getdents
  1201. .long ppc_select
  1202. .long sys_flock
  1203. .long sys_msync
  1204. .long sys_readv /* 145 */
  1205. .long sys_writev
  1206. .long sys_getsid
  1207. .long sys_fdatasync
  1208. .long sys_sysctl
  1209. .long sys_mlock /* 150 */
  1210. .long sys_munlock
  1211. .long sys_mlockall
  1212. .long sys_munlockall
  1213. .long sys_sched_setparam
  1214. .long sys_sched_getparam /* 155 */
  1215. .long sys_sched_setscheduler
  1216. .long sys_sched_getscheduler
  1217. .long sys_sched_yield
  1218. .long sys_sched_get_priority_max
  1219. .long sys_sched_get_priority_min /* 160 */
  1220. .long sys_sched_rr_get_interval
  1221. .long sys_nanosleep
  1222. .long sys_mremap
  1223. .long sys_setresuid
  1224. .long sys_getresuid /* 165 */
  1225. .long sys_ni_syscall /* old sys_query_module */
  1226. .long sys_poll
  1227. .long sys_nfsservctl
  1228. .long sys_setresgid
  1229. .long sys_getresgid /* 170 */
  1230. .long sys_prctl
  1231. .long sys_rt_sigreturn
  1232. .long sys_rt_sigaction
  1233. .long sys_rt_sigprocmask
  1234. .long sys_rt_sigpending /* 175 */
  1235. .long sys_rt_sigtimedwait
  1236. .long sys_rt_sigqueueinfo
  1237. .long ppc_rt_sigsuspend
  1238. .long sys_pread64
  1239. .long sys_pwrite64 /* 180 */
  1240. .long sys_chown
  1241. .long sys_getcwd
  1242. .long sys_capget
  1243. .long sys_capset
  1244. .long sys_sigaltstack /* 185 */
  1245. .long sys_sendfile
  1246. .long sys_ni_syscall /* streams1 */
  1247. .long sys_ni_syscall /* streams2 */
  1248. .long ppc_vfork
  1249. .long sys_getrlimit /* 190 */
  1250. .long sys_readahead
  1251. .long sys_mmap2
  1252. .long sys_truncate64
  1253. .long sys_ftruncate64
  1254. .long sys_stat64 /* 195 */
  1255. .long sys_lstat64
  1256. .long sys_fstat64
  1257. .long sys_pciconfig_read
  1258. .long sys_pciconfig_write
  1259. .long sys_pciconfig_iobase /* 200 */
  1260. .long sys_ni_syscall /* 201 - reserved - MacOnLinux - new */
  1261. .long sys_getdents64
  1262. .long sys_pivot_root
  1263. .long sys_fcntl64
  1264. .long sys_madvise /* 205 */
  1265. .long sys_mincore
  1266. .long sys_gettid
  1267. .long sys_tkill
  1268. .long sys_setxattr
  1269. .long sys_lsetxattr /* 210 */
  1270. .long sys_fsetxattr
  1271. .long sys_getxattr
  1272. .long sys_lgetxattr
  1273. .long sys_fgetxattr
  1274. .long sys_listxattr /* 215 */
  1275. .long sys_llistxattr
  1276. .long sys_flistxattr
  1277. .long sys_removexattr
  1278. .long sys_lremovexattr
  1279. .long sys_fremovexattr /* 220 */
  1280. .long sys_futex
  1281. .long sys_sched_setaffinity
  1282. .long sys_sched_getaffinity
  1283. .long sys_ni_syscall
  1284. .long sys_ni_syscall /* 225 - reserved for Tux */
  1285. .long sys_sendfile64
  1286. .long sys_io_setup
  1287. .long sys_io_destroy
  1288. .long sys_io_getevents
  1289. .long sys_io_submit /* 230 */
  1290. .long sys_io_cancel
  1291. .long sys_set_tid_address
  1292. .long sys_fadvise64
  1293. .long sys_exit_group
  1294. .long sys_lookup_dcookie /* 235 */
  1295. .long sys_epoll_create
  1296. .long sys_epoll_ctl
  1297. .long sys_epoll_wait
  1298. .long sys_remap_file_pages
  1299. .long sys_timer_create /* 240 */
  1300. .long sys_timer_settime
  1301. .long sys_timer_gettime
  1302. .long sys_timer_getoverrun
  1303. .long sys_timer_delete
  1304. .long sys_clock_settime /* 245 */
  1305. .long sys_clock_gettime
  1306. .long sys_clock_getres
  1307. .long sys_clock_nanosleep
  1308. .long ppc_swapcontext
  1309. .long sys_tgkill /* 250 */
  1310. .long sys_utimes
  1311. .long sys_statfs64
  1312. .long sys_fstatfs64
  1313. .long ppc_fadvise64_64
  1314. .long sys_ni_syscall /* 255 - rtas (used on ppc64) */
  1315. .long sys_debug_setcontext
  1316. .long sys_ni_syscall /* 257 reserved for vserver */
  1317. .long sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */
  1318. .long sys_ni_syscall /* 259 reserved for new sys_mbind */
  1319. .long sys_ni_syscall /* 260 reserved for new sys_get_mempolicy */
  1320. .long sys_ni_syscall /* 261 reserved for new sys_set_mempolicy */
  1321. .long sys_mq_open
  1322. .long sys_mq_unlink
  1323. .long sys_mq_timedsend
  1324. .long sys_mq_timedreceive /* 265 */
  1325. .long sys_mq_notify
  1326. .long sys_mq_getsetattr
  1327. .long sys_kexec_load
  1328. .long sys_add_key
  1329. .long sys_request_key /* 270 */
  1330. .long sys_keyctl
  1331. .long sys_waitid
  1332. .long sys_ioprio_set
  1333. .long sys_ioprio_get
  1334. .long sys_inotify_init /* 275 */
  1335. .long sys_inotify_add_watch
  1336. .long sys_inotify_rm_watch