entry.S 31 KB

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