entry.S 38 KB

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