misc.S 27 KB

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