entry.S 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756
  1. /*
  2. * Contains the system-call and fault low-level handling routines.
  3. * This also contains the timer-interrupt handler, as well as all
  4. * interrupts and faults that can result in a task-switch.
  5. *
  6. * Copyright 2005-2009 Analog Devices Inc.
  7. *
  8. * Licensed under the GPL-2 or later.
  9. */
  10. /* NOTE: This code handles signal-recognition, which happens every time
  11. * after a timer-interrupt and after each system call.
  12. */
  13. #include <linux/init.h>
  14. #include <linux/linkage.h>
  15. #include <linux/unistd.h>
  16. #include <asm/blackfin.h>
  17. #include <asm/errno.h>
  18. #include <asm/fixed_code.h>
  19. #include <asm/thread_info.h> /* TIF_NEED_RESCHED */
  20. #include <asm/asm-offsets.h>
  21. #include <asm/trace.h>
  22. #include <asm/traps.h>
  23. #include <asm/context.S>
  24. #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
  25. .section .l1.text
  26. #else
  27. .text
  28. #endif
  29. /* Slightly simplified and streamlined entry point for CPLB misses.
  30. * This one does not lower the level to IRQ5, and thus can be used to
  31. * patch up CPLB misses on the kernel stack.
  32. */
  33. #if ANOMALY_05000261
  34. #define _ex_dviol _ex_workaround_261
  35. #define _ex_dmiss _ex_workaround_261
  36. #define _ex_dmult _ex_workaround_261
  37. ENTRY(_ex_workaround_261)
  38. /*
  39. * Work around an anomaly: if we see a new DCPLB fault, return
  40. * without doing anything. Then, if we get the same fault again,
  41. * handle it.
  42. */
  43. P4 = R7; /* Store EXCAUSE */
  44. GET_PDA(p5, r7);
  45. r7 = [p5 + PDA_LFRETX];
  46. r6 = retx;
  47. [p5 + PDA_LFRETX] = r6;
  48. cc = r6 == r7;
  49. if !cc jump _bfin_return_from_exception;
  50. /* fall through */
  51. R7 = P4;
  52. R6 = VEC_CPLB_M; /* Data CPLB Miss */
  53. cc = R6 == R7;
  54. if cc jump _ex_dcplb_miss (BP);
  55. #ifdef CONFIG_MPU
  56. R6 = VEC_CPLB_VL; /* Data CPLB Violation */
  57. cc = R6 == R7;
  58. if cc jump _ex_dcplb_viol (BP);
  59. #endif
  60. /* Handle Data CPLB Protection Violation
  61. * and Data CPLB Multiple Hits - Linux Trap Zero
  62. */
  63. jump _ex_trap_c;
  64. ENDPROC(_ex_workaround_261)
  65. #else
  66. #ifdef CONFIG_MPU
  67. #define _ex_dviol _ex_dcplb_viol
  68. #else
  69. #define _ex_dviol _ex_trap_c
  70. #endif
  71. #define _ex_dmiss _ex_dcplb_miss
  72. #define _ex_dmult _ex_trap_c
  73. #endif
  74. ENTRY(_ex_dcplb_viol)
  75. ENTRY(_ex_dcplb_miss)
  76. ENTRY(_ex_icplb_miss)
  77. (R7:6,P5:4) = [sp++];
  78. /* We leave the previously pushed ASTAT on the stack. */
  79. SAVE_CONTEXT_CPLB
  80. /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
  81. * will change the stack pointer. */
  82. R0 = SEQSTAT;
  83. R1 = SP;
  84. DEBUG_HWTRACE_SAVE(p5, r7)
  85. sp += -12;
  86. call _cplb_hdr;
  87. sp += 12;
  88. CC = R0 == 0;
  89. IF !CC JUMP _handle_bad_cplb;
  90. #ifdef CONFIG_DEBUG_DOUBLEFAULT
  91. /* While we were processing this, did we double fault? */
  92. r7 = SEQSTAT; /* reason code is in bit 5:0 */
  93. r6.l = lo(SEQSTAT_EXCAUSE);
  94. r6.h = hi(SEQSTAT_EXCAUSE);
  95. r7 = r7 & r6;
  96. r6 = 0x25;
  97. CC = R7 == R6;
  98. if CC JUMP _double_fault;
  99. #endif
  100. DEBUG_HWTRACE_RESTORE(p5, r7)
  101. RESTORE_CONTEXT_CPLB
  102. ASTAT = [SP++];
  103. SP = EX_SCRATCH_REG;
  104. rtx;
  105. ENDPROC(_ex_icplb_miss)
  106. ENTRY(_ex_syscall)
  107. raise 15; /* invoked by TRAP #0, for sys call */
  108. jump.s _bfin_return_from_exception;
  109. ENDPROC(_ex_syscall)
  110. ENTRY(_ex_single_step)
  111. /* If we just returned from an interrupt, the single step event is
  112. for the RTI instruction. */
  113. r7 = retx;
  114. r6 = reti;
  115. cc = r7 == r6;
  116. if cc jump _bfin_return_from_exception;
  117. #ifdef CONFIG_KGDB
  118. /* Don't do single step in hardware exception handler */
  119. p5.l = lo(IPEND);
  120. p5.h = hi(IPEND);
  121. r6 = [p5];
  122. cc = bittst(r6, 4);
  123. if cc jump _bfin_return_from_exception;
  124. cc = bittst(r6, 5);
  125. if cc jump _bfin_return_from_exception;
  126. /* skip single step if current interrupt priority is higher than
  127. * that of the first instruction, from which gdb starts single step */
  128. r6 >>= 6;
  129. r7 = 10;
  130. .Lfind_priority_start:
  131. cc = bittst(r6, 0);
  132. if cc jump .Lfind_priority_done;
  133. r6 >>= 1;
  134. r7 += -1;
  135. cc = r7 == 0;
  136. if cc jump .Lfind_priority_done;
  137. jump.s .Lfind_priority_start;
  138. .Lfind_priority_done:
  139. p4.l = _kgdb_single_step;
  140. p4.h = _kgdb_single_step;
  141. r6 = [p4];
  142. cc = r6 == 0;
  143. if cc jump .Ldo_single_step;
  144. r6 += -1;
  145. cc = r6 < r7;
  146. if cc jump 1f;
  147. .Ldo_single_step:
  148. #else
  149. /* If we were in user mode, do the single step normally. */
  150. p5.l = lo(IPEND);
  151. p5.h = hi(IPEND);
  152. r6 = [p5];
  153. r7 = 0xffe0 (z);
  154. r7 = r7 & r6;
  155. cc = r7 == 0;
  156. if !cc jump 1f;
  157. #endif
  158. #ifdef CONFIG_EXACT_HWERR
  159. /* Read the ILAT, and to check to see if the process we are
  160. * single stepping caused a previous hardware error
  161. * If so, do not single step, (which lowers to IRQ5, and makes
  162. * us miss the error).
  163. */
  164. p5.l = lo(ILAT);
  165. p5.h = hi(ILAT);
  166. r7 = [p5];
  167. cc = bittst(r7, EVT_IVHW_P);
  168. if cc jump 1f;
  169. #endif
  170. /* Single stepping only a single instruction, so clear the trace
  171. * bit here. */
  172. r7 = syscfg;
  173. bitclr (r7, SYSCFG_SSSTEP_P);
  174. syscfg = R7;
  175. jump _ex_trap_c;
  176. 1:
  177. /*
  178. * We were in an interrupt handler. By convention, all of them save
  179. * SYSCFG with their first instruction, so by checking whether our
  180. * RETX points at the entry point, we can determine whether to allow
  181. * a single step, or whether to clear SYSCFG.
  182. *
  183. * First, find out the interrupt level and the event vector for it.
  184. */
  185. p5.l = lo(EVT0);
  186. p5.h = hi(EVT0);
  187. p5 += -4;
  188. 2:
  189. r7 = rot r7 by -1;
  190. p5 += 4;
  191. if !cc jump 2b;
  192. /* What we actually do is test for the _second_ instruction in the
  193. * IRQ handler. That way, if there are insns following the restore
  194. * of SYSCFG after leaving the handler, we will not turn off SYSCFG
  195. * for them. */
  196. r7 = [p5];
  197. r7 += 2;
  198. r6 = RETX;
  199. cc = R7 == R6;
  200. if !cc jump _bfin_return_from_exception;
  201. r7 = syscfg;
  202. bitclr (r7, SYSCFG_SSSTEP_P); /* Turn off single step */
  203. syscfg = R7;
  204. /* Fall through to _bfin_return_from_exception. */
  205. ENDPROC(_ex_single_step)
  206. ENTRY(_bfin_return_from_exception)
  207. #if ANOMALY_05000257
  208. R7=LC0;
  209. LC0=R7;
  210. R7=LC1;
  211. LC1=R7;
  212. #endif
  213. #ifdef CONFIG_DEBUG_DOUBLEFAULT
  214. /* While we were processing the current exception,
  215. * did we cause another, and double fault?
  216. */
  217. r7 = SEQSTAT; /* reason code is in bit 5:0 */
  218. r6.l = lo(SEQSTAT_EXCAUSE);
  219. r6.h = hi(SEQSTAT_EXCAUSE);
  220. r7 = r7 & r6;
  221. r6 = VEC_UNCOV;
  222. CC = R7 == R6;
  223. if CC JUMP _double_fault;
  224. #endif
  225. (R7:6,P5:4) = [sp++];
  226. ASTAT = [sp++];
  227. sp = EX_SCRATCH_REG;
  228. rtx;
  229. ENDPROC(_bfin_return_from_exception)
  230. ENTRY(_handle_bad_cplb)
  231. DEBUG_HWTRACE_RESTORE(p5, r7)
  232. /* To get here, we just tried and failed to change a CPLB
  233. * so, handle things in trap_c (C code), by lowering to
  234. * IRQ5, just like we normally do. Since this is not a
  235. * "normal" return path, we have a do a lot of stuff to
  236. * the stack to get ready so, we can fall through - we
  237. * need to make a CPLB exception look like a normal exception
  238. */
  239. RESTORE_CONTEXT_CPLB
  240. /* ASTAT is still on the stack, where it is needed. */
  241. [--sp] = (R7:6,P5:4);
  242. ENTRY(_ex_replaceable)
  243. nop;
  244. ENTRY(_ex_trap_c)
  245. /* The only thing that has been saved in this context is
  246. * (R7:6,P5:4), ASTAT & SP - don't use anything else
  247. */
  248. GET_PDA(p5, r6);
  249. /* Make sure we are not in a double fault */
  250. p4.l = lo(IPEND);
  251. p4.h = hi(IPEND);
  252. r7 = [p4];
  253. CC = BITTST (r7, 5);
  254. if CC jump _double_fault;
  255. [p5 + PDA_EXIPEND] = r7;
  256. /* Call C code (trap_c) to handle the exception, which most
  257. * likely involves sending a signal to the current process.
  258. * To avoid double faults, lower our priority to IRQ5 first.
  259. */
  260. r7.h = _exception_to_level5;
  261. r7.l = _exception_to_level5;
  262. p4.l = lo(EVT5);
  263. p4.h = hi(EVT5);
  264. [p4] = r7;
  265. csync;
  266. /*
  267. * Save these registers, as they are only valid in exception context
  268. * (where we are now - as soon as we defer to IRQ5, they can change)
  269. * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
  270. * but they are not very interesting, so don't save them
  271. */
  272. p4.l = lo(DCPLB_FAULT_ADDR);
  273. p4.h = hi(DCPLB_FAULT_ADDR);
  274. r7 = [p4];
  275. [p5 + PDA_DCPLB] = r7;
  276. p4.l = lo(ICPLB_FAULT_ADDR);
  277. p4.h = hi(ICPLB_FAULT_ADDR);
  278. r6 = [p4];
  279. [p5 + PDA_ICPLB] = r6;
  280. r6 = retx;
  281. [p5 + PDA_RETX] = r6;
  282. r6 = SEQSTAT;
  283. [p5 + PDA_SEQSTAT] = r6;
  284. /* Save the state of single stepping */
  285. r6 = SYSCFG;
  286. [p5 + PDA_SYSCFG] = r6;
  287. /* Clear it while we handle the exception in IRQ5 mode */
  288. BITCLR(r6, SYSCFG_SSSTEP_P);
  289. SYSCFG = r6;
  290. /* Save the current IMASK, since we change in order to jump to level 5 */
  291. cli r6;
  292. [p5 + PDA_EXIMASK] = r6;
  293. p4.l = lo(SAFE_USER_INSTRUCTION);
  294. p4.h = hi(SAFE_USER_INSTRUCTION);
  295. retx = p4;
  296. /* Disable all interrupts, but make sure level 5 is enabled so
  297. * we can switch to that level.
  298. */
  299. r6 = 0x3f;
  300. sti r6;
  301. /* In case interrupts are disabled IPEND[4] (global interrupt disable bit)
  302. * clear it (re-enabling interrupts again) by the special sequence of pushing
  303. * RETI onto the stack. This way we can lower ourselves to IVG5 even if the
  304. * exception was taken after the interrupt handler was called but before it
  305. * got a chance to enable global interrupts itself.
  306. */
  307. [--sp] = reti;
  308. sp += 4;
  309. raise 5;
  310. jump.s _bfin_return_from_exception;
  311. ENDPROC(_ex_trap_c)
  312. /* We just realized we got an exception, while we were processing a different
  313. * exception. This is a unrecoverable event, so crash.
  314. * Note: this cannot be ENTRY() as we jump here with "if cc jump" ...
  315. */
  316. ENTRY(_double_fault)
  317. /* Turn caches & protection off, to ensure we don't get any more
  318. * double exceptions
  319. */
  320. P4.L = LO(IMEM_CONTROL);
  321. P4.H = HI(IMEM_CONTROL);
  322. R5 = [P4]; /* Control Register*/
  323. BITCLR(R5,ENICPLB_P);
  324. CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
  325. [P4] = R5;
  326. SSYNC;
  327. P4.L = LO(DMEM_CONTROL);
  328. P4.H = HI(DMEM_CONTROL);
  329. R5 = [P4];
  330. BITCLR(R5,ENDCPLB_P);
  331. CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
  332. [P4] = R5;
  333. SSYNC;
  334. /* Fix up the stack */
  335. (R7:6,P5:4) = [sp++];
  336. ASTAT = [sp++];
  337. SP = EX_SCRATCH_REG;
  338. /* We should be out of the exception stack, and back down into
  339. * kernel or user space stack
  340. */
  341. SAVE_ALL_SYS
  342. /* The dumping functions expect the return address in the RETI
  343. * slot. */
  344. r6 = retx;
  345. [sp + PT_PC] = r6;
  346. r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
  347. SP += -12;
  348. pseudo_long_call _double_fault_c, p5;
  349. SP += 12;
  350. .L_double_fault_panic:
  351. JUMP .L_double_fault_panic
  352. ENDPROC(_double_fault)
  353. ENTRY(_exception_to_level5)
  354. SAVE_ALL_SYS
  355. GET_PDA(p5, r7); /* Fetch current PDA */
  356. r6 = [p5 + PDA_RETX];
  357. [sp + PT_PC] = r6;
  358. r6 = [p5 + PDA_SYSCFG];
  359. [sp + PT_SYSCFG] = r6;
  360. r6 = [p5 + PDA_SEQSTAT]; /* Read back seqstat */
  361. [sp + PT_SEQSTAT] = r6;
  362. /* Restore the hardware error vector. */
  363. r7.h = _evt_ivhw;
  364. r7.l = _evt_ivhw;
  365. p4.l = lo(EVT5);
  366. p4.h = hi(EVT5);
  367. [p4] = r7;
  368. csync;
  369. #ifdef CONFIG_DEBUG_DOUBLEFAULT
  370. /* Now that we have the hardware error vector programmed properly
  371. * we can re-enable interrupts (IPEND[4]), so if the _trap_c causes
  372. * another hardware error, we can catch it (self-nesting).
  373. */
  374. [--sp] = reti;
  375. sp += 4;
  376. #endif
  377. r7 = [p5 + PDA_EXIPEND] /* Read the IPEND from the Exception state */
  378. [sp + PT_IPEND] = r7; /* Store IPEND onto the stack */
  379. r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
  380. SP += -12;
  381. pseudo_long_call _trap_c, p4;
  382. SP += 12;
  383. /* If interrupts were off during the exception (IPEND[4] = 1), turn them off
  384. * before we return.
  385. */
  386. CC = BITTST(r7, EVT_IRPTEN_P)
  387. if !CC jump 1f;
  388. /* this will load a random value into the reti register - but that is OK,
  389. * since we do restore it to the correct value in the 'RESTORE_ALL_SYS' macro
  390. */
  391. sp += -4;
  392. reti = [sp++];
  393. 1:
  394. /* restore the interrupt mask (IMASK) */
  395. r6 = [p5 + PDA_EXIMASK];
  396. sti r6;
  397. call _ret_from_exception;
  398. RESTORE_ALL_SYS
  399. rti;
  400. ENDPROC(_exception_to_level5)
  401. ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
  402. /* Since the kernel stack can be anywhere, it's not guaranteed to be
  403. * covered by a CPLB. Switch to an exception stack; use RETN as a
  404. * scratch register (for want of a better option).
  405. */
  406. EX_SCRATCH_REG = sp;
  407. GET_PDA_SAFE(sp);
  408. sp = [sp + PDA_EXSTACK];
  409. /* Try to deal with syscalls quickly. */
  410. [--sp] = ASTAT;
  411. [--sp] = (R7:6,P5:4);
  412. ANOMALY_283_315_WORKAROUND(p5, r7)
  413. #ifdef CONFIG_EXACT_HWERR
  414. /* Make sure all pending read/writes complete. This will ensure any
  415. * accesses which could cause hardware errors completes, and signal
  416. * the the hardware before we do something silly, like crash the
  417. * kernel. We don't need to work around anomaly 05000312, since
  418. * we are already atomic
  419. */
  420. ssync;
  421. #endif
  422. #ifdef CONFIG_DEBUG_DOUBLEFAULT
  423. /*
  424. * Save these registers, as they are only valid in exception context
  425. * (where we are now - as soon as we defer to IRQ5, they can change)
  426. * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
  427. * but they are not very interesting, so don't save them
  428. */
  429. GET_PDA(p5, r7);
  430. p4.l = lo(DCPLB_FAULT_ADDR);
  431. p4.h = hi(DCPLB_FAULT_ADDR);
  432. r7 = [p4];
  433. [p5 + PDA_DF_DCPLB] = r7;
  434. p4.l = lo(ICPLB_FAULT_ADDR);
  435. p4.h = hi(ICPLB_FAULT_ADDR);
  436. r7 = [p4];
  437. [p5 + PDA_DF_ICPLB] = r7;
  438. r7 = retx;
  439. [p5 + PDA_DF_RETX] = r7;
  440. r7 = SEQSTAT; /* reason code is in bit 5:0 */
  441. [p5 + PDA_DF_SEQSTAT] = r7;
  442. #else
  443. r7 = SEQSTAT; /* reason code is in bit 5:0 */
  444. #endif
  445. r6.l = lo(SEQSTAT_EXCAUSE);
  446. r6.h = hi(SEQSTAT_EXCAUSE);
  447. r7 = r7 & r6;
  448. p5.h = _ex_table;
  449. p5.l = _ex_table;
  450. p4 = r7;
  451. p5 = p5 + (p4 << 2);
  452. p4 = [p5];
  453. jump (p4);
  454. .Lbadsys:
  455. r7 = -ENOSYS; /* signextending enough */
  456. [sp + PT_R0] = r7; /* return value from system call */
  457. jump .Lsyscall_really_exit;
  458. ENDPROC(_trap)
  459. ENTRY(_kernel_execve)
  460. link SIZEOF_PTREGS;
  461. p0 = sp;
  462. r3 = SIZEOF_PTREGS / 4;
  463. r4 = 0(x);
  464. .Lclear_regs:
  465. [p0++] = r4;
  466. r3 += -1;
  467. cc = r3 == 0;
  468. if !cc jump .Lclear_regs (bp);
  469. p0 = sp;
  470. sp += -16;
  471. [sp + 12] = p0;
  472. pseudo_long_call _do_execve, p5;
  473. SP += 16;
  474. cc = r0 == 0;
  475. if ! cc jump .Lexecve_failed;
  476. /* Success. Copy our temporary pt_regs to the top of the kernel
  477. * stack and do a normal exception return.
  478. */
  479. r1 = sp;
  480. r0 = (-KERNEL_STACK_SIZE) (x);
  481. r1 = r1 & r0;
  482. p2 = r1;
  483. p3 = [p2];
  484. r0 = KERNEL_STACK_SIZE - 4 (z);
  485. p1 = r0;
  486. p1 = p1 + p2;
  487. p0 = fp;
  488. r4 = [p0--];
  489. r3 = SIZEOF_PTREGS / 4;
  490. .Lcopy_regs:
  491. r4 = [p0--];
  492. [p1--] = r4;
  493. r3 += -1;
  494. cc = r3 == 0;
  495. if ! cc jump .Lcopy_regs (bp);
  496. r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
  497. p1 = r0;
  498. p1 = p1 + p2;
  499. sp = p1;
  500. r0 = syscfg;
  501. [SP + PT_SYSCFG] = r0;
  502. [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
  503. RESTORE_CONTEXT;
  504. rti;
  505. .Lexecve_failed:
  506. unlink;
  507. rts;
  508. ENDPROC(_kernel_execve)
  509. ENTRY(_system_call)
  510. /* Store IPEND */
  511. p2.l = lo(IPEND);
  512. p2.h = hi(IPEND);
  513. csync;
  514. r0 = [p2];
  515. [sp + PT_IPEND] = r0;
  516. /* Store RETS for now */
  517. r0 = rets;
  518. [sp + PT_RESERVED] = r0;
  519. /* Set the stack for the current process */
  520. r7 = sp;
  521. r6.l = lo(ALIGN_PAGE_MASK);
  522. r6.h = hi(ALIGN_PAGE_MASK);
  523. r7 = r7 & r6; /* thread_info */
  524. p2 = r7;
  525. p2 = [p2];
  526. [p2+(TASK_THREAD+THREAD_KSP)] = sp;
  527. #ifdef CONFIG_IPIPE
  528. r0 = sp;
  529. SP += -12;
  530. pseudo_long_call ___ipipe_syscall_root, p0;
  531. SP += 12;
  532. cc = r0 == 1;
  533. if cc jump .Lsyscall_really_exit;
  534. cc = r0 == -1;
  535. if cc jump .Lresume_userspace;
  536. r3 = [sp + PT_R3];
  537. r4 = [sp + PT_R4];
  538. p0 = [sp + PT_ORIG_P0];
  539. #endif /* CONFIG_IPIPE */
  540. /* are we tracing syscalls?*/
  541. r7 = sp;
  542. r6.l = lo(ALIGN_PAGE_MASK);
  543. r6.h = hi(ALIGN_PAGE_MASK);
  544. r7 = r7 & r6;
  545. p2 = r7;
  546. r7 = [p2+TI_FLAGS];
  547. CC = BITTST(r7,TIF_SYSCALL_TRACE);
  548. if CC JUMP _sys_trace;
  549. CC = BITTST(r7,TIF_SINGLESTEP);
  550. if CC JUMP _sys_trace;
  551. /* Make sure the system call # is valid */
  552. p4 = __NR_syscall;
  553. /* System call number is passed in P0 */
  554. cc = p4 <= p0;
  555. if cc jump .Lbadsys;
  556. /* Execute the appropriate system call */
  557. p4 = p0;
  558. p5.l = _sys_call_table;
  559. p5.h = _sys_call_table;
  560. p5 = p5 + (p4 << 2);
  561. r0 = [sp + PT_R0];
  562. r1 = [sp + PT_R1];
  563. r2 = [sp + PT_R2];
  564. p5 = [p5];
  565. [--sp] = r5;
  566. [--sp] = r4;
  567. [--sp] = r3;
  568. SP += -12;
  569. call (p5);
  570. SP += 24;
  571. [sp + PT_R0] = r0;
  572. .Lresume_userspace:
  573. r7 = sp;
  574. r4.l = lo(ALIGN_PAGE_MASK);
  575. r4.h = hi(ALIGN_PAGE_MASK);
  576. r7 = r7 & r4; /* thread_info->flags */
  577. p5 = r7;
  578. .Lresume_userspace_1:
  579. /* Disable interrupts. */
  580. [--sp] = reti;
  581. reti = [sp++];
  582. r7 = [p5 + TI_FLAGS];
  583. r4.l = lo(_TIF_WORK_MASK);
  584. r4.h = hi(_TIF_WORK_MASK);
  585. r7 = r7 & r4;
  586. .Lsyscall_resched:
  587. #ifdef CONFIG_IPIPE
  588. cc = BITTST(r7, TIF_IRQ_SYNC);
  589. if !cc jump .Lsyscall_no_irqsync;
  590. /*
  591. * Clear IPEND[4] manually to undo what resume_userspace_1 just did;
  592. * we need this so that high priority domain interrupts may still
  593. * preempt the current domain while the pipeline log is being played
  594. * back.
  595. */
  596. [--sp] = reti;
  597. SP += 4; /* don't merge with next insn to keep the pattern obvious */
  598. SP += -12;
  599. pseudo_long_call ___ipipe_sync_root, p4;
  600. SP += 12;
  601. jump .Lresume_userspace_1;
  602. .Lsyscall_no_irqsync:
  603. #endif
  604. cc = BITTST(r7, TIF_NEED_RESCHED);
  605. if !cc jump .Lsyscall_sigpending;
  606. /* Reenable interrupts. */
  607. [--sp] = reti;
  608. sp += 4;
  609. SP += -12;
  610. pseudo_long_call _schedule, p4;
  611. SP += 12;
  612. jump .Lresume_userspace_1;
  613. .Lsyscall_sigpending:
  614. cc = BITTST(r7, TIF_SIGPENDING);
  615. if cc jump .Lsyscall_do_signals;
  616. cc = BITTST(r7, TIF_NOTIFY_RESUME);
  617. if !cc jump .Lsyscall_really_exit;
  618. .Lsyscall_do_signals:
  619. /* Reenable interrupts. */
  620. [--sp] = reti;
  621. sp += 4;
  622. r0 = sp;
  623. SP += -12;
  624. pseudo_long_call _do_notify_resume, p5;
  625. SP += 12;
  626. .Lsyscall_really_exit:
  627. r5 = [sp + PT_RESERVED];
  628. rets = r5;
  629. rts;
  630. ENDPROC(_system_call)
  631. /* Do not mark as ENTRY() to avoid error in assembler ...
  632. * this symbol need not be global anyways, so ...
  633. */
  634. _sys_trace:
  635. r0 = sp;
  636. pseudo_long_call _syscall_trace_enter, p5;
  637. /* Make sure the system call # is valid */
  638. p4 = [SP + PT_P0];
  639. p3 = __NR_syscall;
  640. cc = p3 <= p4;
  641. r0 = -ENOSYS;
  642. if cc jump .Lsys_trace_badsys;
  643. /* Execute the appropriate system call */
  644. p5.l = _sys_call_table;
  645. p5.h = _sys_call_table;
  646. p5 = p5 + (p4 << 2);
  647. r0 = [sp + PT_R0];
  648. r1 = [sp + PT_R1];
  649. r2 = [sp + PT_R2];
  650. r3 = [sp + PT_R3];
  651. r4 = [sp + PT_R4];
  652. r5 = [sp + PT_R5];
  653. p5 = [p5];
  654. [--sp] = r5;
  655. [--sp] = r4;
  656. [--sp] = r3;
  657. SP += -12;
  658. call (p5);
  659. SP += 24;
  660. .Lsys_trace_badsys:
  661. [sp + PT_R0] = r0;
  662. r0 = sp;
  663. pseudo_long_call _syscall_trace_leave, p5;
  664. jump .Lresume_userspace;
  665. ENDPROC(_sys_trace)
  666. ENTRY(_resume)
  667. /*
  668. * Beware - when entering resume, prev (the current task) is
  669. * in r0, next (the new task) is in r1.
  670. */
  671. p0 = r0;
  672. p1 = r1;
  673. [--sp] = rets;
  674. [--sp] = fp;
  675. [--sp] = (r7:4, p5:3);
  676. /* save usp */
  677. p2 = usp;
  678. [p0+(TASK_THREAD+THREAD_USP)] = p2;
  679. /* save current kernel stack pointer */
  680. [p0+(TASK_THREAD+THREAD_KSP)] = sp;
  681. /* save program counter */
  682. r1.l = _new_old_task;
  683. r1.h = _new_old_task;
  684. [p0+(TASK_THREAD+THREAD_PC)] = r1;
  685. /* restore the kernel stack pointer */
  686. sp = [p1+(TASK_THREAD+THREAD_KSP)];
  687. /* restore user stack pointer */
  688. p0 = [p1+(TASK_THREAD+THREAD_USP)];
  689. usp = p0;
  690. /* restore pc */
  691. p0 = [p1+(TASK_THREAD+THREAD_PC)];
  692. jump (p0);
  693. /*
  694. * Following code actually lands up in a new (old) task.
  695. */
  696. _new_old_task:
  697. (r7:4, p5:3) = [sp++];
  698. fp = [sp++];
  699. rets = [sp++];
  700. /*
  701. * When we come out of resume, r0 carries "old" task, because we are
  702. * in "new" task.
  703. */
  704. rts;
  705. ENDPROC(_resume)
  706. ENTRY(_ret_from_exception)
  707. #ifdef CONFIG_IPIPE
  708. p2.l = _ipipe_percpu_domain;
  709. p2.h = _ipipe_percpu_domain;
  710. r0.l = _ipipe_root;
  711. r0.h = _ipipe_root;
  712. r2 = [p2];
  713. cc = r0 == r2;
  714. if !cc jump 4f; /* not on behalf of the root domain, get out */
  715. #endif /* CONFIG_IPIPE */
  716. p2.l = lo(IPEND);
  717. p2.h = hi(IPEND);
  718. csync;
  719. r0 = [p2];
  720. [sp + PT_IPEND] = r0;
  721. 1:
  722. r2 = LO(~0x37) (Z);
  723. r0 = r2 & r0;
  724. cc = r0 == 0;
  725. if !cc jump 4f; /* if not return to user mode, get out */
  726. /* Make sure any pending system call or deferred exception
  727. * return in ILAT for this process to get executed, otherwise
  728. * in case context switch happens, system call of
  729. * first process (i.e in ILAT) will be carried
  730. * forward to the switched process
  731. */
  732. p2.l = lo(ILAT);
  733. p2.h = hi(ILAT);
  734. r0 = [p2];
  735. r1 = (EVT_IVG14 | EVT_IVG15) (z);
  736. r0 = r0 & r1;
  737. cc = r0 == 0;
  738. if !cc jump 5f;
  739. /* Set the stack for the current process */
  740. r7 = sp;
  741. r4.l = lo(ALIGN_PAGE_MASK);
  742. r4.h = hi(ALIGN_PAGE_MASK);
  743. r7 = r7 & r4; /* thread_info->flags */
  744. p5 = r7;
  745. r7 = [p5 + TI_FLAGS];
  746. r4.l = lo(_TIF_WORK_MASK);
  747. r4.h = hi(_TIF_WORK_MASK);
  748. r7 = r7 & r4;
  749. cc = r7 == 0;
  750. if cc jump 4f;
  751. p0.l = lo(EVT15);
  752. p0.h = hi(EVT15);
  753. p1.l = _schedule_and_signal;
  754. p1.h = _schedule_and_signal;
  755. [p0] = p1;
  756. csync;
  757. raise 15; /* raise evt15 to do signal or reschedule */
  758. 4:
  759. r0 = syscfg;
  760. bitclr(r0, SYSCFG_SSSTEP_P); /* Turn off single step */
  761. syscfg = r0;
  762. 5:
  763. rts;
  764. ENDPROC(_ret_from_exception)
  765. #if defined(CONFIG_PREEMPT)
  766. ENTRY(_up_to_irq14)
  767. #if ANOMALY_05000281 || ANOMALY_05000461
  768. r0.l = lo(SAFE_USER_INSTRUCTION);
  769. r0.h = hi(SAFE_USER_INSTRUCTION);
  770. reti = r0;
  771. #endif
  772. #ifdef CONFIG_DEBUG_HWERR
  773. /* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */
  774. r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
  775. #else
  776. /* Only enable irq14 interrupt, until we transition to _evt_evt14 */
  777. r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
  778. #endif
  779. sti r0;
  780. p0.l = lo(EVT14);
  781. p0.h = hi(EVT14);
  782. p1.l = _evt_up_evt14;
  783. p1.h = _evt_up_evt14;
  784. [p0] = p1;
  785. csync;
  786. raise 14;
  787. 1:
  788. jump 1b;
  789. ENDPROC(_up_to_irq14)
  790. ENTRY(_evt_up_evt14)
  791. #ifdef CONFIG_DEBUG_HWERR
  792. r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
  793. sti r0;
  794. #else
  795. cli r0;
  796. #endif
  797. #ifdef CONFIG_TRACE_IRQFLAGS
  798. [--sp] = rets;
  799. sp += -12;
  800. call _trace_hardirqs_off;
  801. sp += 12;
  802. rets = [sp++];
  803. #endif
  804. [--sp] = RETI;
  805. SP += 4;
  806. /* restore normal evt14 */
  807. p0.l = lo(EVT14);
  808. p0.h = hi(EVT14);
  809. p1.l = _evt_evt14;
  810. p1.h = _evt_evt14;
  811. [p0] = p1;
  812. csync;
  813. rts;
  814. ENDPROC(_evt_up_evt14)
  815. #endif
  816. #ifdef CONFIG_IPIPE
  817. _resume_kernel_from_int:
  818. r1 = LO(~0x8000) (Z);
  819. r1 = r0 & r1;
  820. r0 = 1;
  821. r0 = r1 - r0;
  822. r2 = r1 & r0;
  823. cc = r2 == 0;
  824. /* Sync the root stage only from the outer interrupt level. */
  825. if !cc jump .Lnosync;
  826. r0.l = ___ipipe_sync_root;
  827. r0.h = ___ipipe_sync_root;
  828. [--sp] = reti;
  829. [--sp] = rets;
  830. [--sp] = ( r7:4, p5:3 );
  831. SP += -12;
  832. call ___ipipe_call_irqtail
  833. SP += 12;
  834. ( r7:4, p5:3 ) = [sp++];
  835. rets = [sp++];
  836. reti = [sp++];
  837. .Lnosync:
  838. rts
  839. #elif defined(CONFIG_PREEMPT)
  840. _resume_kernel_from_int:
  841. /* check preempt_count */
  842. r7 = sp;
  843. r4.l = lo(ALIGN_PAGE_MASK);
  844. r4.h = hi(ALIGN_PAGE_MASK);
  845. r7 = r7 & r4;
  846. p5 = r7;
  847. r7 = [p5 + TI_PREEMPT];
  848. cc = r7 == 0x0;
  849. if !cc jump .Lreturn_to_kernel;
  850. .Lneed_schedule:
  851. r7 = [p5 + TI_FLAGS];
  852. r4.l = lo(_TIF_WORK_MASK);
  853. r4.h = hi(_TIF_WORK_MASK);
  854. r7 = r7 & r4;
  855. cc = BITTST(r7, TIF_NEED_RESCHED);
  856. if !cc jump .Lreturn_to_kernel;
  857. /*
  858. * let schedule done at level 15, otherwise sheduled process will run
  859. * at high level and block low level interrupt
  860. */
  861. r6 = reti; /* save reti */
  862. r5.l = .Lkernel_schedule;
  863. r5.h = .Lkernel_schedule;
  864. reti = r5;
  865. rti;
  866. .Lkernel_schedule:
  867. [--sp] = rets;
  868. sp += -12;
  869. pseudo_long_call _preempt_schedule_irq, p4;
  870. sp += 12;
  871. rets = [sp++];
  872. [--sp] = rets;
  873. sp += -12;
  874. /* up to irq14 so that reti after restore_all can return to irq15(kernel) */
  875. pseudo_long_call _up_to_irq14, p4;
  876. sp += 12;
  877. rets = [sp++];
  878. reti = r6; /* restore reti so that origin process can return to interrupted point */
  879. jump .Lneed_schedule;
  880. #else
  881. #define _resume_kernel_from_int .Lreturn_to_kernel
  882. #endif
  883. ENTRY(_return_from_int)
  884. /* If someone else already raised IRQ 15, do nothing. */
  885. csync;
  886. p2.l = lo(ILAT);
  887. p2.h = hi(ILAT);
  888. r0 = [p2];
  889. cc = bittst (r0, EVT_IVG15_P);
  890. if cc jump .Lreturn_to_kernel;
  891. /* if not return to user mode, get out */
  892. p2.l = lo(IPEND);
  893. p2.h = hi(IPEND);
  894. r0 = [p2];
  895. r1 = 0x17(Z);
  896. r2 = ~r1;
  897. r2.h = 0;
  898. r0 = r2 & r0;
  899. r1 = 1;
  900. r1 = r0 - r1;
  901. r2 = r0 & r1;
  902. cc = r2 == 0;
  903. if !cc jump _resume_kernel_from_int;
  904. /* Lower the interrupt level to 15. */
  905. p0.l = lo(EVT15);
  906. p0.h = hi(EVT15);
  907. p1.l = _schedule_and_signal_from_int;
  908. p1.h = _schedule_and_signal_from_int;
  909. [p0] = p1;
  910. csync;
  911. #if ANOMALY_05000281 || ANOMALY_05000461
  912. r0.l = lo(SAFE_USER_INSTRUCTION);
  913. r0.h = hi(SAFE_USER_INSTRUCTION);
  914. reti = r0;
  915. #endif
  916. r0 = 0x801f (z);
  917. STI r0;
  918. raise 15; /* raise evt15 to do signal or reschedule */
  919. rti;
  920. .Lreturn_to_kernel:
  921. rts;
  922. ENDPROC(_return_from_int)
  923. ENTRY(_lower_to_irq14)
  924. #if ANOMALY_05000281 || ANOMALY_05000461
  925. r0.l = lo(SAFE_USER_INSTRUCTION);
  926. r0.h = hi(SAFE_USER_INSTRUCTION);
  927. reti = r0;
  928. #endif
  929. #ifdef CONFIG_DEBUG_HWERR
  930. /* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */
  931. r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
  932. #else
  933. /* Only enable irq14 interrupt, until we transition to _evt_evt14 */
  934. r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
  935. #endif
  936. sti r0;
  937. raise 14;
  938. rti;
  939. ENDPROC(_lower_to_irq14)
  940. ENTRY(_evt_evt14)
  941. #ifdef CONFIG_DEBUG_HWERR
  942. r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
  943. sti r0;
  944. #else
  945. cli r0;
  946. #endif
  947. #ifdef CONFIG_TRACE_IRQFLAGS
  948. [--sp] = rets;
  949. sp += -12;
  950. call _trace_hardirqs_off;
  951. sp += 12;
  952. rets = [sp++];
  953. #endif
  954. [--sp] = RETI;
  955. SP += 4;
  956. rts;
  957. ENDPROC(_evt_evt14)
  958. ENTRY(_schedule_and_signal_from_int)
  959. /* To end up here, vector 15 was changed - so we have to change it
  960. * back.
  961. */
  962. p0.l = lo(EVT15);
  963. p0.h = hi(EVT15);
  964. p1.l = _evt_system_call;
  965. p1.h = _evt_system_call;
  966. [p0] = p1;
  967. csync;
  968. /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
  969. r0 = -1 (x);
  970. [sp + PT_ORIG_P0] = r0;
  971. p1 = rets;
  972. [sp + PT_RESERVED] = p1;
  973. #ifdef CONFIG_TRACE_IRQFLAGS
  974. /* trace_hardirqs_on() checks if all irqs are disabled. But here IRQ 15
  975. * is turned on, so disable all irqs. */
  976. cli r0;
  977. sp += -12;
  978. call _trace_hardirqs_on;
  979. sp += 12;
  980. #endif
  981. #ifdef CONFIG_SMP
  982. GET_PDA(p0, r0); /* Fetch current PDA (can't migrate to other CPU here) */
  983. r0 = [p0 + PDA_IRQFLAGS];
  984. #else
  985. p0.l = _bfin_irq_flags;
  986. p0.h = _bfin_irq_flags;
  987. r0 = [p0];
  988. #endif
  989. sti r0;
  990. /* finish the userspace "atomic" functions for it */
  991. r1.l = lo(FIXED_CODE_END);
  992. r1.h = hi(FIXED_CODE_END);
  993. r2 = [sp + PT_PC];
  994. cc = r1 <= r2;
  995. if cc jump .Lresume_userspace (bp);
  996. r0 = sp;
  997. sp += -12;
  998. pseudo_long_call _finish_atomic_sections, p5;
  999. sp += 12;
  1000. jump.s .Lresume_userspace;
  1001. ENDPROC(_schedule_and_signal_from_int)
  1002. ENTRY(_schedule_and_signal)
  1003. SAVE_CONTEXT_SYSCALL
  1004. /* To end up here, vector 15 was changed - so we have to change it
  1005. * back.
  1006. */
  1007. p0.l = lo(EVT15);
  1008. p0.h = hi(EVT15);
  1009. p1.l = _evt_system_call;
  1010. p1.h = _evt_system_call;
  1011. [p0] = p1;
  1012. csync;
  1013. p0.l = 1f;
  1014. p0.h = 1f;
  1015. [sp + PT_RESERVED] = P0;
  1016. call .Lresume_userspace;
  1017. 1:
  1018. RESTORE_CONTEXT
  1019. rti;
  1020. ENDPROC(_schedule_and_signal)
  1021. /* We handle this 100% in exception space - to reduce overhead
  1022. * Only potiential problem is if the software buffer gets swapped out of the
  1023. * CPLB table - then double fault. - so we don't let this happen in other places
  1024. */
  1025. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
  1026. ENTRY(_ex_trace_buff_full)
  1027. [--sp] = P3;
  1028. [--sp] = P2;
  1029. [--sp] = LC0;
  1030. [--sp] = LT0;
  1031. [--sp] = LB0;
  1032. P5.L = _trace_buff_offset;
  1033. P5.H = _trace_buff_offset;
  1034. P3 = [P5]; /* trace_buff_offset */
  1035. P5.L = lo(TBUFSTAT);
  1036. P5.H = hi(TBUFSTAT);
  1037. R7 = [P5];
  1038. R7 <<= 1; /* double, since we need to read twice */
  1039. LC0 = R7;
  1040. R7 <<= 2; /* need to shift over again,
  1041. * to get the number of bytes */
  1042. P5.L = lo(TBUF);
  1043. P5.H = hi(TBUF);
  1044. R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
  1045. P2 = R7;
  1046. P3 = P3 + P2;
  1047. R7 = P3;
  1048. R7 = R7 & R6;
  1049. P3 = R7;
  1050. P2.L = _trace_buff_offset;
  1051. P2.H = _trace_buff_offset;
  1052. [P2] = P3;
  1053. P2.L = _software_trace_buff;
  1054. P2.H = _software_trace_buff;
  1055. LSETUP (.Lstart, .Lend) LC0;
  1056. .Lstart:
  1057. R7 = [P5]; /* read TBUF */
  1058. P4 = P3 + P2;
  1059. [P4] = R7;
  1060. P3 += -4;
  1061. R7 = P3;
  1062. R7 = R7 & R6;
  1063. .Lend:
  1064. P3 = R7;
  1065. LB0 = [sp++];
  1066. LT0 = [sp++];
  1067. LC0 = [sp++];
  1068. P2 = [sp++];
  1069. P3 = [sp++];
  1070. jump _bfin_return_from_exception;
  1071. ENDPROC(_ex_trace_buff_full)
  1072. #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
  1073. .data
  1074. #else
  1075. .section .l1.data.B
  1076. #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
  1077. ENTRY(_trace_buff_offset)
  1078. .long 0;
  1079. ALIGN
  1080. ENTRY(_software_trace_buff)
  1081. .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
  1082. .long 0
  1083. .endr
  1084. #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
  1085. #ifdef CONFIG_EARLY_PRINTK
  1086. __INIT
  1087. ENTRY(_early_trap)
  1088. SAVE_ALL_SYS
  1089. trace_buffer_stop(p0,r0);
  1090. ANOMALY_283_315_WORKAROUND(p4, r5)
  1091. /* Turn caches off, to ensure we don't get double exceptions */
  1092. P4.L = LO(IMEM_CONTROL);
  1093. P4.H = HI(IMEM_CONTROL);
  1094. R5 = [P4]; /* Control Register*/
  1095. BITCLR(R5,ENICPLB_P);
  1096. CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
  1097. [P4] = R5;
  1098. SSYNC;
  1099. P4.L = LO(DMEM_CONTROL);
  1100. P4.H = HI(DMEM_CONTROL);
  1101. R5 = [P4];
  1102. BITCLR(R5,ENDCPLB_P);
  1103. CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
  1104. [P4] = R5;
  1105. SSYNC;
  1106. r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
  1107. r1 = RETX;
  1108. SP += -12;
  1109. call _early_trap_c;
  1110. SP += 12;
  1111. ENDPROC(_early_trap)
  1112. __FINIT
  1113. #endif /* CONFIG_EARLY_PRINTK */
  1114. /*
  1115. * Put these in the kernel data section - that should always be covered by
  1116. * a CPLB. This is needed to ensure we don't get double fault conditions
  1117. */
  1118. #ifdef CONFIG_SYSCALL_TAB_L1
  1119. .section .l1.data
  1120. #else
  1121. .data
  1122. #endif
  1123. ENTRY(_ex_table)
  1124. /* entry for each EXCAUSE[5:0]
  1125. * This table must be in sync with the table in ./kernel/traps.c
  1126. * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
  1127. */
  1128. .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
  1129. .long _ex_trap_c /* 0x01 - User Defined - Software breakpoint */
  1130. #ifdef CONFIG_KGDB
  1131. .long _ex_trap_c /* 0x02 - User Defined - KGDB initial connection
  1132. and break signal trap */
  1133. #else
  1134. .long _ex_replaceable /* 0x02 - User Defined */
  1135. #endif
  1136. .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
  1137. .long _ex_trap_c /* 0x04 - User Defined - dump trace buffer */
  1138. .long _ex_replaceable /* 0x05 - User Defined */
  1139. .long _ex_replaceable /* 0x06 - User Defined */
  1140. .long _ex_replaceable /* 0x07 - User Defined */
  1141. .long _ex_replaceable /* 0x08 - User Defined */
  1142. .long _ex_replaceable /* 0x09 - User Defined */
  1143. .long _ex_replaceable /* 0x0A - User Defined */
  1144. .long _ex_replaceable /* 0x0B - User Defined */
  1145. .long _ex_replaceable /* 0x0C - User Defined */
  1146. .long _ex_replaceable /* 0x0D - User Defined */
  1147. .long _ex_replaceable /* 0x0E - User Defined */
  1148. .long _ex_replaceable /* 0x0F - User Defined */
  1149. .long _ex_single_step /* 0x10 - HW Single step */
  1150. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
  1151. .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
  1152. #else
  1153. .long _ex_trap_c /* 0x11 - Trace Buffer Full */
  1154. #endif
  1155. .long _ex_trap_c /* 0x12 - Reserved */
  1156. .long _ex_trap_c /* 0x13 - Reserved */
  1157. .long _ex_trap_c /* 0x14 - Reserved */
  1158. .long _ex_trap_c /* 0x15 - Reserved */
  1159. .long _ex_trap_c /* 0x16 - Reserved */
  1160. .long _ex_trap_c /* 0x17 - Reserved */
  1161. .long _ex_trap_c /* 0x18 - Reserved */
  1162. .long _ex_trap_c /* 0x19 - Reserved */
  1163. .long _ex_trap_c /* 0x1A - Reserved */
  1164. .long _ex_trap_c /* 0x1B - Reserved */
  1165. .long _ex_trap_c /* 0x1C - Reserved */
  1166. .long _ex_trap_c /* 0x1D - Reserved */
  1167. .long _ex_trap_c /* 0x1E - Reserved */
  1168. .long _ex_trap_c /* 0x1F - Reserved */
  1169. .long _ex_trap_c /* 0x20 - Reserved */
  1170. .long _ex_trap_c /* 0x21 - Undefined Instruction */
  1171. .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
  1172. .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */
  1173. .long _ex_trap_c /* 0x24 - Data access misaligned */
  1174. .long _ex_trap_c /* 0x25 - Unrecoverable Event */
  1175. .long _ex_dmiss /* 0x26 - Data CPLB Miss */
  1176. .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
  1177. .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
  1178. .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
  1179. .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
  1180. .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */
  1181. .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */
  1182. .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
  1183. .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
  1184. .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
  1185. .long _ex_trap_c /* 0x2F - Reserved */
  1186. .long _ex_trap_c /* 0x30 - Reserved */
  1187. .long _ex_trap_c /* 0x31 - Reserved */
  1188. .long _ex_trap_c /* 0x32 - Reserved */
  1189. .long _ex_trap_c /* 0x33 - Reserved */
  1190. .long _ex_trap_c /* 0x34 - Reserved */
  1191. .long _ex_trap_c /* 0x35 - Reserved */
  1192. .long _ex_trap_c /* 0x36 - Reserved */
  1193. .long _ex_trap_c /* 0x37 - Reserved */
  1194. .long _ex_trap_c /* 0x38 - Reserved */
  1195. .long _ex_trap_c /* 0x39 - Reserved */
  1196. .long _ex_trap_c /* 0x3A - Reserved */
  1197. .long _ex_trap_c /* 0x3B - Reserved */
  1198. .long _ex_trap_c /* 0x3C - Reserved */
  1199. .long _ex_trap_c /* 0x3D - Reserved */
  1200. .long _ex_trap_c /* 0x3E - Reserved */
  1201. .long _ex_trap_c /* 0x3F - Reserved */
  1202. END(_ex_table)
  1203. ENTRY(_sys_call_table)
  1204. .long _sys_restart_syscall /* 0 */
  1205. .long _sys_exit
  1206. .long _sys_ni_syscall /* fork */
  1207. .long _sys_read
  1208. .long _sys_write
  1209. .long _sys_open /* 5 */
  1210. .long _sys_close
  1211. .long _sys_ni_syscall /* old waitpid */
  1212. .long _sys_creat
  1213. .long _sys_link
  1214. .long _sys_unlink /* 10 */
  1215. .long _sys_execve
  1216. .long _sys_chdir
  1217. .long _sys_time
  1218. .long _sys_mknod
  1219. .long _sys_chmod /* 15 */
  1220. .long _sys_chown /* chown16 */
  1221. .long _sys_ni_syscall /* old break syscall holder */
  1222. .long _sys_ni_syscall /* old stat */
  1223. .long _sys_lseek
  1224. .long _sys_getpid /* 20 */
  1225. .long _sys_mount
  1226. .long _sys_ni_syscall /* old umount */
  1227. .long _sys_setuid
  1228. .long _sys_getuid
  1229. .long _sys_stime /* 25 */
  1230. .long _sys_ptrace
  1231. .long _sys_alarm
  1232. .long _sys_ni_syscall /* old fstat */
  1233. .long _sys_pause
  1234. .long _sys_ni_syscall /* old utime */ /* 30 */
  1235. .long _sys_ni_syscall /* old stty syscall holder */
  1236. .long _sys_ni_syscall /* old gtty syscall holder */
  1237. .long _sys_access
  1238. .long _sys_nice
  1239. .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
  1240. .long _sys_sync
  1241. .long _sys_kill
  1242. .long _sys_rename
  1243. .long _sys_mkdir
  1244. .long _sys_rmdir /* 40 */
  1245. .long _sys_dup
  1246. .long _sys_pipe
  1247. .long _sys_times
  1248. .long _sys_ni_syscall /* old prof syscall holder */
  1249. .long _sys_brk /* 45 */
  1250. .long _sys_setgid
  1251. .long _sys_getgid
  1252. .long _sys_ni_syscall /* old sys_signal */
  1253. .long _sys_geteuid /* geteuid16 */
  1254. .long _sys_getegid /* getegid16 */ /* 50 */
  1255. .long _sys_acct
  1256. .long _sys_umount /* recycled never used phys() */
  1257. .long _sys_ni_syscall /* old lock syscall holder */
  1258. .long _sys_ioctl
  1259. .long _sys_fcntl /* 55 */
  1260. .long _sys_ni_syscall /* old mpx syscall holder */
  1261. .long _sys_setpgid
  1262. .long _sys_ni_syscall /* old ulimit syscall holder */
  1263. .long _sys_ni_syscall /* old old uname */
  1264. .long _sys_umask /* 60 */
  1265. .long _sys_chroot
  1266. .long _sys_ustat
  1267. .long _sys_dup2
  1268. .long _sys_getppid
  1269. .long _sys_getpgrp /* 65 */
  1270. .long _sys_setsid
  1271. .long _sys_ni_syscall /* old sys_sigaction */
  1272. .long _sys_sgetmask
  1273. .long _sys_ssetmask
  1274. .long _sys_setreuid /* setreuid16 */ /* 70 */
  1275. .long _sys_setregid /* setregid16 */
  1276. .long _sys_ni_syscall /* old sys_sigsuspend */
  1277. .long _sys_ni_syscall /* old sys_sigpending */
  1278. .long _sys_sethostname
  1279. .long _sys_setrlimit /* 75 */
  1280. .long _sys_ni_syscall /* old getrlimit */
  1281. .long _sys_getrusage
  1282. .long _sys_gettimeofday
  1283. .long _sys_settimeofday
  1284. .long _sys_getgroups /* getgroups16 */ /* 80 */
  1285. .long _sys_setgroups /* setgroups16 */
  1286. .long _sys_ni_syscall /* old_select */
  1287. .long _sys_symlink
  1288. .long _sys_ni_syscall /* old lstat */
  1289. .long _sys_readlink /* 85 */
  1290. .long _sys_uselib
  1291. .long _sys_ni_syscall /* sys_swapon */
  1292. .long _sys_reboot
  1293. .long _sys_ni_syscall /* old_readdir */
  1294. .long _sys_ni_syscall /* sys_mmap */ /* 90 */
  1295. .long _sys_munmap
  1296. .long _sys_truncate
  1297. .long _sys_ftruncate
  1298. .long _sys_fchmod
  1299. .long _sys_fchown /* fchown16 */ /* 95 */
  1300. .long _sys_getpriority
  1301. .long _sys_setpriority
  1302. .long _sys_ni_syscall /* old profil syscall holder */
  1303. .long _sys_statfs
  1304. .long _sys_fstatfs /* 100 */
  1305. .long _sys_ni_syscall
  1306. .long _sys_ni_syscall /* old sys_socketcall */
  1307. .long _sys_syslog
  1308. .long _sys_setitimer
  1309. .long _sys_getitimer /* 105 */
  1310. .long _sys_newstat
  1311. .long _sys_newlstat
  1312. .long _sys_newfstat
  1313. .long _sys_ni_syscall /* old uname */
  1314. .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
  1315. .long _sys_vhangup
  1316. .long _sys_ni_syscall /* obsolete idle() syscall */
  1317. .long _sys_ni_syscall /* vm86old for i386 */
  1318. .long _sys_wait4
  1319. .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
  1320. .long _sys_sysinfo
  1321. .long _sys_ni_syscall /* old sys_ipc */
  1322. .long _sys_fsync
  1323. .long _sys_ni_syscall /* old sys_sigreturn */
  1324. .long _sys_clone /* 120 */
  1325. .long _sys_setdomainname
  1326. .long _sys_newuname
  1327. .long _sys_ni_syscall /* old sys_modify_ldt */
  1328. .long _sys_adjtimex
  1329. .long _sys_mprotect /* 125 */
  1330. .long _sys_ni_syscall /* old sys_sigprocmask */
  1331. .long _sys_ni_syscall /* old "creat_module" */
  1332. .long _sys_init_module
  1333. .long _sys_delete_module
  1334. .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
  1335. .long _sys_quotactl
  1336. .long _sys_getpgid
  1337. .long _sys_fchdir
  1338. .long _sys_bdflush
  1339. .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
  1340. .long _sys_personality
  1341. .long _sys_ni_syscall /* for afs_syscall */
  1342. .long _sys_setfsuid /* setfsuid16 */
  1343. .long _sys_setfsgid /* setfsgid16 */
  1344. .long _sys_llseek /* 140 */
  1345. .long _sys_getdents
  1346. .long _sys_ni_syscall /* sys_select */
  1347. .long _sys_flock
  1348. .long _sys_msync
  1349. .long _sys_readv /* 145 */
  1350. .long _sys_writev
  1351. .long _sys_getsid
  1352. .long _sys_fdatasync
  1353. .long _sys_sysctl
  1354. .long _sys_mlock /* 150 */
  1355. .long _sys_munlock
  1356. .long _sys_mlockall
  1357. .long _sys_munlockall
  1358. .long _sys_sched_setparam
  1359. .long _sys_sched_getparam /* 155 */
  1360. .long _sys_sched_setscheduler
  1361. .long _sys_sched_getscheduler
  1362. .long _sys_sched_yield
  1363. .long _sys_sched_get_priority_max
  1364. .long _sys_sched_get_priority_min /* 160 */
  1365. .long _sys_sched_rr_get_interval
  1366. .long _sys_nanosleep
  1367. .long _sys_mremap
  1368. .long _sys_setresuid /* setresuid16 */
  1369. .long _sys_getresuid /* getresuid16 */ /* 165 */
  1370. .long _sys_ni_syscall /* for vm86 */
  1371. .long _sys_ni_syscall /* old "query_module" */
  1372. .long _sys_ni_syscall /* sys_poll */
  1373. .long _sys_ni_syscall /* old nfsservctl */
  1374. .long _sys_setresgid /* setresgid16 */ /* 170 */
  1375. .long _sys_getresgid /* getresgid16 */
  1376. .long _sys_prctl
  1377. .long _sys_rt_sigreturn
  1378. .long _sys_rt_sigaction
  1379. .long _sys_rt_sigprocmask /* 175 */
  1380. .long _sys_rt_sigpending
  1381. .long _sys_rt_sigtimedwait
  1382. .long _sys_rt_sigqueueinfo
  1383. .long _sys_rt_sigsuspend
  1384. .long _sys_pread64 /* 180 */
  1385. .long _sys_pwrite64
  1386. .long _sys_lchown /* lchown16 */
  1387. .long _sys_getcwd
  1388. .long _sys_capget
  1389. .long _sys_capset /* 185 */
  1390. .long _sys_sigaltstack
  1391. .long _sys_sendfile
  1392. .long _sys_ni_syscall /* streams1 */
  1393. .long _sys_ni_syscall /* streams2 */
  1394. .long _sys_vfork /* 190 */
  1395. .long _sys_getrlimit
  1396. .long _sys_mmap_pgoff
  1397. .long _sys_truncate64
  1398. .long _sys_ftruncate64
  1399. .long _sys_stat64 /* 195 */
  1400. .long _sys_lstat64
  1401. .long _sys_fstat64
  1402. .long _sys_chown
  1403. .long _sys_getuid
  1404. .long _sys_getgid /* 200 */
  1405. .long _sys_geteuid
  1406. .long _sys_getegid
  1407. .long _sys_setreuid
  1408. .long _sys_setregid
  1409. .long _sys_getgroups /* 205 */
  1410. .long _sys_setgroups
  1411. .long _sys_fchown
  1412. .long _sys_setresuid
  1413. .long _sys_getresuid
  1414. .long _sys_setresgid /* 210 */
  1415. .long _sys_getresgid
  1416. .long _sys_lchown
  1417. .long _sys_setuid
  1418. .long _sys_setgid
  1419. .long _sys_setfsuid /* 215 */
  1420. .long _sys_setfsgid
  1421. .long _sys_pivot_root
  1422. .long _sys_mincore
  1423. .long _sys_madvise
  1424. .long _sys_getdents64 /* 220 */
  1425. .long _sys_fcntl64
  1426. .long _sys_ni_syscall /* reserved for TUX */
  1427. .long _sys_ni_syscall
  1428. .long _sys_gettid
  1429. .long _sys_readahead /* 225 */
  1430. .long _sys_setxattr
  1431. .long _sys_lsetxattr
  1432. .long _sys_fsetxattr
  1433. .long _sys_getxattr
  1434. .long _sys_lgetxattr /* 230 */
  1435. .long _sys_fgetxattr
  1436. .long _sys_listxattr
  1437. .long _sys_llistxattr
  1438. .long _sys_flistxattr
  1439. .long _sys_removexattr /* 235 */
  1440. .long _sys_lremovexattr
  1441. .long _sys_fremovexattr
  1442. .long _sys_tkill
  1443. .long _sys_sendfile64
  1444. .long _sys_futex /* 240 */
  1445. .long _sys_sched_setaffinity
  1446. .long _sys_sched_getaffinity
  1447. .long _sys_ni_syscall /* sys_set_thread_area */
  1448. .long _sys_ni_syscall /* sys_get_thread_area */
  1449. .long _sys_io_setup /* 245 */
  1450. .long _sys_io_destroy
  1451. .long _sys_io_getevents
  1452. .long _sys_io_submit
  1453. .long _sys_io_cancel
  1454. .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
  1455. .long _sys_ni_syscall /* sys_freec_hugepages */
  1456. .long _sys_exit_group
  1457. .long _sys_lookup_dcookie
  1458. .long _sys_bfin_spinlock
  1459. .long _sys_epoll_create /* 255 */
  1460. .long _sys_epoll_ctl
  1461. .long _sys_epoll_wait
  1462. .long _sys_ni_syscall /* remap_file_pages */
  1463. .long _sys_set_tid_address
  1464. .long _sys_timer_create /* 260 */
  1465. .long _sys_timer_settime
  1466. .long _sys_timer_gettime
  1467. .long _sys_timer_getoverrun
  1468. .long _sys_timer_delete
  1469. .long _sys_clock_settime /* 265 */
  1470. .long _sys_clock_gettime
  1471. .long _sys_clock_getres
  1472. .long _sys_clock_nanosleep
  1473. .long _sys_statfs64
  1474. .long _sys_fstatfs64 /* 270 */
  1475. .long _sys_tgkill
  1476. .long _sys_utimes
  1477. .long _sys_fadvise64_64
  1478. .long _sys_ni_syscall /* vserver */
  1479. .long _sys_mbind /* 275 */
  1480. .long _sys_ni_syscall /* get_mempolicy */
  1481. .long _sys_ni_syscall /* set_mempolicy */
  1482. .long _sys_mq_open
  1483. .long _sys_mq_unlink
  1484. .long _sys_mq_timedsend /* 280 */
  1485. .long _sys_mq_timedreceive
  1486. .long _sys_mq_notify
  1487. .long _sys_mq_getsetattr
  1488. .long _sys_ni_syscall /* kexec_load */
  1489. .long _sys_waitid /* 285 */
  1490. .long _sys_add_key
  1491. .long _sys_request_key
  1492. .long _sys_keyctl
  1493. .long _sys_ioprio_set
  1494. .long _sys_ioprio_get /* 290 */
  1495. .long _sys_inotify_init
  1496. .long _sys_inotify_add_watch
  1497. .long _sys_inotify_rm_watch
  1498. .long _sys_ni_syscall /* migrate_pages */
  1499. .long _sys_openat /* 295 */
  1500. .long _sys_mkdirat
  1501. .long _sys_mknodat
  1502. .long _sys_fchownat
  1503. .long _sys_futimesat
  1504. .long _sys_fstatat64 /* 300 */
  1505. .long _sys_unlinkat
  1506. .long _sys_renameat
  1507. .long _sys_linkat
  1508. .long _sys_symlinkat
  1509. .long _sys_readlinkat /* 305 */
  1510. .long _sys_fchmodat
  1511. .long _sys_faccessat
  1512. .long _sys_pselect6
  1513. .long _sys_ppoll
  1514. .long _sys_unshare /* 310 */
  1515. .long _sys_sram_alloc
  1516. .long _sys_sram_free
  1517. .long _sys_dma_memcpy
  1518. .long _sys_accept
  1519. .long _sys_bind /* 315 */
  1520. .long _sys_connect
  1521. .long _sys_getpeername
  1522. .long _sys_getsockname
  1523. .long _sys_getsockopt
  1524. .long _sys_listen /* 320 */
  1525. .long _sys_recv
  1526. .long _sys_recvfrom
  1527. .long _sys_recvmsg
  1528. .long _sys_send
  1529. .long _sys_sendmsg /* 325 */
  1530. .long _sys_sendto
  1531. .long _sys_setsockopt
  1532. .long _sys_shutdown
  1533. .long _sys_socket
  1534. .long _sys_socketpair /* 330 */
  1535. .long _sys_semctl
  1536. .long _sys_semget
  1537. .long _sys_semop
  1538. .long _sys_msgctl
  1539. .long _sys_msgget /* 335 */
  1540. .long _sys_msgrcv
  1541. .long _sys_msgsnd
  1542. .long _sys_shmat
  1543. .long _sys_shmctl
  1544. .long _sys_shmdt /* 340 */
  1545. .long _sys_shmget
  1546. .long _sys_splice
  1547. .long _sys_sync_file_range
  1548. .long _sys_tee
  1549. .long _sys_vmsplice /* 345 */
  1550. .long _sys_epoll_pwait
  1551. .long _sys_utimensat
  1552. .long _sys_signalfd
  1553. .long _sys_timerfd_create
  1554. .long _sys_eventfd /* 350 */
  1555. .long _sys_pread64
  1556. .long _sys_pwrite64
  1557. .long _sys_fadvise64
  1558. .long _sys_set_robust_list
  1559. .long _sys_get_robust_list /* 355 */
  1560. .long _sys_fallocate
  1561. .long _sys_semtimedop
  1562. .long _sys_timerfd_settime
  1563. .long _sys_timerfd_gettime
  1564. .long _sys_signalfd4 /* 360 */
  1565. .long _sys_eventfd2
  1566. .long _sys_epoll_create1
  1567. .long _sys_dup3
  1568. .long _sys_pipe2
  1569. .long _sys_inotify_init1 /* 365 */
  1570. .long _sys_preadv
  1571. .long _sys_pwritev
  1572. .long _sys_rt_tgsigqueueinfo
  1573. .long _sys_perf_event_open
  1574. .long _sys_recvmmsg /* 370 */
  1575. .long _sys_fanotify_init
  1576. .long _sys_fanotify_mark
  1577. .long _sys_prlimit64
  1578. .long _sys_cacheflush
  1579. .long _sys_name_to_handle_at /* 375 */
  1580. .long _sys_open_by_handle_at
  1581. .long _sys_clock_adjtime
  1582. .long _sys_syncfs
  1583. .long _sys_setns
  1584. .long _sys_sendmmsg /* 380 */
  1585. .long _sys_process_vm_readv
  1586. .long _sys_process_vm_writev
  1587. .rept NR_syscalls-(.-_sys_call_table)/4
  1588. .long _sys_ni_syscall
  1589. .endr
  1590. END(_sys_call_table)