entry.S 35 KB

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