entry.S 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441
  1. /*
  2. * File: arch/blackfin/mach-common/entry.S
  3. * Based on:
  4. * Author: Linus Torvalds
  5. *
  6. * Created: ?
  7. * Description: contains the system-call and fault low-level handling routines.
  8. * This also contains the timer-interrupt handler, as well as all
  9. * interrupts and faults that can result in a task-switch.
  10. *
  11. * Modified:
  12. * Copyright 2004-2006 Analog Devices Inc.
  13. *
  14. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  15. *
  16. * This program is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU General Public License as published by
  18. * the Free Software Foundation; either version 2 of the License, or
  19. * (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, see the file COPYING, or write
  28. * to the Free Software Foundation, Inc.,
  29. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  30. */
  31. /* NOTE: This code handles signal-recognition, which happens every time
  32. * after a timer-interrupt and after each system call.
  33. */
  34. #include <linux/init.h>
  35. #include <linux/linkage.h>
  36. #include <linux/unistd.h>
  37. #include <asm/blackfin.h>
  38. #include <asm/errno.h>
  39. #include <asm/fixed_code.h>
  40. #include <asm/thread_info.h> /* TIF_NEED_RESCHED */
  41. #include <asm/asm-offsets.h>
  42. #include <asm/trace.h>
  43. #include <asm/mach-common/context.S>
  44. #if defined(CONFIG_BFIN_SCRATCH_REG_RETN)
  45. # define EX_SCRATCH_REG RETN
  46. #elif defined(CONFIG_BFIN_SCRATCH_REG_RETE)
  47. # define EX_SCRATCH_REG RETE
  48. #else
  49. # define EX_SCRATCH_REG CYCLES
  50. #endif
  51. #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
  52. .section .l1.text
  53. #else
  54. .text
  55. #endif
  56. /* Slightly simplified and streamlined entry point for CPLB misses.
  57. * This one does not lower the level to IRQ5, and thus can be used to
  58. * patch up CPLB misses on the kernel stack.
  59. */
  60. #if ANOMALY_05000261
  61. #define _ex_dviol _ex_workaround_261
  62. #define _ex_dmiss _ex_workaround_261
  63. #define _ex_dmult _ex_workaround_261
  64. ENTRY(_ex_workaround_261)
  65. /*
  66. * Work around an anomaly: if we see a new DCPLB fault, return
  67. * without doing anything. Then, if we get the same fault again,
  68. * handle it.
  69. */
  70. P4 = R7; /* Store EXCAUSE */
  71. p5.l = _last_cplb_fault_retx;
  72. p5.h = _last_cplb_fault_retx;
  73. r7 = [p5];
  74. r6 = retx;
  75. [p5] = r6;
  76. cc = r6 == r7;
  77. if !cc jump _bfin_return_from_exception;
  78. /* fall through */
  79. R7 = P4;
  80. R6 = 0x26; /* Data CPLB Miss */
  81. cc = R6 == R7;
  82. if cc jump _ex_dcplb_miss (BP);
  83. R6 = 0x23; /* Data CPLB Miss */
  84. cc = R6 == R7;
  85. if cc jump _ex_dcplb_viol (BP);
  86. /* Handle 0x23 Data CPLB Protection Violation
  87. * and Data CPLB Multiple Hits - Linux Trap Zero
  88. */
  89. jump _ex_trap_c;
  90. ENDPROC(_ex_workaround_261)
  91. #else
  92. #ifdef CONFIG_MPU
  93. #define _ex_dviol _ex_dcplb_viol
  94. #else
  95. #define _ex_dviol _ex_trap_c
  96. #endif
  97. #define _ex_dmiss _ex_dcplb_miss
  98. #define _ex_dmult _ex_trap_c
  99. #endif
  100. ENTRY(_ex_dcplb_viol)
  101. ENTRY(_ex_dcplb_miss)
  102. ENTRY(_ex_icplb_miss)
  103. (R7:6,P5:4) = [sp++];
  104. ASTAT = [sp++];
  105. SAVE_ALL_SYS
  106. #ifdef CONFIG_MPU
  107. /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
  108. * will change the stack pointer. */
  109. R0 = SEQSTAT;
  110. R1 = SP;
  111. #endif
  112. DEBUG_HWTRACE_SAVE(p5, r7)
  113. #ifdef CONFIG_MPU
  114. sp += -12;
  115. call _cplb_hdr;
  116. sp += 12;
  117. CC = R0 == 0;
  118. IF !CC JUMP _handle_bad_cplb;
  119. #else
  120. call __cplb_hdr;
  121. #endif
  122. DEBUG_HWTRACE_RESTORE(p5, r7)
  123. RESTORE_ALL_SYS
  124. SP = EX_SCRATCH_REG;
  125. rtx;
  126. ENDPROC(_ex_icplb_miss)
  127. ENTRY(_ex_syscall)
  128. (R7:6,P5:4) = [sp++];
  129. ASTAT = [sp++];
  130. raise 15; /* invoked by TRAP #0, for sys call */
  131. sp = EX_SCRATCH_REG;
  132. rtx
  133. ENDPROC(_ex_syscall)
  134. ENTRY(_ex_soft_bp)
  135. r7 = retx;
  136. r7 += -2;
  137. retx = r7;
  138. jump.s _ex_trap_c;
  139. ENDPROC(_ex_soft_bp)
  140. ENTRY(_ex_single_step)
  141. /* If we just returned from an interrupt, the single step event is
  142. for the RTI instruction. */
  143. r7 = retx;
  144. r6 = reti;
  145. cc = r7 == r6;
  146. if cc jump _bfin_return_from_exception;
  147. /* Don't do single step in hardware exception handler */
  148. p5.l = lo(IPEND);
  149. p5.h = hi(IPEND);
  150. r6 = [p5];
  151. cc = bittst(r6, 5);
  152. if cc jump _bfin_return_from_exception;
  153. #ifdef CONFIG_KGDB
  154. /* skip single step if current interrupt priority is higher than
  155. * that of the first instruction, from which gdb starts single step */
  156. r6 >>= 6;
  157. r7 = 10;
  158. .Lfind_priority_start:
  159. cc = bittst(r6, 0);
  160. if cc jump .Lfind_priority_done;
  161. r6 >>= 1;
  162. r7 += -1;
  163. cc = r7 == 0;
  164. if cc jump .Lfind_priority_done;
  165. jump.s .Lfind_priority_start;
  166. .Lfind_priority_done:
  167. p4.l = _debugger_step;
  168. p4.h = _debugger_step;
  169. r6 = [p4];
  170. cc = r6 == 0;
  171. if cc jump .Ldo_single_step;
  172. r6 += -1;
  173. cc = r6 < r7;
  174. if cc jump _bfin_return_from_exception;
  175. .Ldo_single_step:
  176. #endif
  177. /* If we were in user mode, do the single step normally. */
  178. r6 = [p5];
  179. r7 = 0xffe0 (z);
  180. r7 = r7 & r6;
  181. cc = r7 == 0;
  182. if cc jump 1f;
  183. /*
  184. * We were in an interrupt handler. By convention, all of them save
  185. * SYSCFG with their first instruction, so by checking whether our
  186. * RETX points at the entry point, we can determine whether to allow
  187. * a single step, or whether to clear SYSCFG.
  188. *
  189. * First, find out the interrupt level and the event vector for it.
  190. */
  191. p5.l = lo(EVT0);
  192. p5.h = hi(EVT0);
  193. p5 += -4;
  194. 2:
  195. r7 = rot r7 by -1;
  196. p5 += 4;
  197. if !cc jump 2b;
  198. /* What we actually do is test for the _second_ instruction in the
  199. * IRQ handler. That way, if there are insns following the restore
  200. * of SYSCFG after leaving the handler, we will not turn off SYSCFG
  201. * for them. */
  202. r7 = [p5];
  203. r7 += 2;
  204. r6 = RETX;
  205. cc = R7 == R6;
  206. if !cc jump _bfin_return_from_exception;
  207. 1:
  208. /* Single stepping only a single instruction, so clear the trace
  209. * bit here. */
  210. r7 = syscfg;
  211. bitclr (r7, 0);
  212. syscfg = R7;
  213. jump _ex_trap_c;
  214. ENDPROC(_ex_single_step)
  215. ENTRY(_bfin_return_from_exception)
  216. #if ANOMALY_05000257
  217. R7=LC0;
  218. LC0=R7;
  219. R7=LC1;
  220. LC1=R7;
  221. #endif
  222. (R7:6,P5:4) = [sp++];
  223. ASTAT = [sp++];
  224. sp = EX_SCRATCH_REG;
  225. rtx;
  226. ENDPROC(_bfin_return_from_exception)
  227. ENTRY(_handle_bad_cplb)
  228. DEBUG_HWTRACE_RESTORE(p5, r7)
  229. /* To get here, we just tried and failed to change a CPLB
  230. * so, handle things in trap_c (C code), by lowering to
  231. * IRQ5, just like we normally do. Since this is not a
  232. * "normal" return path, we have a do alot of stuff to
  233. * the stack to get ready so, we can fall through - we
  234. * need to make a CPLB exception look like a normal exception
  235. */
  236. RESTORE_ALL_SYS
  237. [--sp] = ASTAT;
  238. [--sp] = (R7:6,P5:4);
  239. ENTRY(_ex_replaceable)
  240. nop;
  241. ENTRY(_ex_trap_c)
  242. /* Make sure we are not in a double fault */
  243. p4.l = lo(IPEND);
  244. p4.h = hi(IPEND);
  245. r7 = [p4];
  246. CC = BITTST (r7, 5);
  247. if CC jump _double_fault;
  248. /* Call C code (trap_c) to handle the exception, which most
  249. * likely involves sending a signal to the current process.
  250. * To avoid double faults, lower our priority to IRQ5 first.
  251. */
  252. P5.h = _exception_to_level5;
  253. P5.l = _exception_to_level5;
  254. p4.l = lo(EVT5);
  255. p4.h = hi(EVT5);
  256. [p4] = p5;
  257. csync;
  258. p4.l = lo(DCPLB_FAULT_ADDR);
  259. p4.h = hi(DCPLB_FAULT_ADDR);
  260. r7 = [p4];
  261. p5.h = _saved_dcplb_fault_addr;
  262. p5.l = _saved_dcplb_fault_addr;
  263. [p5] = r7;
  264. r7 = [p4 + (ICPLB_FAULT_ADDR - DCPLB_FAULT_ADDR)];
  265. p5.h = _saved_icplb_fault_addr;
  266. p5.l = _saved_icplb_fault_addr;
  267. [p5] = r7;
  268. p4.l = _excpt_saved_stuff;
  269. p4.h = _excpt_saved_stuff;
  270. r6 = retx;
  271. [p4] = r6;
  272. r6 = SYSCFG;
  273. [p4 + 4] = r6;
  274. BITCLR(r6, 0);
  275. SYSCFG = r6;
  276. /* Disable all interrupts, but make sure level 5 is enabled so
  277. * we can switch to that level. Save the old mask. */
  278. cli r6;
  279. [p4 + 8] = r6;
  280. p4.l = lo(SAFE_USER_INSTRUCTION);
  281. p4.h = hi(SAFE_USER_INSTRUCTION);
  282. retx = p4;
  283. r6 = 0x3f;
  284. sti r6;
  285. (R7:6,P5:4) = [sp++];
  286. ASTAT = [sp++];
  287. SP = EX_SCRATCH_REG;
  288. raise 5;
  289. rtx;
  290. ENDPROC(_ex_trap_c)
  291. /* We just realized we got an exception, while we were processing a different
  292. * exception. This is a unrecoverable event, so crash
  293. */
  294. ENTRY(_double_fault)
  295. /* Turn caches & protection off, to ensure we don't get any more
  296. * double exceptions
  297. */
  298. P4.L = LO(IMEM_CONTROL);
  299. P4.H = HI(IMEM_CONTROL);
  300. R5 = [P4]; /* Control Register*/
  301. BITCLR(R5,ENICPLB_P);
  302. SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
  303. .align 8;
  304. [P4] = R5;
  305. SSYNC;
  306. P4.L = LO(DMEM_CONTROL);
  307. P4.H = HI(DMEM_CONTROL);
  308. R5 = [P4];
  309. BITCLR(R5,ENDCPLB_P);
  310. SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
  311. .align 8;
  312. [P4] = R5;
  313. SSYNC;
  314. /* Fix up the stack */
  315. (R7:6,P5:4) = [sp++];
  316. ASTAT = [sp++];
  317. SP = EX_SCRATCH_REG;
  318. /* We should be out of the exception stack, and back down into
  319. * kernel or user space stack
  320. */
  321. SAVE_ALL_SYS
  322. /* The dumping functions expect the return address in the RETI
  323. * slot. */
  324. r6 = retx;
  325. [sp + PT_PC] = r6;
  326. r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
  327. SP += -12;
  328. call _double_fault_c;
  329. SP += 12;
  330. .L_double_fault_panic:
  331. JUMP .L_double_fault_panic
  332. ENDPROC(_double_fault)
  333. ENTRY(_exception_to_level5)
  334. SAVE_ALL_SYS
  335. p4.l = _excpt_saved_stuff;
  336. p4.h = _excpt_saved_stuff;
  337. r6 = [p4];
  338. [sp + PT_PC] = r6;
  339. r6 = [p4 + 4];
  340. [sp + PT_SYSCFG] = r6;
  341. /* Restore interrupt mask. We haven't pushed RETI, so this
  342. * doesn't enable interrupts until we return from this handler. */
  343. r6 = [p4 + 8];
  344. sti r6;
  345. /* Restore the hardware error vector. */
  346. P5.h = _evt_ivhw;
  347. P5.l = _evt_ivhw;
  348. p4.l = lo(EVT5);
  349. p4.h = hi(EVT5);
  350. [p4] = p5;
  351. csync;
  352. p2.l = lo(IPEND);
  353. p2.h = hi(IPEND);
  354. csync;
  355. r0 = [p2]; /* Read current IPEND */
  356. [sp + PT_IPEND] = r0; /* Store IPEND */
  357. r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
  358. SP += -12;
  359. call _trap_c;
  360. SP += 12;
  361. call _ret_from_exception;
  362. RESTORE_ALL_SYS
  363. rti;
  364. ENDPROC(_exception_to_level5)
  365. ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
  366. /* Since the kernel stack can be anywhere, it's not guaranteed to be
  367. * covered by a CPLB. Switch to an exception stack; use RETN as a
  368. * scratch register (for want of a better option).
  369. */
  370. EX_SCRATCH_REG = sp;
  371. sp.l = _exception_stack_top;
  372. sp.h = _exception_stack_top;
  373. /* Try to deal with syscalls quickly. */
  374. [--sp] = ASTAT;
  375. [--sp] = (R7:6,P5:4);
  376. r7 = SEQSTAT; /* reason code is in bit 5:0 */
  377. r6.l = lo(SEQSTAT_EXCAUSE);
  378. r6.h = hi(SEQSTAT_EXCAUSE);
  379. r7 = r7 & r6;
  380. p5.h = _ex_table;
  381. p5.l = _ex_table;
  382. p4 = r7;
  383. p5 = p5 + (p4 << 2);
  384. p4 = [p5];
  385. jump (p4);
  386. .Lbadsys:
  387. r7 = -ENOSYS; /* signextending enough */
  388. [sp + PT_R0] = r7; /* return value from system call */
  389. jump .Lsyscall_really_exit;
  390. ENDPROC(_trap)
  391. ENTRY(_kernel_execve)
  392. link SIZEOF_PTREGS;
  393. p0 = sp;
  394. r3 = SIZEOF_PTREGS / 4;
  395. r4 = 0(x);
  396. 0:
  397. [p0++] = r4;
  398. r3 += -1;
  399. cc = r3 == 0;
  400. if !cc jump 0b (bp);
  401. p0 = sp;
  402. sp += -16;
  403. [sp + 12] = p0;
  404. call _do_execve;
  405. SP += 16;
  406. cc = r0 == 0;
  407. if ! cc jump 1f;
  408. /* Success. Copy our temporary pt_regs to the top of the kernel
  409. * stack and do a normal exception return.
  410. */
  411. r1 = sp;
  412. r0 = (-KERNEL_STACK_SIZE) (x);
  413. r1 = r1 & r0;
  414. p2 = r1;
  415. p3 = [p2];
  416. r0 = KERNEL_STACK_SIZE - 4 (z);
  417. p1 = r0;
  418. p1 = p1 + p2;
  419. p0 = fp;
  420. r4 = [p0--];
  421. r3 = SIZEOF_PTREGS / 4;
  422. 0:
  423. r4 = [p0--];
  424. [p1--] = r4;
  425. r3 += -1;
  426. cc = r3 == 0;
  427. if ! cc jump 0b (bp);
  428. r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
  429. p1 = r0;
  430. p1 = p1 + p2;
  431. sp = p1;
  432. r0 = syscfg;
  433. [SP + PT_SYSCFG] = r0;
  434. [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
  435. RESTORE_CONTEXT;
  436. rti;
  437. 1:
  438. unlink;
  439. rts;
  440. ENDPROC(_kernel_execve)
  441. ENTRY(_system_call)
  442. /* Store IPEND */
  443. p2.l = lo(IPEND);
  444. p2.h = hi(IPEND);
  445. csync;
  446. r0 = [p2];
  447. [sp + PT_IPEND] = r0;
  448. /* Store RETS for now */
  449. r0 = rets;
  450. [sp + PT_RESERVED] = r0;
  451. /* Set the stack for the current process */
  452. r7 = sp;
  453. r6.l = lo(ALIGN_PAGE_MASK);
  454. r6.h = hi(ALIGN_PAGE_MASK);
  455. r7 = r7 & r6; /* thread_info */
  456. p2 = r7;
  457. p2 = [p2];
  458. [p2+(TASK_THREAD+THREAD_KSP)] = sp;
  459. /* Check the System Call */
  460. r7 = __NR_syscall;
  461. /* System call number is passed in P0 */
  462. r6 = p0;
  463. cc = r6 < r7;
  464. if ! cc jump .Lbadsys;
  465. /* are we tracing syscalls?*/
  466. r7 = sp;
  467. r6.l = lo(ALIGN_PAGE_MASK);
  468. r6.h = hi(ALIGN_PAGE_MASK);
  469. r7 = r7 & r6;
  470. p2 = r7;
  471. r7 = [p2+TI_FLAGS];
  472. CC = BITTST(r7,TIF_SYSCALL_TRACE);
  473. if CC JUMP _sys_trace;
  474. /* Execute the appropriate system call */
  475. p4 = p0;
  476. p5.l = _sys_call_table;
  477. p5.h = _sys_call_table;
  478. p5 = p5 + (p4 << 2);
  479. r0 = [sp + PT_R0];
  480. r1 = [sp + PT_R1];
  481. r2 = [sp + PT_R2];
  482. p5 = [p5];
  483. [--sp] = r5;
  484. [--sp] = r4;
  485. [--sp] = r3;
  486. SP += -12;
  487. call (p5);
  488. SP += 24;
  489. [sp + PT_R0] = r0;
  490. .Lresume_userspace:
  491. r7 = sp;
  492. r4.l = lo(ALIGN_PAGE_MASK);
  493. r4.h = hi(ALIGN_PAGE_MASK);
  494. r7 = r7 & r4; /* thread_info->flags */
  495. p5 = r7;
  496. .Lresume_userspace_1:
  497. /* Disable interrupts. */
  498. [--sp] = reti;
  499. reti = [sp++];
  500. r7 = [p5 + TI_FLAGS];
  501. r4.l = lo(_TIF_WORK_MASK);
  502. r4.h = hi(_TIF_WORK_MASK);
  503. r7 = r7 & r4;
  504. .Lsyscall_resched:
  505. cc = BITTST(r7, TIF_NEED_RESCHED);
  506. if !cc jump .Lsyscall_sigpending;
  507. /* Reenable interrupts. */
  508. [--sp] = reti;
  509. r0 = [sp++];
  510. SP += -12;
  511. call _schedule;
  512. SP += 12;
  513. jump .Lresume_userspace_1;
  514. .Lsyscall_sigpending:
  515. cc = BITTST(r7, TIF_RESTORE_SIGMASK);
  516. if cc jump .Lsyscall_do_signals;
  517. cc = BITTST(r7, TIF_SIGPENDING);
  518. if !cc jump .Lsyscall_really_exit;
  519. .Lsyscall_do_signals:
  520. /* Reenable interrupts. */
  521. [--sp] = reti;
  522. r0 = [sp++];
  523. r0 = sp;
  524. SP += -12;
  525. call _do_signal;
  526. SP += 12;
  527. .Lsyscall_really_exit:
  528. r5 = [sp + PT_RESERVED];
  529. rets = r5;
  530. rts;
  531. ENDPROC(_system_call)
  532. _sys_trace:
  533. call _syscall_trace;
  534. /* Execute the appropriate system call */
  535. p4 = [SP + PT_P0];
  536. p5.l = _sys_call_table;
  537. p5.h = _sys_call_table;
  538. p5 = p5 + (p4 << 2);
  539. r0 = [sp + PT_R0];
  540. r1 = [sp + PT_R1];
  541. r2 = [sp + PT_R2];
  542. r3 = [sp + PT_R3];
  543. r4 = [sp + PT_R4];
  544. r5 = [sp + PT_R5];
  545. p5 = [p5];
  546. [--sp] = r5;
  547. [--sp] = r4;
  548. [--sp] = r3;
  549. SP += -12;
  550. call (p5);
  551. SP += 24;
  552. [sp + PT_R0] = r0;
  553. call _syscall_trace;
  554. jump .Lresume_userspace;
  555. ENDPROC(_sys_trace)
  556. ENTRY(_resume)
  557. /*
  558. * Beware - when entering resume, prev (the current task) is
  559. * in r0, next (the new task) is in r1.
  560. */
  561. p0 = r0;
  562. p1 = r1;
  563. [--sp] = rets;
  564. [--sp] = fp;
  565. [--sp] = (r7:4, p5:3);
  566. /* save usp */
  567. p2 = usp;
  568. [p0+(TASK_THREAD+THREAD_USP)] = p2;
  569. /* save current kernel stack pointer */
  570. [p0+(TASK_THREAD+THREAD_KSP)] = sp;
  571. /* save program counter */
  572. r1.l = _new_old_task;
  573. r1.h = _new_old_task;
  574. [p0+(TASK_THREAD+THREAD_PC)] = r1;
  575. /* restore the kernel stack pointer */
  576. sp = [p1+(TASK_THREAD+THREAD_KSP)];
  577. /* restore user stack pointer */
  578. p0 = [p1+(TASK_THREAD+THREAD_USP)];
  579. usp = p0;
  580. /* restore pc */
  581. p0 = [p1+(TASK_THREAD+THREAD_PC)];
  582. jump (p0);
  583. /*
  584. * Following code actually lands up in a new (old) task.
  585. */
  586. _new_old_task:
  587. (r7:4, p5:3) = [sp++];
  588. fp = [sp++];
  589. rets = [sp++];
  590. /*
  591. * When we come out of resume, r0 carries "old" task, becuase we are
  592. * in "new" task.
  593. */
  594. rts;
  595. ENDPROC(_resume)
  596. ENTRY(_ret_from_exception)
  597. p2.l = lo(IPEND);
  598. p2.h = hi(IPEND);
  599. csync;
  600. r0 = [p2];
  601. [sp + PT_IPEND] = r0;
  602. 1:
  603. r2 = LO(~0x37) (Z);
  604. r0 = r2 & r0;
  605. cc = r0 == 0;
  606. if !cc jump 4f; /* if not return to user mode, get out */
  607. /* Make sure any pending system call or deferred exception
  608. * return in ILAT for this process to get executed, otherwise
  609. * in case context switch happens, system call of
  610. * first process (i.e in ILAT) will be carried
  611. * forward to the switched process
  612. */
  613. p2.l = lo(ILAT);
  614. p2.h = hi(ILAT);
  615. r0 = [p2];
  616. r1 = (EVT_IVG14 | EVT_IVG15) (z);
  617. r0 = r0 & r1;
  618. cc = r0 == 0;
  619. if !cc jump 5f;
  620. /* Set the stack for the current process */
  621. r7 = sp;
  622. r4.l = lo(ALIGN_PAGE_MASK);
  623. r4.h = hi(ALIGN_PAGE_MASK);
  624. r7 = r7 & r4; /* thread_info->flags */
  625. p5 = r7;
  626. r7 = [p5 + TI_FLAGS];
  627. r4.l = lo(_TIF_WORK_MASK);
  628. r4.h = hi(_TIF_WORK_MASK);
  629. r7 = r7 & r4;
  630. cc = r7 == 0;
  631. if cc jump 4f;
  632. p0.l = lo(EVT15);
  633. p0.h = hi(EVT15);
  634. p1.l = _schedule_and_signal;
  635. p1.h = _schedule_and_signal;
  636. [p0] = p1;
  637. csync;
  638. raise 15; /* raise evt14 to do signal or reschedule */
  639. 4:
  640. r0 = syscfg;
  641. bitclr(r0, 0);
  642. syscfg = r0;
  643. 5:
  644. rts;
  645. ENDPROC(_ret_from_exception)
  646. ENTRY(_return_from_int)
  647. /* If someone else already raised IRQ 15, do nothing. */
  648. csync;
  649. p2.l = lo(ILAT);
  650. p2.h = hi(ILAT);
  651. r0 = [p2];
  652. cc = bittst (r0, EVT_IVG15_P);
  653. if cc jump 2f;
  654. /* if not return to user mode, get out */
  655. p2.l = lo(IPEND);
  656. p2.h = hi(IPEND);
  657. r0 = [p2];
  658. r1 = 0x17(Z);
  659. r2 = ~r1;
  660. r2.h = 0;
  661. r0 = r2 & r0;
  662. r1 = 1;
  663. r1 = r0 - r1;
  664. r2 = r0 & r1;
  665. cc = r2 == 0;
  666. if !cc jump 2f;
  667. /* Lower the interrupt level to 15. */
  668. p0.l = lo(EVT15);
  669. p0.h = hi(EVT15);
  670. p1.l = _schedule_and_signal_from_int;
  671. p1.h = _schedule_and_signal_from_int;
  672. [p0] = p1;
  673. csync;
  674. #if ANOMALY_05000281
  675. r0.l = lo(SAFE_USER_INSTRUCTION);
  676. r0.h = hi(SAFE_USER_INSTRUCTION);
  677. reti = r0;
  678. #endif
  679. r0 = 0x801f (z);
  680. STI r0;
  681. raise 15; /* raise evt15 to do signal or reschedule */
  682. rti;
  683. 2:
  684. rts;
  685. ENDPROC(_return_from_int)
  686. ENTRY(_lower_to_irq14)
  687. #if ANOMALY_05000281
  688. r0.l = lo(SAFE_USER_INSTRUCTION);
  689. r0.h = hi(SAFE_USER_INSTRUCTION);
  690. reti = r0;
  691. #endif
  692. r0 = 0x401f;
  693. sti r0;
  694. raise 14;
  695. rti;
  696. ENTRY(_evt14_softirq)
  697. #ifdef CONFIG_DEBUG_HWERR
  698. r0 = 0x3f;
  699. sti r0;
  700. #else
  701. cli r0;
  702. #endif
  703. [--sp] = RETI;
  704. SP += 4;
  705. rts;
  706. _schedule_and_signal_from_int:
  707. /* To end up here, vector 15 was changed - so we have to change it
  708. * back.
  709. */
  710. p0.l = lo(EVT15);
  711. p0.h = hi(EVT15);
  712. p1.l = _evt_system_call;
  713. p1.h = _evt_system_call;
  714. [p0] = p1;
  715. csync;
  716. /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
  717. r0 = -1 (x);
  718. [sp + PT_ORIG_P0] = r0;
  719. p1 = rets;
  720. [sp + PT_RESERVED] = p1;
  721. p0.l = _irq_flags;
  722. p0.h = _irq_flags;
  723. r0 = [p0];
  724. sti r0;
  725. r0 = sp;
  726. sp += -12;
  727. call _finish_atomic_sections;
  728. sp += 12;
  729. jump.s .Lresume_userspace;
  730. _schedule_and_signal:
  731. SAVE_CONTEXT_SYSCALL
  732. /* To end up here, vector 15 was changed - so we have to change it
  733. * back.
  734. */
  735. p0.l = lo(EVT15);
  736. p0.h = hi(EVT15);
  737. p1.l = _evt_system_call;
  738. p1.h = _evt_system_call;
  739. [p0] = p1;
  740. csync;
  741. p0.l = 1f;
  742. p0.h = 1f;
  743. [sp + PT_RESERVED] = P0;
  744. call .Lresume_userspace;
  745. 1:
  746. RESTORE_CONTEXT
  747. rti;
  748. ENDPROC(_lower_to_irq14)
  749. /* We handle this 100% in exception space - to reduce overhead
  750. * Only potiential problem is if the software buffer gets swapped out of the
  751. * CPLB table - then double fault. - so we don't let this happen in other places
  752. */
  753. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
  754. ENTRY(_ex_trace_buff_full)
  755. [--sp] = P3;
  756. [--sp] = P2;
  757. [--sp] = LC0;
  758. [--sp] = LT0;
  759. [--sp] = LB0;
  760. P5.L = _trace_buff_offset;
  761. P5.H = _trace_buff_offset;
  762. P3 = [P5]; /* trace_buff_offset */
  763. P5.L = lo(TBUFSTAT);
  764. P5.H = hi(TBUFSTAT);
  765. R7 = [P5];
  766. R7 <<= 1; /* double, since we need to read twice */
  767. LC0 = R7;
  768. R7 <<= 2; /* need to shift over again,
  769. * to get the number of bytes */
  770. P5.L = lo(TBUF);
  771. P5.H = hi(TBUF);
  772. R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
  773. P2 = R7;
  774. P3 = P3 + P2;
  775. R7 = P3;
  776. R7 = R7 & R6;
  777. P3 = R7;
  778. P2.L = _trace_buff_offset;
  779. P2.H = _trace_buff_offset;
  780. [P2] = P3;
  781. P2.L = _software_trace_buff;
  782. P2.H = _software_trace_buff;
  783. LSETUP (.Lstart, .Lend) LC0;
  784. .Lstart:
  785. R7 = [P5]; /* read TBUF */
  786. P4 = P3 + P2;
  787. [P4] = R7;
  788. P3 += -4;
  789. R7 = P3;
  790. R7 = R7 & R6;
  791. .Lend:
  792. P3 = R7;
  793. LB0 = [sp++];
  794. LT0 = [sp++];
  795. LC0 = [sp++];
  796. P2 = [sp++];
  797. P3 = [sp++];
  798. jump _bfin_return_from_exception;
  799. ENDPROC(_ex_trace_buff_full)
  800. #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
  801. .data
  802. #else
  803. .section .l1.data.B
  804. #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
  805. ENTRY(_trace_buff_offset)
  806. .long 0;
  807. ALIGN
  808. ENTRY(_software_trace_buff)
  809. .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
  810. .long 0
  811. .endr
  812. #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
  813. #if CONFIG_EARLY_PRINTK
  814. __INIT
  815. ENTRY(_early_trap)
  816. SAVE_ALL_SYS
  817. trace_buffer_stop(p0,r0);
  818. /* Turn caches off, to ensure we don't get double exceptions */
  819. P4.L = LO(IMEM_CONTROL);
  820. P4.H = HI(IMEM_CONTROL);
  821. R5 = [P4]; /* Control Register*/
  822. BITCLR(R5,ENICPLB_P);
  823. CLI R1;
  824. SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
  825. .align 8;
  826. [P4] = R5;
  827. SSYNC;
  828. P4.L = LO(DMEM_CONTROL);
  829. P4.H = HI(DMEM_CONTROL);
  830. R5 = [P4];
  831. BITCLR(R5,ENDCPLB_P);
  832. SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
  833. .align 8;
  834. [P4] = R5;
  835. SSYNC;
  836. STI R1;
  837. r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
  838. r1 = RETX;
  839. SP += -12;
  840. call _early_trap_c;
  841. SP += 12;
  842. ENDPROC(_early_trap)
  843. __FINIT
  844. #endif /* CONFIG_EARLY_PRINTK */
  845. /*
  846. * Put these in the kernel data section - that should always be covered by
  847. * a CPLB. This is needed to ensure we don't get double fault conditions
  848. */
  849. #ifdef CONFIG_SYSCALL_TAB_L1
  850. .section .l1.data
  851. #else
  852. .data
  853. #endif
  854. ENTRY(_ex_table)
  855. /* entry for each EXCAUSE[5:0]
  856. * This table must be in sync with the table in ./kernel/traps.c
  857. * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
  858. */
  859. .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
  860. .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
  861. .long _ex_replaceable /* 0x02 - User Defined */
  862. .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
  863. .long _ex_trap_c /* 0x04 - User Defined - dump trace buffer */
  864. .long _ex_replaceable /* 0x05 - User Defined */
  865. .long _ex_replaceable /* 0x06 - User Defined */
  866. .long _ex_replaceable /* 0x07 - User Defined */
  867. .long _ex_replaceable /* 0x08 - User Defined */
  868. .long _ex_replaceable /* 0x09 - User Defined */
  869. .long _ex_replaceable /* 0x0A - User Defined */
  870. .long _ex_replaceable /* 0x0B - User Defined */
  871. .long _ex_replaceable /* 0x0C - User Defined */
  872. .long _ex_replaceable /* 0x0D - User Defined */
  873. .long _ex_replaceable /* 0x0E - User Defined */
  874. .long _ex_replaceable /* 0x0F - User Defined */
  875. .long _ex_single_step /* 0x10 - HW Single step */
  876. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
  877. .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
  878. #else
  879. .long _ex_trap_c /* 0x11 - Trace Buffer Full */
  880. #endif
  881. .long _ex_trap_c /* 0x12 - Reserved */
  882. .long _ex_trap_c /* 0x13 - Reserved */
  883. .long _ex_trap_c /* 0x14 - Reserved */
  884. .long _ex_trap_c /* 0x15 - Reserved */
  885. .long _ex_trap_c /* 0x16 - Reserved */
  886. .long _ex_trap_c /* 0x17 - Reserved */
  887. .long _ex_trap_c /* 0x18 - Reserved */
  888. .long _ex_trap_c /* 0x19 - Reserved */
  889. .long _ex_trap_c /* 0x1A - Reserved */
  890. .long _ex_trap_c /* 0x1B - Reserved */
  891. .long _ex_trap_c /* 0x1C - Reserved */
  892. .long _ex_trap_c /* 0x1D - Reserved */
  893. .long _ex_trap_c /* 0x1E - Reserved */
  894. .long _ex_trap_c /* 0x1F - Reserved */
  895. .long _ex_trap_c /* 0x20 - Reserved */
  896. .long _ex_trap_c /* 0x21 - Undefined Instruction */
  897. .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
  898. .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */
  899. .long _ex_trap_c /* 0x24 - Data access misaligned */
  900. .long _ex_trap_c /* 0x25 - Unrecoverable Event */
  901. .long _ex_dmiss /* 0x26 - Data CPLB Miss */
  902. .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
  903. .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
  904. .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
  905. .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
  906. .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */
  907. .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */
  908. .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
  909. .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
  910. .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
  911. .long _ex_trap_c /* 0x2F - Reserved */
  912. .long _ex_trap_c /* 0x30 - Reserved */
  913. .long _ex_trap_c /* 0x31 - Reserved */
  914. .long _ex_trap_c /* 0x32 - Reserved */
  915. .long _ex_trap_c /* 0x33 - Reserved */
  916. .long _ex_trap_c /* 0x34 - Reserved */
  917. .long _ex_trap_c /* 0x35 - Reserved */
  918. .long _ex_trap_c /* 0x36 - Reserved */
  919. .long _ex_trap_c /* 0x37 - Reserved */
  920. .long _ex_trap_c /* 0x38 - Reserved */
  921. .long _ex_trap_c /* 0x39 - Reserved */
  922. .long _ex_trap_c /* 0x3A - Reserved */
  923. .long _ex_trap_c /* 0x3B - Reserved */
  924. .long _ex_trap_c /* 0x3C - Reserved */
  925. .long _ex_trap_c /* 0x3D - Reserved */
  926. .long _ex_trap_c /* 0x3E - Reserved */
  927. .long _ex_trap_c /* 0x3F - Reserved */
  928. END(_ex_table)
  929. ENTRY(_sys_call_table)
  930. .long _sys_restart_syscall /* 0 */
  931. .long _sys_exit
  932. .long _sys_fork
  933. .long _sys_read
  934. .long _sys_write
  935. .long _sys_open /* 5 */
  936. .long _sys_close
  937. .long _sys_ni_syscall /* old waitpid */
  938. .long _sys_creat
  939. .long _sys_link
  940. .long _sys_unlink /* 10 */
  941. .long _sys_execve
  942. .long _sys_chdir
  943. .long _sys_time
  944. .long _sys_mknod
  945. .long _sys_chmod /* 15 */
  946. .long _sys_chown /* chown16 */
  947. .long _sys_ni_syscall /* old break syscall holder */
  948. .long _sys_ni_syscall /* old stat */
  949. .long _sys_lseek
  950. .long _sys_getpid /* 20 */
  951. .long _sys_mount
  952. .long _sys_ni_syscall /* old umount */
  953. .long _sys_setuid
  954. .long _sys_getuid
  955. .long _sys_stime /* 25 */
  956. .long _sys_ptrace
  957. .long _sys_alarm
  958. .long _sys_ni_syscall /* old fstat */
  959. .long _sys_pause
  960. .long _sys_ni_syscall /* old utime */ /* 30 */
  961. .long _sys_ni_syscall /* old stty syscall holder */
  962. .long _sys_ni_syscall /* old gtty syscall holder */
  963. .long _sys_access
  964. .long _sys_nice
  965. .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
  966. .long _sys_sync
  967. .long _sys_kill
  968. .long _sys_rename
  969. .long _sys_mkdir
  970. .long _sys_rmdir /* 40 */
  971. .long _sys_dup
  972. .long _sys_pipe
  973. .long _sys_times
  974. .long _sys_ni_syscall /* old prof syscall holder */
  975. .long _sys_brk /* 45 */
  976. .long _sys_setgid
  977. .long _sys_getgid
  978. .long _sys_ni_syscall /* old sys_signal */
  979. .long _sys_geteuid /* geteuid16 */
  980. .long _sys_getegid /* getegid16 */ /* 50 */
  981. .long _sys_acct
  982. .long _sys_umount /* recycled never used phys() */
  983. .long _sys_ni_syscall /* old lock syscall holder */
  984. .long _sys_ioctl
  985. .long _sys_fcntl /* 55 */
  986. .long _sys_ni_syscall /* old mpx syscall holder */
  987. .long _sys_setpgid
  988. .long _sys_ni_syscall /* old ulimit syscall holder */
  989. .long _sys_ni_syscall /* old old uname */
  990. .long _sys_umask /* 60 */
  991. .long _sys_chroot
  992. .long _sys_ustat
  993. .long _sys_dup2
  994. .long _sys_getppid
  995. .long _sys_getpgrp /* 65 */
  996. .long _sys_setsid
  997. .long _sys_ni_syscall /* old sys_sigaction */
  998. .long _sys_sgetmask
  999. .long _sys_ssetmask
  1000. .long _sys_setreuid /* setreuid16 */ /* 70 */
  1001. .long _sys_setregid /* setregid16 */
  1002. .long _sys_ni_syscall /* old sys_sigsuspend */
  1003. .long _sys_ni_syscall /* old sys_sigpending */
  1004. .long _sys_sethostname
  1005. .long _sys_setrlimit /* 75 */
  1006. .long _sys_ni_syscall /* old getrlimit */
  1007. .long _sys_getrusage
  1008. .long _sys_gettimeofday
  1009. .long _sys_settimeofday
  1010. .long _sys_getgroups /* getgroups16 */ /* 80 */
  1011. .long _sys_setgroups /* setgroups16 */
  1012. .long _sys_ni_syscall /* old_select */
  1013. .long _sys_symlink
  1014. .long _sys_ni_syscall /* old lstat */
  1015. .long _sys_readlink /* 85 */
  1016. .long _sys_uselib
  1017. .long _sys_ni_syscall /* sys_swapon */
  1018. .long _sys_reboot
  1019. .long _sys_ni_syscall /* old_readdir */
  1020. .long _sys_ni_syscall /* sys_mmap */ /* 90 */
  1021. .long _sys_munmap
  1022. .long _sys_truncate
  1023. .long _sys_ftruncate
  1024. .long _sys_fchmod
  1025. .long _sys_fchown /* fchown16 */ /* 95 */
  1026. .long _sys_getpriority
  1027. .long _sys_setpriority
  1028. .long _sys_ni_syscall /* old profil syscall holder */
  1029. .long _sys_statfs
  1030. .long _sys_fstatfs /* 100 */
  1031. .long _sys_ni_syscall
  1032. .long _sys_ni_syscall /* old sys_socketcall */
  1033. .long _sys_syslog
  1034. .long _sys_setitimer
  1035. .long _sys_getitimer /* 105 */
  1036. .long _sys_newstat
  1037. .long _sys_newlstat
  1038. .long _sys_newfstat
  1039. .long _sys_ni_syscall /* old uname */
  1040. .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
  1041. .long _sys_vhangup
  1042. .long _sys_ni_syscall /* obsolete idle() syscall */
  1043. .long _sys_ni_syscall /* vm86old for i386 */
  1044. .long _sys_wait4
  1045. .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
  1046. .long _sys_sysinfo
  1047. .long _sys_ni_syscall /* old sys_ipc */
  1048. .long _sys_fsync
  1049. .long _sys_ni_syscall /* old sys_sigreturn */
  1050. .long _sys_clone /* 120 */
  1051. .long _sys_setdomainname
  1052. .long _sys_newuname
  1053. .long _sys_ni_syscall /* old sys_modify_ldt */
  1054. .long _sys_adjtimex
  1055. .long _sys_ni_syscall /* 125 */ /* sys_mprotect */
  1056. .long _sys_ni_syscall /* old sys_sigprocmask */
  1057. .long _sys_ni_syscall /* old "creat_module" */
  1058. .long _sys_init_module
  1059. .long _sys_delete_module
  1060. .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
  1061. .long _sys_quotactl
  1062. .long _sys_getpgid
  1063. .long _sys_fchdir
  1064. .long _sys_bdflush
  1065. .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
  1066. .long _sys_personality
  1067. .long _sys_ni_syscall /* for afs_syscall */
  1068. .long _sys_setfsuid /* setfsuid16 */
  1069. .long _sys_setfsgid /* setfsgid16 */
  1070. .long _sys_llseek /* 140 */
  1071. .long _sys_getdents
  1072. .long _sys_ni_syscall /* sys_select */
  1073. .long _sys_flock
  1074. .long _sys_ni_syscall /* sys_msync */
  1075. .long _sys_readv /* 145 */
  1076. .long _sys_writev
  1077. .long _sys_getsid
  1078. .long _sys_fdatasync
  1079. .long _sys_sysctl
  1080. .long _sys_ni_syscall /* 150 */ /* sys_mlock */
  1081. .long _sys_ni_syscall /* sys_munlock */
  1082. .long _sys_ni_syscall /* sys_mlockall */
  1083. .long _sys_ni_syscall /* sys_munlockall */
  1084. .long _sys_sched_setparam
  1085. .long _sys_sched_getparam /* 155 */
  1086. .long _sys_sched_setscheduler
  1087. .long _sys_sched_getscheduler
  1088. .long _sys_sched_yield
  1089. .long _sys_sched_get_priority_max
  1090. .long _sys_sched_get_priority_min /* 160 */
  1091. .long _sys_sched_rr_get_interval
  1092. .long _sys_nanosleep
  1093. .long _sys_mremap
  1094. .long _sys_setresuid /* setresuid16 */
  1095. .long _sys_getresuid /* getresuid16 */ /* 165 */
  1096. .long _sys_ni_syscall /* for vm86 */
  1097. .long _sys_ni_syscall /* old "query_module" */
  1098. .long _sys_ni_syscall /* sys_poll */
  1099. .long _sys_nfsservctl
  1100. .long _sys_setresgid /* setresgid16 */ /* 170 */
  1101. .long _sys_getresgid /* getresgid16 */
  1102. .long _sys_prctl
  1103. .long _sys_rt_sigreturn
  1104. .long _sys_rt_sigaction
  1105. .long _sys_rt_sigprocmask /* 175 */
  1106. .long _sys_rt_sigpending
  1107. .long _sys_rt_sigtimedwait
  1108. .long _sys_rt_sigqueueinfo
  1109. .long _sys_rt_sigsuspend
  1110. .long _sys_pread64 /* 180 */
  1111. .long _sys_pwrite64
  1112. .long _sys_lchown /* lchown16 */
  1113. .long _sys_getcwd
  1114. .long _sys_capget
  1115. .long _sys_capset /* 185 */
  1116. .long _sys_sigaltstack
  1117. .long _sys_sendfile
  1118. .long _sys_ni_syscall /* streams1 */
  1119. .long _sys_ni_syscall /* streams2 */
  1120. .long _sys_vfork /* 190 */
  1121. .long _sys_getrlimit
  1122. .long _sys_mmap2
  1123. .long _sys_truncate64
  1124. .long _sys_ftruncate64
  1125. .long _sys_stat64 /* 195 */
  1126. .long _sys_lstat64
  1127. .long _sys_fstat64
  1128. .long _sys_chown
  1129. .long _sys_getuid
  1130. .long _sys_getgid /* 200 */
  1131. .long _sys_geteuid
  1132. .long _sys_getegid
  1133. .long _sys_setreuid
  1134. .long _sys_setregid
  1135. .long _sys_getgroups /* 205 */
  1136. .long _sys_setgroups
  1137. .long _sys_fchown
  1138. .long _sys_setresuid
  1139. .long _sys_getresuid
  1140. .long _sys_setresgid /* 210 */
  1141. .long _sys_getresgid
  1142. .long _sys_lchown
  1143. .long _sys_setuid
  1144. .long _sys_setgid
  1145. .long _sys_setfsuid /* 215 */
  1146. .long _sys_setfsgid
  1147. .long _sys_pivot_root
  1148. .long _sys_ni_syscall /* sys_mincore */
  1149. .long _sys_ni_syscall /* sys_madvise */
  1150. .long _sys_getdents64 /* 220 */
  1151. .long _sys_fcntl64
  1152. .long _sys_ni_syscall /* reserved for TUX */
  1153. .long _sys_ni_syscall
  1154. .long _sys_gettid
  1155. .long _sys_readahead /* 225 */
  1156. .long _sys_setxattr
  1157. .long _sys_lsetxattr
  1158. .long _sys_fsetxattr
  1159. .long _sys_getxattr
  1160. .long _sys_lgetxattr /* 230 */
  1161. .long _sys_fgetxattr
  1162. .long _sys_listxattr
  1163. .long _sys_llistxattr
  1164. .long _sys_flistxattr
  1165. .long _sys_removexattr /* 235 */
  1166. .long _sys_lremovexattr
  1167. .long _sys_fremovexattr
  1168. .long _sys_tkill
  1169. .long _sys_sendfile64
  1170. .long _sys_futex /* 240 */
  1171. .long _sys_sched_setaffinity
  1172. .long _sys_sched_getaffinity
  1173. .long _sys_ni_syscall /* sys_set_thread_area */
  1174. .long _sys_ni_syscall /* sys_get_thread_area */
  1175. .long _sys_io_setup /* 245 */
  1176. .long _sys_io_destroy
  1177. .long _sys_io_getevents
  1178. .long _sys_io_submit
  1179. .long _sys_io_cancel
  1180. .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
  1181. .long _sys_ni_syscall /* sys_freec_hugepages */
  1182. .long _sys_exit_group
  1183. .long _sys_lookup_dcookie
  1184. .long _sys_bfin_spinlock
  1185. .long _sys_epoll_create /* 255 */
  1186. .long _sys_epoll_ctl
  1187. .long _sys_epoll_wait
  1188. .long _sys_ni_syscall /* remap_file_pages */
  1189. .long _sys_set_tid_address
  1190. .long _sys_timer_create /* 260 */
  1191. .long _sys_timer_settime
  1192. .long _sys_timer_gettime
  1193. .long _sys_timer_getoverrun
  1194. .long _sys_timer_delete
  1195. .long _sys_clock_settime /* 265 */
  1196. .long _sys_clock_gettime
  1197. .long _sys_clock_getres
  1198. .long _sys_clock_nanosleep
  1199. .long _sys_statfs64
  1200. .long _sys_fstatfs64 /* 270 */
  1201. .long _sys_tgkill
  1202. .long _sys_utimes
  1203. .long _sys_fadvise64_64
  1204. .long _sys_ni_syscall /* vserver */
  1205. .long _sys_ni_syscall /* 275, mbind */
  1206. .long _sys_ni_syscall /* get_mempolicy */
  1207. .long _sys_ni_syscall /* set_mempolicy */
  1208. .long _sys_mq_open
  1209. .long _sys_mq_unlink
  1210. .long _sys_mq_timedsend /* 280 */
  1211. .long _sys_mq_timedreceive
  1212. .long _sys_mq_notify
  1213. .long _sys_mq_getsetattr
  1214. .long _sys_ni_syscall /* kexec_load */
  1215. .long _sys_waitid /* 285 */
  1216. .long _sys_add_key
  1217. .long _sys_request_key
  1218. .long _sys_keyctl
  1219. .long _sys_ioprio_set
  1220. .long _sys_ioprio_get /* 290 */
  1221. .long _sys_inotify_init
  1222. .long _sys_inotify_add_watch
  1223. .long _sys_inotify_rm_watch
  1224. .long _sys_ni_syscall /* migrate_pages */
  1225. .long _sys_openat /* 295 */
  1226. .long _sys_mkdirat
  1227. .long _sys_mknodat
  1228. .long _sys_fchownat
  1229. .long _sys_futimesat
  1230. .long _sys_fstatat64 /* 300 */
  1231. .long _sys_unlinkat
  1232. .long _sys_renameat
  1233. .long _sys_linkat
  1234. .long _sys_symlinkat
  1235. .long _sys_readlinkat /* 305 */
  1236. .long _sys_fchmodat
  1237. .long _sys_faccessat
  1238. .long _sys_pselect6
  1239. .long _sys_ppoll
  1240. .long _sys_unshare /* 310 */
  1241. .long _sys_sram_alloc
  1242. .long _sys_sram_free
  1243. .long _sys_dma_memcpy
  1244. .long _sys_accept
  1245. .long _sys_bind /* 315 */
  1246. .long _sys_connect
  1247. .long _sys_getpeername
  1248. .long _sys_getsockname
  1249. .long _sys_getsockopt
  1250. .long _sys_listen /* 320 */
  1251. .long _sys_recv
  1252. .long _sys_recvfrom
  1253. .long _sys_recvmsg
  1254. .long _sys_send
  1255. .long _sys_sendmsg /* 325 */
  1256. .long _sys_sendto
  1257. .long _sys_setsockopt
  1258. .long _sys_shutdown
  1259. .long _sys_socket
  1260. .long _sys_socketpair /* 330 */
  1261. .long _sys_semctl
  1262. .long _sys_semget
  1263. .long _sys_semop
  1264. .long _sys_msgctl
  1265. .long _sys_msgget /* 335 */
  1266. .long _sys_msgrcv
  1267. .long _sys_msgsnd
  1268. .long _sys_shmat
  1269. .long _sys_shmctl
  1270. .long _sys_shmdt /* 340 */
  1271. .long _sys_shmget
  1272. .long _sys_splice
  1273. .long _sys_sync_file_range
  1274. .long _sys_tee
  1275. .long _sys_vmsplice /* 345 */
  1276. .long _sys_epoll_pwait
  1277. .long _sys_utimensat
  1278. .long _sys_signalfd
  1279. .long _sys_timerfd_create
  1280. .long _sys_eventfd /* 350 */
  1281. .long _sys_pread64
  1282. .long _sys_pwrite64
  1283. .long _sys_fadvise64
  1284. .long _sys_set_robust_list
  1285. .long _sys_get_robust_list /* 355 */
  1286. .long _sys_fallocate
  1287. .long _sys_semtimedop
  1288. .long _sys_timerfd_settime
  1289. .long _sys_timerfd_gettime
  1290. .rept NR_syscalls-(.-_sys_call_table)/4
  1291. .long _sys_ni_syscall
  1292. .endr
  1293. /*
  1294. * Used to save the real RETX, IMASK and SYSCFG when temporarily
  1295. * storing safe values across the transition from exception to IRQ5.
  1296. */
  1297. _excpt_saved_stuff:
  1298. .long 0;
  1299. .long 0;
  1300. .long 0;
  1301. _exception_stack:
  1302. .rept 1024
  1303. .long 0;
  1304. .endr
  1305. _exception_stack_top:
  1306. #if ANOMALY_05000261
  1307. /* Used by the assembly entry point to work around an anomaly. */
  1308. _last_cplb_fault_retx:
  1309. .long 0;
  1310. #endif