traps.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994 - 1999, 2000, 01 Ralf Baechle
  7. * Copyright (C) 1995, 1996 Paul M. Antoine
  8. * Copyright (C) 1998 Ulf Carlsson
  9. * Copyright (C) 1999 Silicon Graphics, Inc.
  10. * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  11. * Copyright (C) 2000, 01 MIPS Technologies, Inc.
  12. * Copyright (C) 2002, 2003, 2004, 2005 Maciej W. Rozycki
  13. */
  14. #include <linux/config.h>
  15. #include <linux/init.h>
  16. #include <linux/mm.h>
  17. #include <linux/module.h>
  18. #include <linux/sched.h>
  19. #include <linux/smp.h>
  20. #include <linux/smp_lock.h>
  21. #include <linux/spinlock.h>
  22. #include <linux/kallsyms.h>
  23. #include <linux/bootmem.h>
  24. #include <asm/bootinfo.h>
  25. #include <asm/branch.h>
  26. #include <asm/break.h>
  27. #include <asm/cpu.h>
  28. #include <asm/dsp.h>
  29. #include <asm/fpu.h>
  30. #include <asm/module.h>
  31. #include <asm/pgtable.h>
  32. #include <asm/ptrace.h>
  33. #include <asm/sections.h>
  34. #include <asm/system.h>
  35. #include <asm/tlbdebug.h>
  36. #include <asm/traps.h>
  37. #include <asm/uaccess.h>
  38. #include <asm/mmu_context.h>
  39. #include <asm/watch.h>
  40. #include <asm/types.h>
  41. extern asmlinkage void handle_tlbm(void);
  42. extern asmlinkage void handle_tlbl(void);
  43. extern asmlinkage void handle_tlbs(void);
  44. extern asmlinkage void handle_adel(void);
  45. extern asmlinkage void handle_ades(void);
  46. extern asmlinkage void handle_ibe(void);
  47. extern asmlinkage void handle_dbe(void);
  48. extern asmlinkage void handle_sys(void);
  49. extern asmlinkage void handle_bp(void);
  50. extern asmlinkage void handle_ri(void);
  51. extern asmlinkage void handle_cpu(void);
  52. extern asmlinkage void handle_ov(void);
  53. extern asmlinkage void handle_tr(void);
  54. extern asmlinkage void handle_fpe(void);
  55. extern asmlinkage void handle_mdmx(void);
  56. extern asmlinkage void handle_watch(void);
  57. extern asmlinkage void handle_dsp(void);
  58. extern asmlinkage void handle_mcheck(void);
  59. extern asmlinkage void handle_reserved(void);
  60. extern int fpu_emulator_cop1Handler(int xcptno, struct pt_regs *xcp,
  61. struct mips_fpu_soft_struct *ctx);
  62. void (*board_be_init)(void);
  63. int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
  64. void (*board_nmi_handler_setup)(void);
  65. void (*board_ejtag_handler_setup)(void);
  66. void (*board_bind_eic_interrupt)(int irq, int regset);
  67. /*
  68. * These constant is for searching for possible module text segments.
  69. * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
  70. */
  71. #define MODULE_RANGE (8*1024*1024)
  72. /*
  73. * This routine abuses get_user()/put_user() to reference pointers
  74. * with at least a bit of error checking ...
  75. */
  76. void show_stack(struct task_struct *task, unsigned long *sp)
  77. {
  78. const int field = 2 * sizeof(unsigned long);
  79. long stackdata;
  80. int i;
  81. if (!sp) {
  82. if (task && task != current)
  83. sp = (unsigned long *) task->thread.reg29;
  84. else
  85. sp = (unsigned long *) &sp;
  86. }
  87. printk("Stack :");
  88. i = 0;
  89. while ((unsigned long) sp & (PAGE_SIZE - 1)) {
  90. if (i && ((i % (64 / field)) == 0))
  91. printk("\n ");
  92. if (i > 39) {
  93. printk(" ...");
  94. break;
  95. }
  96. if (__get_user(stackdata, sp++)) {
  97. printk(" (Bad stack address)");
  98. break;
  99. }
  100. printk(" %0*lx", field, stackdata);
  101. i++;
  102. }
  103. printk("\n");
  104. }
  105. void show_trace(struct task_struct *task, unsigned long *stack)
  106. {
  107. const int field = 2 * sizeof(unsigned long);
  108. unsigned long addr;
  109. if (!stack) {
  110. if (task && task != current)
  111. stack = (unsigned long *) task->thread.reg29;
  112. else
  113. stack = (unsigned long *) &stack;
  114. }
  115. printk("Call Trace:");
  116. #ifdef CONFIG_KALLSYMS
  117. printk("\n");
  118. #endif
  119. while (!kstack_end(stack)) {
  120. addr = *stack++;
  121. if (__kernel_text_address(addr)) {
  122. printk(" [<%0*lx>] ", field, addr);
  123. print_symbol("%s\n", addr);
  124. }
  125. }
  126. printk("\n");
  127. }
  128. /*
  129. * The architecture-independent dump_stack generator
  130. */
  131. void dump_stack(void)
  132. {
  133. unsigned long stack;
  134. show_trace(current, &stack);
  135. }
  136. EXPORT_SYMBOL(dump_stack);
  137. void show_code(unsigned int *pc)
  138. {
  139. long i;
  140. printk("\nCode:");
  141. for(i = -3 ; i < 6 ; i++) {
  142. unsigned int insn;
  143. if (__get_user(insn, pc + i)) {
  144. printk(" (Bad address in epc)\n");
  145. break;
  146. }
  147. printk("%c%08x%c", (i?' ':'<'), insn, (i?' ':'>'));
  148. }
  149. }
  150. void show_regs(struct pt_regs *regs)
  151. {
  152. const int field = 2 * sizeof(unsigned long);
  153. unsigned int cause = regs->cp0_cause;
  154. int i;
  155. printk("Cpu %d\n", smp_processor_id());
  156. /*
  157. * Saved main processor registers
  158. */
  159. for (i = 0; i < 32; ) {
  160. if ((i % 4) == 0)
  161. printk("$%2d :", i);
  162. if (i == 0)
  163. printk(" %0*lx", field, 0UL);
  164. else if (i == 26 || i == 27)
  165. printk(" %*s", field, "");
  166. else
  167. printk(" %0*lx", field, regs->regs[i]);
  168. i++;
  169. if ((i % 4) == 0)
  170. printk("\n");
  171. }
  172. printk("Hi : %0*lx\n", field, regs->hi);
  173. printk("Lo : %0*lx\n", field, regs->lo);
  174. /*
  175. * Saved cp0 registers
  176. */
  177. printk("epc : %0*lx ", field, regs->cp0_epc);
  178. print_symbol("%s ", regs->cp0_epc);
  179. printk(" %s\n", print_tainted());
  180. printk("ra : %0*lx ", field, regs->regs[31]);
  181. print_symbol("%s\n", regs->regs[31]);
  182. printk("Status: %08x ", (uint32_t) regs->cp0_status);
  183. if (current_cpu_data.isa_level == MIPS_CPU_ISA_I) {
  184. if (regs->cp0_status & ST0_KUO)
  185. printk("KUo ");
  186. if (regs->cp0_status & ST0_IEO)
  187. printk("IEo ");
  188. if (regs->cp0_status & ST0_KUP)
  189. printk("KUp ");
  190. if (regs->cp0_status & ST0_IEP)
  191. printk("IEp ");
  192. if (regs->cp0_status & ST0_KUC)
  193. printk("KUc ");
  194. if (regs->cp0_status & ST0_IEC)
  195. printk("IEc ");
  196. } else {
  197. if (regs->cp0_status & ST0_KX)
  198. printk("KX ");
  199. if (regs->cp0_status & ST0_SX)
  200. printk("SX ");
  201. if (regs->cp0_status & ST0_UX)
  202. printk("UX ");
  203. switch (regs->cp0_status & ST0_KSU) {
  204. case KSU_USER:
  205. printk("USER ");
  206. break;
  207. case KSU_SUPERVISOR:
  208. printk("SUPERVISOR ");
  209. break;
  210. case KSU_KERNEL:
  211. printk("KERNEL ");
  212. break;
  213. default:
  214. printk("BAD_MODE ");
  215. break;
  216. }
  217. if (regs->cp0_status & ST0_ERL)
  218. printk("ERL ");
  219. if (regs->cp0_status & ST0_EXL)
  220. printk("EXL ");
  221. if (regs->cp0_status & ST0_IE)
  222. printk("IE ");
  223. }
  224. printk("\n");
  225. printk("Cause : %08x\n", cause);
  226. cause = (cause & CAUSEF_EXCCODE) >> CAUSEB_EXCCODE;
  227. if (1 <= cause && cause <= 5)
  228. printk("BadVA : %0*lx\n", field, regs->cp0_badvaddr);
  229. printk("PrId : %08x\n", read_c0_prid());
  230. }
  231. void show_registers(struct pt_regs *regs)
  232. {
  233. show_regs(regs);
  234. print_modules();
  235. printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
  236. current->comm, current->pid, current_thread_info(), current);
  237. show_stack(current, (long *) regs->regs[29]);
  238. show_trace(current, (long *) regs->regs[29]);
  239. show_code((unsigned int *) regs->cp0_epc);
  240. printk("\n");
  241. }
  242. static DEFINE_SPINLOCK(die_lock);
  243. NORET_TYPE void ATTRIB_NORET __die(const char * str, struct pt_regs * regs,
  244. const char * file, const char * func,
  245. unsigned long line)
  246. {
  247. static int die_counter;
  248. console_verbose();
  249. spin_lock_irq(&die_lock);
  250. printk("%s", str);
  251. if (file && func)
  252. printk(" in %s:%s, line %ld", file, func, line);
  253. printk("[#%d]:\n", ++die_counter);
  254. show_registers(regs);
  255. spin_unlock_irq(&die_lock);
  256. do_exit(SIGSEGV);
  257. }
  258. void __die_if_kernel(const char * str, struct pt_regs * regs,
  259. const char * file, const char * func, unsigned long line)
  260. {
  261. if (!user_mode(regs))
  262. __die(str, regs, file, func, line);
  263. }
  264. extern const struct exception_table_entry __start___dbe_table[];
  265. extern const struct exception_table_entry __stop___dbe_table[];
  266. void __declare_dbe_table(void)
  267. {
  268. __asm__ __volatile__(
  269. ".section\t__dbe_table,\"a\"\n\t"
  270. ".previous"
  271. );
  272. }
  273. /* Given an address, look for it in the exception tables. */
  274. static const struct exception_table_entry *search_dbe_tables(unsigned long addr)
  275. {
  276. const struct exception_table_entry *e;
  277. e = search_extable(__start___dbe_table, __stop___dbe_table - 1, addr);
  278. if (!e)
  279. e = search_module_dbetables(addr);
  280. return e;
  281. }
  282. asmlinkage void do_be(struct pt_regs *regs)
  283. {
  284. const int field = 2 * sizeof(unsigned long);
  285. const struct exception_table_entry *fixup = NULL;
  286. int data = regs->cp0_cause & 4;
  287. int action = MIPS_BE_FATAL;
  288. /* XXX For now. Fixme, this searches the wrong table ... */
  289. if (data && !user_mode(regs))
  290. fixup = search_dbe_tables(exception_epc(regs));
  291. if (fixup)
  292. action = MIPS_BE_FIXUP;
  293. if (board_be_handler)
  294. action = board_be_handler(regs, fixup != 0);
  295. switch (action) {
  296. case MIPS_BE_DISCARD:
  297. return;
  298. case MIPS_BE_FIXUP:
  299. if (fixup) {
  300. regs->cp0_epc = fixup->nextinsn;
  301. return;
  302. }
  303. break;
  304. default:
  305. break;
  306. }
  307. /*
  308. * Assume it would be too dangerous to continue ...
  309. */
  310. printk(KERN_ALERT "%s bus error, epc == %0*lx, ra == %0*lx\n",
  311. data ? "Data" : "Instruction",
  312. field, regs->cp0_epc, field, regs->regs[31]);
  313. die_if_kernel("Oops", regs);
  314. force_sig(SIGBUS, current);
  315. }
  316. static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode)
  317. {
  318. unsigned int __user *epc;
  319. epc = (unsigned int __user *) regs->cp0_epc +
  320. ((regs->cp0_cause & CAUSEF_BD) != 0);
  321. if (!get_user(*opcode, epc))
  322. return 0;
  323. force_sig(SIGSEGV, current);
  324. return 1;
  325. }
  326. /*
  327. * ll/sc emulation
  328. */
  329. #define OPCODE 0xfc000000
  330. #define BASE 0x03e00000
  331. #define RT 0x001f0000
  332. #define OFFSET 0x0000ffff
  333. #define LL 0xc0000000
  334. #define SC 0xe0000000
  335. #define SPEC3 0x7c000000
  336. #define RD 0x0000f800
  337. #define FUNC 0x0000003f
  338. #define RDHWR 0x0000003b
  339. /*
  340. * The ll_bit is cleared by r*_switch.S
  341. */
  342. unsigned long ll_bit;
  343. static struct task_struct *ll_task = NULL;
  344. static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode)
  345. {
  346. unsigned long value, __user *vaddr;
  347. long offset;
  348. int signal = 0;
  349. /*
  350. * analyse the ll instruction that just caused a ri exception
  351. * and put the referenced address to addr.
  352. */
  353. /* sign extend offset */
  354. offset = opcode & OFFSET;
  355. offset <<= 16;
  356. offset >>= 16;
  357. vaddr = (unsigned long __user *)
  358. ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
  359. if ((unsigned long)vaddr & 3) {
  360. signal = SIGBUS;
  361. goto sig;
  362. }
  363. if (get_user(value, vaddr)) {
  364. signal = SIGSEGV;
  365. goto sig;
  366. }
  367. preempt_disable();
  368. if (ll_task == NULL || ll_task == current) {
  369. ll_bit = 1;
  370. } else {
  371. ll_bit = 0;
  372. }
  373. ll_task = current;
  374. preempt_enable();
  375. compute_return_epc(regs);
  376. regs->regs[(opcode & RT) >> 16] = value;
  377. return;
  378. sig:
  379. force_sig(signal, current);
  380. }
  381. static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
  382. {
  383. unsigned long __user *vaddr;
  384. unsigned long reg;
  385. long offset;
  386. int signal = 0;
  387. /*
  388. * analyse the sc instruction that just caused a ri exception
  389. * and put the referenced address to addr.
  390. */
  391. /* sign extend offset */
  392. offset = opcode & OFFSET;
  393. offset <<= 16;
  394. offset >>= 16;
  395. vaddr = (unsigned long __user *)
  396. ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
  397. reg = (opcode & RT) >> 16;
  398. if ((unsigned long)vaddr & 3) {
  399. signal = SIGBUS;
  400. goto sig;
  401. }
  402. preempt_disable();
  403. if (ll_bit == 0 || ll_task != current) {
  404. compute_return_epc(regs);
  405. regs->regs[reg] = 0;
  406. preempt_enable();
  407. return;
  408. }
  409. preempt_enable();
  410. if (put_user(regs->regs[reg], vaddr)) {
  411. signal = SIGSEGV;
  412. goto sig;
  413. }
  414. compute_return_epc(regs);
  415. regs->regs[reg] = 1;
  416. return;
  417. sig:
  418. force_sig(signal, current);
  419. }
  420. /*
  421. * ll uses the opcode of lwc0 and sc uses the opcode of swc0. That is both
  422. * opcodes are supposed to result in coprocessor unusable exceptions if
  423. * executed on ll/sc-less processors. That's the theory. In practice a
  424. * few processors such as NEC's VR4100 throw reserved instruction exceptions
  425. * instead, so we're doing the emulation thing in both exception handlers.
  426. */
  427. static inline int simulate_llsc(struct pt_regs *regs)
  428. {
  429. unsigned int opcode;
  430. if (unlikely(get_insn_opcode(regs, &opcode)))
  431. return -EFAULT;
  432. if ((opcode & OPCODE) == LL) {
  433. simulate_ll(regs, opcode);
  434. return 0;
  435. }
  436. if ((opcode & OPCODE) == SC) {
  437. simulate_sc(regs, opcode);
  438. return 0;
  439. }
  440. return -EFAULT; /* Strange things going on ... */
  441. }
  442. /*
  443. * Simulate trapping 'rdhwr' instructions to provide user accessible
  444. * registers not implemented in hardware. The only current use of this
  445. * is the thread area pointer.
  446. */
  447. static inline int simulate_rdhwr(struct pt_regs *regs)
  448. {
  449. struct thread_info *ti = current->thread_info;
  450. unsigned int opcode;
  451. if (unlikely(get_insn_opcode(regs, &opcode)))
  452. return -EFAULT;
  453. if (unlikely(compute_return_epc(regs)))
  454. return -EFAULT;
  455. if ((opcode & OPCODE) == SPEC3 && (opcode & FUNC) == RDHWR) {
  456. int rd = (opcode & RD) >> 11;
  457. int rt = (opcode & RT) >> 16;
  458. switch (rd) {
  459. case 29:
  460. regs->regs[rt] = ti->tp_value;
  461. break;
  462. default:
  463. return -EFAULT;
  464. }
  465. }
  466. return 0;
  467. }
  468. asmlinkage void do_ov(struct pt_regs *regs)
  469. {
  470. siginfo_t info;
  471. info.si_code = FPE_INTOVF;
  472. info.si_signo = SIGFPE;
  473. info.si_errno = 0;
  474. info.si_addr = (void __user *) regs->cp0_epc;
  475. force_sig_info(SIGFPE, &info, current);
  476. }
  477. /*
  478. * XXX Delayed fp exceptions when doing a lazy ctx switch XXX
  479. */
  480. asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
  481. {
  482. if (fcr31 & FPU_CSR_UNI_X) {
  483. int sig;
  484. preempt_disable();
  485. #ifdef CONFIG_PREEMPT
  486. if (!is_fpu_owner()) {
  487. /* We might lose fpu before disabling preempt... */
  488. own_fpu();
  489. BUG_ON(!used_math());
  490. restore_fp(current);
  491. }
  492. #endif
  493. /*
  494. * Unimplemented operation exception. If we've got the full
  495. * software emulator on-board, let's use it...
  496. *
  497. * Force FPU to dump state into task/thread context. We're
  498. * moving a lot of data here for what is probably a single
  499. * instruction, but the alternative is to pre-decode the FP
  500. * register operands before invoking the emulator, which seems
  501. * a bit extreme for what should be an infrequent event.
  502. */
  503. save_fp(current);
  504. /* Ensure 'resume' not overwrite saved fp context again. */
  505. lose_fpu();
  506. preempt_enable();
  507. /* Run the emulator */
  508. sig = fpu_emulator_cop1Handler (0, regs,
  509. &current->thread.fpu.soft);
  510. preempt_disable();
  511. own_fpu(); /* Using the FPU again. */
  512. /*
  513. * We can't allow the emulated instruction to leave any of
  514. * the cause bit set in $fcr31.
  515. */
  516. current->thread.fpu.soft.fcr31 &= ~FPU_CSR_ALL_X;
  517. /* Restore the hardware register state */
  518. restore_fp(current);
  519. preempt_enable();
  520. /* If something went wrong, signal */
  521. if (sig)
  522. force_sig(sig, current);
  523. return;
  524. }
  525. force_sig(SIGFPE, current);
  526. }
  527. asmlinkage void do_bp(struct pt_regs *regs)
  528. {
  529. unsigned int opcode, bcode;
  530. siginfo_t info;
  531. die_if_kernel("Break instruction in kernel code", regs);
  532. if (get_insn_opcode(regs, &opcode))
  533. return;
  534. /*
  535. * There is the ancient bug in the MIPS assemblers that the break
  536. * code starts left to bit 16 instead to bit 6 in the opcode.
  537. * Gas is bug-compatible, but not always, grrr...
  538. * We handle both cases with a simple heuristics. --macro
  539. */
  540. bcode = ((opcode >> 6) & ((1 << 20) - 1));
  541. if (bcode < (1 << 10))
  542. bcode <<= 10;
  543. /*
  544. * (A short test says that IRIX 5.3 sends SIGTRAP for all break
  545. * insns, even for break codes that indicate arithmetic failures.
  546. * Weird ...)
  547. * But should we continue the brokenness??? --macro
  548. */
  549. switch (bcode) {
  550. case BRK_OVERFLOW << 10:
  551. case BRK_DIVZERO << 10:
  552. if (bcode == (BRK_DIVZERO << 10))
  553. info.si_code = FPE_INTDIV;
  554. else
  555. info.si_code = FPE_INTOVF;
  556. info.si_signo = SIGFPE;
  557. info.si_errno = 0;
  558. info.si_addr = (void __user *) regs->cp0_epc;
  559. force_sig_info(SIGFPE, &info, current);
  560. break;
  561. default:
  562. force_sig(SIGTRAP, current);
  563. }
  564. }
  565. asmlinkage void do_tr(struct pt_regs *regs)
  566. {
  567. unsigned int opcode, tcode = 0;
  568. siginfo_t info;
  569. die_if_kernel("Trap instruction in kernel code", regs);
  570. if (get_insn_opcode(regs, &opcode))
  571. return;
  572. /* Immediate versions don't provide a code. */
  573. if (!(opcode & OPCODE))
  574. tcode = ((opcode >> 6) & ((1 << 10) - 1));
  575. /*
  576. * (A short test says that IRIX 5.3 sends SIGTRAP for all trap
  577. * insns, even for trap codes that indicate arithmetic failures.
  578. * Weird ...)
  579. * But should we continue the brokenness??? --macro
  580. */
  581. switch (tcode) {
  582. case BRK_OVERFLOW:
  583. case BRK_DIVZERO:
  584. if (tcode == BRK_DIVZERO)
  585. info.si_code = FPE_INTDIV;
  586. else
  587. info.si_code = FPE_INTOVF;
  588. info.si_signo = SIGFPE;
  589. info.si_errno = 0;
  590. info.si_addr = (void __user *) regs->cp0_epc;
  591. force_sig_info(SIGFPE, &info, current);
  592. break;
  593. default:
  594. force_sig(SIGTRAP, current);
  595. }
  596. }
  597. asmlinkage void do_ri(struct pt_regs *regs)
  598. {
  599. die_if_kernel("Reserved instruction in kernel code", regs);
  600. if (!cpu_has_llsc)
  601. if (!simulate_llsc(regs))
  602. return;
  603. if (!simulate_rdhwr(regs))
  604. return;
  605. force_sig(SIGILL, current);
  606. }
  607. asmlinkage void do_cpu(struct pt_regs *regs)
  608. {
  609. unsigned int cpid;
  610. die_if_kernel("do_cpu invoked from kernel context!", regs);
  611. cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
  612. switch (cpid) {
  613. case 0:
  614. if (!cpu_has_llsc)
  615. if (!simulate_llsc(regs))
  616. return;
  617. if (!simulate_rdhwr(regs))
  618. return;
  619. break;
  620. case 1:
  621. preempt_disable();
  622. own_fpu();
  623. if (used_math()) { /* Using the FPU again. */
  624. restore_fp(current);
  625. } else { /* First time FPU user. */
  626. init_fpu();
  627. set_used_math();
  628. }
  629. preempt_enable();
  630. if (!cpu_has_fpu) {
  631. int sig = fpu_emulator_cop1Handler(0, regs,
  632. &current->thread.fpu.soft);
  633. if (sig)
  634. force_sig(sig, current);
  635. }
  636. return;
  637. case 2:
  638. case 3:
  639. break;
  640. }
  641. force_sig(SIGILL, current);
  642. }
  643. asmlinkage void do_mdmx(struct pt_regs *regs)
  644. {
  645. force_sig(SIGILL, current);
  646. }
  647. asmlinkage void do_watch(struct pt_regs *regs)
  648. {
  649. /*
  650. * We use the watch exception where available to detect stack
  651. * overflows.
  652. */
  653. dump_tlb_all();
  654. show_regs(regs);
  655. panic("Caught WATCH exception - probably caused by stack overflow.");
  656. }
  657. asmlinkage void do_mcheck(struct pt_regs *regs)
  658. {
  659. show_regs(regs);
  660. dump_tlb_all();
  661. /*
  662. * Some chips may have other causes of machine check (e.g. SB1
  663. * graduation timer)
  664. */
  665. panic("Caught Machine Check exception - %scaused by multiple "
  666. "matching entries in the TLB.",
  667. (regs->cp0_status & ST0_TS) ? "" : "not ");
  668. }
  669. asmlinkage void do_dsp(struct pt_regs *regs)
  670. {
  671. if (cpu_has_dsp)
  672. panic("Unexpected DSP exception\n");
  673. force_sig(SIGILL, current);
  674. }
  675. asmlinkage void do_reserved(struct pt_regs *regs)
  676. {
  677. /*
  678. * Game over - no way to handle this if it ever occurs. Most probably
  679. * caused by a new unknown cpu type or after another deadly
  680. * hard/software error.
  681. */
  682. show_regs(regs);
  683. panic("Caught reserved exception %ld - should not happen.",
  684. (regs->cp0_cause & 0x7f) >> 2);
  685. }
  686. asmlinkage void do_default_vi(struct pt_regs *regs)
  687. {
  688. show_regs(regs);
  689. panic("Caught unexpected vectored interrupt.");
  690. }
  691. /*
  692. * Some MIPS CPUs can enable/disable for cache parity detection, but do
  693. * it different ways.
  694. */
  695. static inline void parity_protection_init(void)
  696. {
  697. switch (current_cpu_data.cputype) {
  698. case CPU_24K:
  699. case CPU_5KC:
  700. write_c0_ecc(0x80000000);
  701. back_to_back_c0_hazard();
  702. /* Set the PE bit (bit 31) in the c0_errctl register. */
  703. printk(KERN_INFO "Cache parity protection %sabled\n",
  704. (read_c0_ecc() & 0x80000000) ? "en" : "dis");
  705. break;
  706. case CPU_20KC:
  707. case CPU_25KF:
  708. /* Clear the DE bit (bit 16) in the c0_status register. */
  709. printk(KERN_INFO "Enable cache parity protection for "
  710. "MIPS 20KC/25KF CPUs.\n");
  711. clear_c0_status(ST0_DE);
  712. break;
  713. default:
  714. break;
  715. }
  716. }
  717. asmlinkage void cache_parity_error(void)
  718. {
  719. const int field = 2 * sizeof(unsigned long);
  720. unsigned int reg_val;
  721. /* For the moment, report the problem and hang. */
  722. printk("Cache error exception:\n");
  723. printk("cp0_errorepc == %0*lx\n", field, read_c0_errorepc());
  724. reg_val = read_c0_cacheerr();
  725. printk("c0_cacheerr == %08x\n", reg_val);
  726. printk("Decoded c0_cacheerr: %s cache fault in %s reference.\n",
  727. reg_val & (1<<30) ? "secondary" : "primary",
  728. reg_val & (1<<31) ? "data" : "insn");
  729. printk("Error bits: %s%s%s%s%s%s%s\n",
  730. reg_val & (1<<29) ? "ED " : "",
  731. reg_val & (1<<28) ? "ET " : "",
  732. reg_val & (1<<26) ? "EE " : "",
  733. reg_val & (1<<25) ? "EB " : "",
  734. reg_val & (1<<24) ? "EI " : "",
  735. reg_val & (1<<23) ? "E1 " : "",
  736. reg_val & (1<<22) ? "E0 " : "");
  737. printk("IDX: 0x%08x\n", reg_val & ((1<<22)-1));
  738. #if defined(CONFIG_CPU_MIPS32_R1) || defined(CONFIG_CPU_MIPS64_R1)
  739. if (reg_val & (1<<22))
  740. printk("DErrAddr0: 0x%0*lx\n", field, read_c0_derraddr0());
  741. if (reg_val & (1<<23))
  742. printk("DErrAddr1: 0x%0*lx\n", field, read_c0_derraddr1());
  743. #endif
  744. panic("Can't handle the cache error!");
  745. }
  746. /*
  747. * SDBBP EJTAG debug exception handler.
  748. * We skip the instruction and return to the next instruction.
  749. */
  750. void ejtag_exception_handler(struct pt_regs *regs)
  751. {
  752. const int field = 2 * sizeof(unsigned long);
  753. unsigned long depc, old_epc;
  754. unsigned int debug;
  755. printk("SDBBP EJTAG debug exception - not handled yet, just ignored!\n");
  756. depc = read_c0_depc();
  757. debug = read_c0_debug();
  758. printk("c0_depc = %0*lx, DEBUG = %08x\n", field, depc, debug);
  759. if (debug & 0x80000000) {
  760. /*
  761. * In branch delay slot.
  762. * We cheat a little bit here and use EPC to calculate the
  763. * debug return address (DEPC). EPC is restored after the
  764. * calculation.
  765. */
  766. old_epc = regs->cp0_epc;
  767. regs->cp0_epc = depc;
  768. __compute_return_epc(regs);
  769. depc = regs->cp0_epc;
  770. regs->cp0_epc = old_epc;
  771. } else
  772. depc += 4;
  773. write_c0_depc(depc);
  774. #if 0
  775. printk("\n\n----- Enable EJTAG single stepping ----\n\n");
  776. write_c0_debug(debug | 0x100);
  777. #endif
  778. }
  779. /*
  780. * NMI exception handler.
  781. */
  782. void nmi_exception_handler(struct pt_regs *regs)
  783. {
  784. printk("NMI taken!!!!\n");
  785. die("NMI", regs);
  786. while(1) ;
  787. }
  788. #define VECTORSPACING 0x100 /* for EI/VI mode */
  789. unsigned long ebase;
  790. unsigned long exception_handlers[32];
  791. unsigned long vi_handlers[64];
  792. /*
  793. * As a side effect of the way this is implemented we're limited
  794. * to interrupt handlers in the address range from
  795. * KSEG0 <= x < KSEG0 + 256mb on the Nevada. Oh well ...
  796. */
  797. void *set_except_vector(int n, void *addr)
  798. {
  799. unsigned long handler = (unsigned long) addr;
  800. unsigned long old_handler = exception_handlers[n];
  801. exception_handlers[n] = handler;
  802. if (n == 0 && cpu_has_divec) {
  803. *(volatile u32 *)(ebase + 0x200) = 0x08000000 |
  804. (0x03ffffff & (handler >> 2));
  805. flush_icache_range(ebase + 0x200, ebase + 0x204);
  806. }
  807. return (void *)old_handler;
  808. }
  809. #ifdef CONFIG_CPU_MIPSR2
  810. /*
  811. * Shadow register allocation
  812. * FIXME: SMP...
  813. */
  814. /* MIPSR2 shadow register sets */
  815. struct shadow_registers {
  816. spinlock_t sr_lock; /* */
  817. int sr_supported; /* Number of shadow register sets supported */
  818. int sr_allocated; /* Bitmap of allocated shadow registers */
  819. } shadow_registers;
  820. void mips_srs_init(void)
  821. {
  822. #ifdef CONFIG_CPU_MIPSR2_SRS
  823. shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
  824. printk ("%d MIPSR2 register sets available\n", shadow_registers.sr_supported);
  825. #else
  826. shadow_registers.sr_supported = 1;
  827. #endif
  828. shadow_registers.sr_allocated = 1; /* Set 0 used by kernel */
  829. spin_lock_init(&shadow_registers.sr_lock);
  830. }
  831. int mips_srs_max(void)
  832. {
  833. return shadow_registers.sr_supported;
  834. }
  835. int mips_srs_alloc (void)
  836. {
  837. struct shadow_registers *sr = &shadow_registers;
  838. unsigned long flags;
  839. int set;
  840. spin_lock_irqsave(&sr->sr_lock, flags);
  841. for (set = 0; set < sr->sr_supported; set++) {
  842. if ((sr->sr_allocated & (1 << set)) == 0) {
  843. sr->sr_allocated |= 1 << set;
  844. spin_unlock_irqrestore(&sr->sr_lock, flags);
  845. return set;
  846. }
  847. }
  848. /* None available */
  849. spin_unlock_irqrestore(&sr->sr_lock, flags);
  850. return -1;
  851. }
  852. void mips_srs_free (int set)
  853. {
  854. struct shadow_registers *sr = &shadow_registers;
  855. unsigned long flags;
  856. spin_lock_irqsave(&sr->sr_lock, flags);
  857. sr->sr_allocated &= ~(1 << set);
  858. spin_unlock_irqrestore(&sr->sr_lock, flags);
  859. }
  860. void *set_vi_srs_handler (int n, void *addr, int srs)
  861. {
  862. unsigned long handler;
  863. unsigned long old_handler = vi_handlers[n];
  864. u32 *w;
  865. unsigned char *b;
  866. if (!cpu_has_veic && !cpu_has_vint)
  867. BUG();
  868. if (addr == NULL) {
  869. handler = (unsigned long) do_default_vi;
  870. srs = 0;
  871. }
  872. else
  873. handler = (unsigned long) addr;
  874. vi_handlers[n] = (unsigned long) addr;
  875. b = (unsigned char *)(ebase + 0x200 + n*VECTORSPACING);
  876. if (srs >= mips_srs_max())
  877. panic("Shadow register set %d not supported", srs);
  878. if (cpu_has_veic) {
  879. if (board_bind_eic_interrupt)
  880. board_bind_eic_interrupt (n, srs);
  881. }
  882. else if (cpu_has_vint) {
  883. /* SRSMap is only defined if shadow sets are implemented */
  884. if (mips_srs_max() > 1)
  885. change_c0_srsmap (0xf << n*4, srs << n*4);
  886. }
  887. if (srs == 0) {
  888. /*
  889. * If no shadow set is selected then use the default handler
  890. * that does normal register saving and a standard interrupt exit
  891. */
  892. extern char except_vec_vi, except_vec_vi_lui;
  893. extern char except_vec_vi_ori, except_vec_vi_end;
  894. const int handler_len = &except_vec_vi_end - &except_vec_vi;
  895. const int lui_offset = &except_vec_vi_lui - &except_vec_vi;
  896. const int ori_offset = &except_vec_vi_ori - &except_vec_vi;
  897. if (handler_len > VECTORSPACING) {
  898. /*
  899. * Sigh... panicing won't help as the console
  900. * is probably not configured :(
  901. */
  902. panic ("VECTORSPACING too small");
  903. }
  904. memcpy (b, &except_vec_vi, handler_len);
  905. w = (u32 *)(b + lui_offset);
  906. *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff);
  907. w = (u32 *)(b + ori_offset);
  908. *w = (*w & 0xffff0000) | ((u32)handler & 0xffff);
  909. flush_icache_range((unsigned long)b, (unsigned long)(b+handler_len));
  910. }
  911. else {
  912. /*
  913. * In other cases jump directly to the interrupt handler
  914. *
  915. * It is the handlers responsibility to save registers if required
  916. * (eg hi/lo) and return from the exception using "eret"
  917. */
  918. w = (u32 *)b;
  919. *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */
  920. *w = 0;
  921. flush_icache_range((unsigned long)b, (unsigned long)(b+8));
  922. }
  923. return (void *)old_handler;
  924. }
  925. void *set_vi_handler (int n, void *addr)
  926. {
  927. return set_vi_srs_handler (n, addr, 0);
  928. }
  929. #endif
  930. /*
  931. * This is used by native signal handling
  932. */
  933. asmlinkage int (*save_fp_context)(struct sigcontext *sc);
  934. asmlinkage int (*restore_fp_context)(struct sigcontext *sc);
  935. extern asmlinkage int _save_fp_context(struct sigcontext *sc);
  936. extern asmlinkage int _restore_fp_context(struct sigcontext *sc);
  937. extern asmlinkage int fpu_emulator_save_context(struct sigcontext *sc);
  938. extern asmlinkage int fpu_emulator_restore_context(struct sigcontext *sc);
  939. static inline void signal_init(void)
  940. {
  941. if (cpu_has_fpu) {
  942. save_fp_context = _save_fp_context;
  943. restore_fp_context = _restore_fp_context;
  944. } else {
  945. save_fp_context = fpu_emulator_save_context;
  946. restore_fp_context = fpu_emulator_restore_context;
  947. }
  948. }
  949. #ifdef CONFIG_MIPS32_COMPAT
  950. /*
  951. * This is used by 32-bit signal stuff on the 64-bit kernel
  952. */
  953. asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc);
  954. asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc);
  955. extern asmlinkage int _save_fp_context32(struct sigcontext32 *sc);
  956. extern asmlinkage int _restore_fp_context32(struct sigcontext32 *sc);
  957. extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 *sc);
  958. extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 *sc);
  959. static inline void signal32_init(void)
  960. {
  961. if (cpu_has_fpu) {
  962. save_fp_context32 = _save_fp_context32;
  963. restore_fp_context32 = _restore_fp_context32;
  964. } else {
  965. save_fp_context32 = fpu_emulator_save_context32;
  966. restore_fp_context32 = fpu_emulator_restore_context32;
  967. }
  968. }
  969. #endif
  970. extern void cpu_cache_init(void);
  971. extern void tlb_init(void);
  972. extern void flush_tlb_handlers(void);
  973. void __init per_cpu_trap_init(void)
  974. {
  975. unsigned int cpu = smp_processor_id();
  976. unsigned int status_set = ST0_CU0;
  977. /*
  978. * Disable coprocessors and select 32-bit or 64-bit addressing
  979. * and the 16/32 or 32/32 FPR register model. Reset the BEV
  980. * flag that some firmware may have left set and the TS bit (for
  981. * IP27). Set XX for ISA IV code to work.
  982. */
  983. #ifdef CONFIG_64BIT
  984. status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX;
  985. #endif
  986. if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
  987. status_set |= ST0_XX;
  988. change_c0_status(ST0_CU|ST0_MX|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
  989. status_set);
  990. if (cpu_has_dsp)
  991. set_c0_status(ST0_MX);
  992. #ifdef CONFIG_CPU_MIPSR2
  993. write_c0_hwrena (0x0000000f); /* Allow rdhwr to all registers */
  994. #endif
  995. /*
  996. * Interrupt handling.
  997. */
  998. if (cpu_has_veic || cpu_has_vint) {
  999. write_c0_ebase (ebase);
  1000. /* Setting vector spacing enables EI/VI mode */
  1001. change_c0_intctl (0x3e0, VECTORSPACING);
  1002. }
  1003. if (cpu_has_divec) {
  1004. if (cpu_has_mipsmt) {
  1005. unsigned int vpflags = dvpe();
  1006. set_c0_cause(CAUSEF_IV);
  1007. evpe(vpflags);
  1008. } else
  1009. set_c0_cause(CAUSEF_IV);
  1010. }
  1011. cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
  1012. TLBMISS_HANDLER_SETUP();
  1013. atomic_inc(&init_mm.mm_count);
  1014. current->active_mm = &init_mm;
  1015. BUG_ON(current->mm);
  1016. enter_lazy_tlb(&init_mm, current);
  1017. cpu_cache_init();
  1018. tlb_init();
  1019. }
  1020. /* Install CPU exception handler */
  1021. void __init set_handler (unsigned long offset, void *addr, unsigned long size)
  1022. {
  1023. memcpy((void *)(ebase + offset), addr, size);
  1024. flush_icache_range(ebase + offset, ebase + offset + size);
  1025. }
  1026. /* Install uncached CPU exception handler */
  1027. void __init set_uncached_handler (unsigned long offset, void *addr, unsigned long size)
  1028. {
  1029. #ifdef CONFIG_32BIT
  1030. unsigned long uncached_ebase = KSEG1ADDR(ebase);
  1031. #endif
  1032. #ifdef CONFIG_64BIT
  1033. unsigned long uncached_ebase = TO_UNCAC(ebase);
  1034. #endif
  1035. memcpy((void *)(uncached_ebase + offset), addr, size);
  1036. }
  1037. void __init trap_init(void)
  1038. {
  1039. extern char except_vec3_generic, except_vec3_r4000;
  1040. extern char except_vec4;
  1041. unsigned long i;
  1042. if (cpu_has_veic || cpu_has_vint)
  1043. ebase = (unsigned long) alloc_bootmem_low_pages (0x200 + VECTORSPACING*64);
  1044. else
  1045. ebase = CAC_BASE;
  1046. #ifdef CONFIG_CPU_MIPSR2
  1047. mips_srs_init();
  1048. #endif
  1049. per_cpu_trap_init();
  1050. /*
  1051. * Copy the generic exception handlers to their final destination.
  1052. * This will be overriden later as suitable for a particular
  1053. * configuration.
  1054. */
  1055. set_handler(0x180, &except_vec3_generic, 0x80);
  1056. /*
  1057. * Setup default vectors
  1058. */
  1059. for (i = 0; i <= 31; i++)
  1060. set_except_vector(i, handle_reserved);
  1061. /*
  1062. * Copy the EJTAG debug exception vector handler code to it's final
  1063. * destination.
  1064. */
  1065. if (cpu_has_ejtag && board_ejtag_handler_setup)
  1066. board_ejtag_handler_setup ();
  1067. /*
  1068. * Only some CPUs have the watch exceptions.
  1069. */
  1070. if (cpu_has_watch)
  1071. set_except_vector(23, handle_watch);
  1072. /*
  1073. * Initialise interrupt handlers
  1074. */
  1075. if (cpu_has_veic || cpu_has_vint) {
  1076. int nvec = cpu_has_veic ? 64 : 8;
  1077. for (i = 0; i < nvec; i++)
  1078. set_vi_handler (i, NULL);
  1079. }
  1080. else if (cpu_has_divec)
  1081. set_handler(0x200, &except_vec4, 0x8);
  1082. /*
  1083. * Some CPUs can enable/disable for cache parity detection, but does
  1084. * it different ways.
  1085. */
  1086. parity_protection_init();
  1087. /*
  1088. * The Data Bus Errors / Instruction Bus Errors are signaled
  1089. * by external hardware. Therefore these two exceptions
  1090. * may have board specific handlers.
  1091. */
  1092. if (board_be_init)
  1093. board_be_init();
  1094. set_except_vector(1, handle_tlbm);
  1095. set_except_vector(2, handle_tlbl);
  1096. set_except_vector(3, handle_tlbs);
  1097. set_except_vector(4, handle_adel);
  1098. set_except_vector(5, handle_ades);
  1099. set_except_vector(6, handle_ibe);
  1100. set_except_vector(7, handle_dbe);
  1101. set_except_vector(8, handle_sys);
  1102. set_except_vector(9, handle_bp);
  1103. set_except_vector(10, handle_ri);
  1104. set_except_vector(11, handle_cpu);
  1105. set_except_vector(12, handle_ov);
  1106. set_except_vector(13, handle_tr);
  1107. if (current_cpu_data.cputype == CPU_R6000 ||
  1108. current_cpu_data.cputype == CPU_R6000A) {
  1109. /*
  1110. * The R6000 is the only R-series CPU that features a machine
  1111. * check exception (similar to the R4000 cache error) and
  1112. * unaligned ldc1/sdc1 exception. The handlers have not been
  1113. * written yet. Well, anyway there is no R6000 machine on the
  1114. * current list of targets for Linux/MIPS.
  1115. * (Duh, crap, there is someone with a triple R6k machine)
  1116. */
  1117. //set_except_vector(14, handle_mc);
  1118. //set_except_vector(15, handle_ndc);
  1119. }
  1120. if (board_nmi_handler_setup)
  1121. board_nmi_handler_setup();
  1122. if (cpu_has_fpu && !cpu_has_nofpuex)
  1123. set_except_vector(15, handle_fpe);
  1124. set_except_vector(22, handle_mdmx);
  1125. if (cpu_has_mcheck)
  1126. set_except_vector(24, handle_mcheck);
  1127. if (cpu_has_dsp)
  1128. set_except_vector(26, handle_dsp);
  1129. if (cpu_has_vce)
  1130. /* Special exception: R4[04]00 uses also the divec space. */
  1131. memcpy((void *)(CAC_BASE + 0x180), &except_vec3_r4000, 0x100);
  1132. else if (cpu_has_4kex)
  1133. memcpy((void *)(CAC_BASE + 0x180), &except_vec3_generic, 0x80);
  1134. else
  1135. memcpy((void *)(CAC_BASE + 0x080), &except_vec3_generic, 0x80);
  1136. signal_init();
  1137. #ifdef CONFIG_MIPS32_COMPAT
  1138. signal32_init();
  1139. #endif
  1140. flush_icache_range(ebase, ebase + 0x400);
  1141. flush_tlb_handlers();
  1142. }