entry.S 37 KB

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