entry.S 33 KB

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