irq.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. /*
  2. * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include <linux/config.h>
  19. #include <linux/kernel.h>
  20. #include <linux/init.h>
  21. #include <linux/linkage.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/spinlock.h>
  24. #include <linux/mm.h>
  25. #include <linux/slab.h>
  26. #include <linux/kernel_stat.h>
  27. #include <asm/errno.h>
  28. #include <asm/signal.h>
  29. #include <asm/system.h>
  30. #include <asm/ptrace.h>
  31. #include <asm/io.h>
  32. #include <asm/sibyte/bcm1480_regs.h>
  33. #include <asm/sibyte/bcm1480_int.h>
  34. #include <asm/sibyte/bcm1480_scd.h>
  35. #include <asm/sibyte/sb1250_uart.h>
  36. #include <asm/sibyte/sb1250.h>
  37. /*
  38. * These are the routines that handle all the low level interrupt stuff.
  39. * Actions handled here are: initialization of the interrupt map, requesting of
  40. * interrupt lines by handlers, dispatching if interrupts to handlers, probing
  41. * for interrupt lines
  42. */
  43. #define shutdown_bcm1480_irq disable_bcm1480_irq
  44. static void end_bcm1480_irq(unsigned int irq);
  45. static void enable_bcm1480_irq(unsigned int irq);
  46. static void disable_bcm1480_irq(unsigned int irq);
  47. static unsigned int startup_bcm1480_irq(unsigned int irq);
  48. static void ack_bcm1480_irq(unsigned int irq);
  49. #ifdef CONFIG_SMP
  50. static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask);
  51. #endif
  52. #ifdef CONFIG_PCI
  53. extern unsigned long ht_eoi_space;
  54. #endif
  55. #ifdef CONFIG_KGDB
  56. #include <asm/gdb-stub.h>
  57. extern void breakpoint(void);
  58. static int kgdb_irq;
  59. #ifdef CONFIG_GDB_CONSOLE
  60. extern void register_gdb_console(void);
  61. #endif
  62. /* kgdb is on when configured. Pass "nokgdb" kernel arg to turn it off */
  63. static int kgdb_flag = 1;
  64. static int __init nokgdb(char *str)
  65. {
  66. kgdb_flag = 0;
  67. return 1;
  68. }
  69. __setup("nokgdb", nokgdb);
  70. /* Default to UART1 */
  71. int kgdb_port = 1;
  72. #ifdef CONFIG_SIBYTE_SB1250_DUART
  73. extern char sb1250_duart_present[];
  74. #endif
  75. #endif
  76. static struct hw_interrupt_type bcm1480_irq_type = {
  77. .typename = "BCM1480-IMR",
  78. .startup = startup_bcm1480_irq,
  79. .shutdown = shutdown_bcm1480_irq,
  80. .enable = enable_bcm1480_irq,
  81. .disable = disable_bcm1480_irq,
  82. .ack = ack_bcm1480_irq,
  83. .end = end_bcm1480_irq,
  84. #ifdef CONFIG_SMP
  85. .set_affinity = bcm1480_set_affinity
  86. #endif
  87. };
  88. /* Store the CPU id (not the logical number) */
  89. int bcm1480_irq_owner[BCM1480_NR_IRQS];
  90. DEFINE_SPINLOCK(bcm1480_imr_lock);
  91. void bcm1480_mask_irq(int cpu, int irq)
  92. {
  93. unsigned long flags;
  94. u64 cur_ints,hl_spacing;
  95. spin_lock_irqsave(&bcm1480_imr_lock, flags);
  96. hl_spacing = 0;
  97. if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
  98. hl_spacing = BCM1480_IMR_HL_SPACING;
  99. irq -= BCM1480_NR_IRQS_HALF;
  100. }
  101. cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
  102. cur_ints |= (((u64) 1) << irq);
  103. ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
  104. spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
  105. }
  106. void bcm1480_unmask_irq(int cpu, int irq)
  107. {
  108. unsigned long flags;
  109. u64 cur_ints,hl_spacing;
  110. spin_lock_irqsave(&bcm1480_imr_lock, flags);
  111. hl_spacing = 0;
  112. if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
  113. hl_spacing = BCM1480_IMR_HL_SPACING;
  114. irq -= BCM1480_NR_IRQS_HALF;
  115. }
  116. cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
  117. cur_ints &= ~(((u64) 1) << irq);
  118. ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
  119. spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
  120. }
  121. #ifdef CONFIG_SMP
  122. static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask)
  123. {
  124. int i = 0, old_cpu, cpu, int_on, k;
  125. u64 cur_ints;
  126. irq_desc_t *desc = irq_desc + irq;
  127. unsigned long flags;
  128. unsigned int irq_dirty;
  129. i = first_cpu(mask);
  130. if (next_cpu(i, mask) <= NR_CPUS) {
  131. printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
  132. return;
  133. }
  134. /* Convert logical CPU to physical CPU */
  135. cpu = cpu_logical_map(i);
  136. /* Protect against other affinity changers and IMR manipulation */
  137. spin_lock_irqsave(&desc->lock, flags);
  138. spin_lock(&bcm1480_imr_lock);
  139. /* Swizzle each CPU's IMR (but leave the IP selection alone) */
  140. old_cpu = bcm1480_irq_owner[irq];
  141. irq_dirty = irq;
  142. if ((irq_dirty >= BCM1480_NR_IRQS_HALF) && (irq_dirty <= BCM1480_NR_IRQS)) {
  143. irq_dirty -= BCM1480_NR_IRQS_HALF;
  144. }
  145. for (k=0; k<2; k++) { /* Loop through high and low interrupt mask register */
  146. cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(old_cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
  147. int_on = !(cur_ints & (((u64) 1) << irq_dirty));
  148. if (int_on) {
  149. /* If it was on, mask it */
  150. cur_ints |= (((u64) 1) << irq_dirty);
  151. ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(old_cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
  152. }
  153. bcm1480_irq_owner[irq] = cpu;
  154. if (int_on) {
  155. /* unmask for the new CPU */
  156. cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
  157. cur_ints &= ~(((u64) 1) << irq_dirty);
  158. ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
  159. }
  160. }
  161. spin_unlock(&bcm1480_imr_lock);
  162. spin_unlock_irqrestore(&desc->lock, flags);
  163. }
  164. #endif
  165. /*****************************************************************************/
  166. static unsigned int startup_bcm1480_irq(unsigned int irq)
  167. {
  168. bcm1480_unmask_irq(bcm1480_irq_owner[irq], irq);
  169. return 0; /* never anything pending */
  170. }
  171. static void disable_bcm1480_irq(unsigned int irq)
  172. {
  173. bcm1480_mask_irq(bcm1480_irq_owner[irq], irq);
  174. }
  175. static void enable_bcm1480_irq(unsigned int irq)
  176. {
  177. bcm1480_unmask_irq(bcm1480_irq_owner[irq], irq);
  178. }
  179. static void ack_bcm1480_irq(unsigned int irq)
  180. {
  181. u64 pending;
  182. unsigned int irq_dirty;
  183. int k;
  184. /*
  185. * If the interrupt was an HT interrupt, now is the time to
  186. * clear it. NOTE: we assume the HT bridge was set up to
  187. * deliver the interrupts to all CPUs (which makes affinity
  188. * changing easier for us)
  189. */
  190. irq_dirty = irq;
  191. if ((irq_dirty >= BCM1480_NR_IRQS_HALF) && (irq_dirty <= BCM1480_NR_IRQS)) {
  192. irq_dirty -= BCM1480_NR_IRQS_HALF;
  193. }
  194. for (k=0; k<2; k++) { /* Loop through high and low LDT interrupts */
  195. pending = __raw_readq(IOADDR(A_BCM1480_IMR_REGISTER(bcm1480_irq_owner[irq],
  196. R_BCM1480_IMR_LDT_INTERRUPT_H + (k*BCM1480_IMR_HL_SPACING))));
  197. pending &= ((u64)1 << (irq_dirty));
  198. if (pending) {
  199. #ifdef CONFIG_SMP
  200. int i;
  201. for (i=0; i<NR_CPUS; i++) {
  202. /*
  203. * Clear for all CPUs so an affinity switch
  204. * doesn't find an old status
  205. */
  206. __raw_writeq(pending, IOADDR(A_BCM1480_IMR_REGISTER(cpu_logical_map(i),
  207. R_BCM1480_IMR_LDT_INTERRUPT_CLR_H + (k*BCM1480_IMR_HL_SPACING))));
  208. }
  209. #else
  210. __raw_writeq(pending, IOADDR(A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_LDT_INTERRUPT_CLR_H + (k*BCM1480_IMR_HL_SPACING))));
  211. #endif
  212. /*
  213. * Generate EOI. For Pass 1 parts, EOI is a nop. For
  214. * Pass 2, the LDT world may be edge-triggered, but
  215. * this EOI shouldn't hurt. If they are
  216. * level-sensitive, the EOI is required.
  217. */
  218. #ifdef CONFIG_PCI
  219. if (ht_eoi_space)
  220. *(uint32_t *)(ht_eoi_space+(irq<<16)+(7<<2)) = 0;
  221. #endif
  222. }
  223. }
  224. bcm1480_mask_irq(bcm1480_irq_owner[irq], irq);
  225. }
  226. static void end_bcm1480_irq(unsigned int irq)
  227. {
  228. if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
  229. bcm1480_unmask_irq(bcm1480_irq_owner[irq], irq);
  230. }
  231. }
  232. void __init init_bcm1480_irqs(void)
  233. {
  234. int i;
  235. for (i = 0; i < NR_IRQS; i++) {
  236. irq_desc[i].status = IRQ_DISABLED;
  237. irq_desc[i].action = 0;
  238. irq_desc[i].depth = 1;
  239. if (i < BCM1480_NR_IRQS) {
  240. irq_desc[i].handler = &bcm1480_irq_type;
  241. bcm1480_irq_owner[i] = 0;
  242. } else {
  243. irq_desc[i].handler = &no_irq_type;
  244. }
  245. }
  246. }
  247. static irqreturn_t bcm1480_dummy_handler(int irq, void *dev_id,
  248. struct pt_regs *regs)
  249. {
  250. return IRQ_NONE;
  251. }
  252. static struct irqaction bcm1480_dummy_action = {
  253. .handler = bcm1480_dummy_handler,
  254. .flags = 0,
  255. .mask = CPU_MASK_NONE,
  256. .name = "bcm1480-private",
  257. .next = NULL,
  258. .dev_id = 0
  259. };
  260. int bcm1480_steal_irq(int irq)
  261. {
  262. irq_desc_t *desc = irq_desc + irq;
  263. unsigned long flags;
  264. int retval = 0;
  265. if (irq >= BCM1480_NR_IRQS)
  266. return -EINVAL;
  267. spin_lock_irqsave(&desc->lock,flags);
  268. /* Don't allow sharing at all for these */
  269. if (desc->action != NULL)
  270. retval = -EBUSY;
  271. else {
  272. desc->action = &bcm1480_dummy_action;
  273. desc->depth = 0;
  274. }
  275. spin_unlock_irqrestore(&desc->lock,flags);
  276. return 0;
  277. }
  278. /*
  279. * init_IRQ is called early in the boot sequence from init/main.c. It
  280. * is responsible for setting up the interrupt mapper and installing the
  281. * handler that will be responsible for dispatching interrupts to the
  282. * "right" place.
  283. */
  284. /*
  285. * For now, map all interrupts to IP[2]. We could save
  286. * some cycles by parceling out system interrupts to different
  287. * IP lines, but keep it simple for bringup. We'll also direct
  288. * all interrupts to a single CPU; we should probably route
  289. * PCI and LDT to one cpu and everything else to the other
  290. * to balance the load a bit.
  291. *
  292. * On the second cpu, everything is set to IP5, which is
  293. * ignored, EXCEPT the mailbox interrupt. That one is
  294. * set to IP[2] so it is handled. This is needed so we
  295. * can do cross-cpu function calls, as requred by SMP
  296. */
  297. #define IMR_IP2_VAL K_BCM1480_INT_MAP_I0
  298. #define IMR_IP3_VAL K_BCM1480_INT_MAP_I1
  299. #define IMR_IP4_VAL K_BCM1480_INT_MAP_I2
  300. #define IMR_IP5_VAL K_BCM1480_INT_MAP_I3
  301. #define IMR_IP6_VAL K_BCM1480_INT_MAP_I4
  302. void __init arch_init_irq(void)
  303. {
  304. unsigned int i, cpu;
  305. u64 tmp;
  306. unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 |
  307. STATUSF_IP1 | STATUSF_IP0;
  308. /* Default everything to IP2 */
  309. /* Start with _high registers which has no bit 0 interrupt source */
  310. for (i = 1; i < BCM1480_NR_IRQS_HALF; i++) { /* was I0 */
  311. for (cpu = 0; cpu < 4; cpu++) {
  312. __raw_writeq(IMR_IP2_VAL,
  313. IOADDR(A_BCM1480_IMR_REGISTER(cpu,
  314. R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) + (i << 3)));
  315. }
  316. }
  317. /* Now do _low registers */
  318. for (i = 0; i < BCM1480_NR_IRQS_HALF; i++) {
  319. for (cpu = 0; cpu < 4; cpu++) {
  320. __raw_writeq(IMR_IP2_VAL,
  321. IOADDR(A_BCM1480_IMR_REGISTER(cpu,
  322. R_BCM1480_IMR_INTERRUPT_MAP_BASE_L) + (i << 3)));
  323. }
  324. }
  325. init_bcm1480_irqs();
  326. /*
  327. * Map the high 16 bits of mailbox_0 registers to IP[3], for
  328. * inter-cpu messages
  329. */
  330. /* Was I1 */
  331. for (cpu = 0; cpu < 4; cpu++) {
  332. __raw_writeq(IMR_IP3_VAL, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
  333. (K_BCM1480_INT_MBOX_0_0 << 3)));
  334. }
  335. /* Clear the mailboxes. The firmware may leave them dirty */
  336. for (cpu = 0; cpu < 4; cpu++) {
  337. __raw_writeq(0xffffffffffffffffULL,
  338. IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_MAILBOX_0_CLR_CPU)));
  339. __raw_writeq(0xffffffffffffffffULL,
  340. IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_MAILBOX_1_CLR_CPU)));
  341. }
  342. /* Mask everything except the high 16 bit of mailbox_0 registers for all cpus */
  343. tmp = ~((u64) 0) ^ ( (((u64) 1) << K_BCM1480_INT_MBOX_0_0));
  344. for (cpu = 0; cpu < 4; cpu++) {
  345. __raw_writeq(tmp, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MASK_H)));
  346. }
  347. tmp = ~((u64) 0);
  348. for (cpu = 0; cpu < 4; cpu++) {
  349. __raw_writeq(tmp, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MASK_L)));
  350. }
  351. bcm1480_steal_irq(K_BCM1480_INT_MBOX_0_0);
  352. /*
  353. * Note that the timer interrupts are also mapped, but this is
  354. * done in bcm1480_time_init(). Also, the profiling driver
  355. * does its own management of IP7.
  356. */
  357. #ifdef CONFIG_KGDB
  358. imask |= STATUSF_IP6;
  359. #endif
  360. /* Enable necessary IPs, disable the rest */
  361. change_c0_status(ST0_IM, imask);
  362. #ifdef CONFIG_KGDB
  363. if (kgdb_flag) {
  364. kgdb_irq = K_BCM1480_INT_UART_0 + kgdb_port;
  365. #ifdef CONFIG_SIBYTE_SB1250_DUART
  366. sb1250_duart_present[kgdb_port] = 0;
  367. #endif
  368. /* Setup uart 1 settings, mapper */
  369. /* QQQ FIXME */
  370. __raw_writeq(M_DUART_IMR_BRK, IO_SPACE_BASE + A_DUART_IMRREG(kgdb_port));
  371. bcm1480_steal_irq(kgdb_irq);
  372. __raw_writeq(IMR_IP6_VAL,
  373. IO_SPACE_BASE + A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
  374. (kgdb_irq<<3));
  375. bcm1480_unmask_irq(0, kgdb_irq);
  376. #ifdef CONFIG_GDB_CONSOLE
  377. register_gdb_console();
  378. #endif
  379. prom_printf("Waiting for GDB on UART port %d\n", kgdb_port);
  380. set_debug_traps();
  381. breakpoint();
  382. }
  383. #endif
  384. }
  385. #ifdef CONFIG_KGDB
  386. #include <linux/delay.h>
  387. #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
  388. #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
  389. void bcm1480_kgdb_interrupt(struct pt_regs *regs)
  390. {
  391. /*
  392. * Clear break-change status (allow some time for the remote
  393. * host to stop the break, since we would see another
  394. * interrupt on the end-of-break too)
  395. */
  396. kstat.irqs[smp_processor_id()][kgdb_irq]++;
  397. mdelay(500);
  398. duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT |
  399. M_DUART_RX_EN | M_DUART_TX_EN);
  400. set_async_breakpoint(&regs->cp0_epc);
  401. }
  402. #endif /* CONFIG_KGDB */
  403. static inline int dclz(unsigned long long x)
  404. {
  405. int lz;
  406. __asm__ (
  407. " .set push \n"
  408. " .set mips64 \n"
  409. " dclz %0, %1 \n"
  410. " .set pop \n"
  411. : "=r" (lz)
  412. : "r" (x));
  413. return lz;
  414. }
  415. extern void bcm1480_timer_interrupt(struct pt_regs *regs);
  416. extern void bcm1480_mailbox_interrupt(struct pt_regs *regs);
  417. extern void bcm1480_kgdb_interrupt(struct pt_regs *regs);
  418. asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
  419. {
  420. unsigned int pending;
  421. #ifdef CONFIG_SIBYTE_BCM1480_PROF
  422. /* Set compare to count to silence count/compare timer interrupts */
  423. write_c0_compare(read_c0_count());
  424. #endif
  425. pending = read_c0_cause();
  426. #ifdef CONFIG_SIBYTE_BCM1480_PROF
  427. if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */
  428. sbprof_cpu_intr(exception_epc(regs));
  429. #endif
  430. if (pending & CAUSEF_IP4)
  431. bcm1480_timer_interrupt(regs);
  432. #ifdef CONFIG_SMP
  433. if (pending & CAUSEF_IP3)
  434. bcm1480_mailbox_interrupt(regs);
  435. #endif
  436. #ifdef CONFIG_KGDB
  437. if (pending & CAUSEF_IP6)
  438. bcm1480_kgdb_interrupt(regs); /* KGDB (uart 1) */
  439. #endif
  440. if (pending & CAUSEF_IP2) {
  441. unsigned long long mask_h, mask_l;
  442. unsigned long base;
  443. /*
  444. * Default...we've hit an IP[2] interrupt, which means we've
  445. * got to check the 1480 interrupt registers to figure out what
  446. * to do. Need to detect which CPU we're on, now that
  447. * smp_affinity is supported.
  448. */
  449. base = A_BCM1480_IMR_MAPPER(smp_processor_id());
  450. mask_h = __raw_readq(
  451. IOADDR(base + R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H));
  452. mask_l = __raw_readq(
  453. IOADDR(base + R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L));
  454. if (!mask_h) {
  455. if (mask_h ^ 1)
  456. do_IRQ(63 - dclz(mask_h), regs);
  457. else
  458. do_IRQ(127 - dclz(mask_l), regs);
  459. }
  460. }
  461. }