irq.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. /* irq.c: FRV IRQ handling
  2. *
  3. * Copyright (C) 2003, 2004 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. /*
  12. * (mostly architecture independent, will move to kernel/irq.c in 2.5.)
  13. *
  14. * IRQs are in fact implemented a bit like signal handlers for the kernel.
  15. * Naturally it's not a 1:1 relation, but there are similarities.
  16. */
  17. #include <linux/ptrace.h>
  18. #include <linux/errno.h>
  19. #include <linux/signal.h>
  20. #include <linux/sched.h>
  21. #include <linux/ioport.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/timex.h>
  24. #include <linux/slab.h>
  25. #include <linux/random.h>
  26. #include <linux/smp_lock.h>
  27. #include <linux/init.h>
  28. #include <linux/kernel_stat.h>
  29. #include <linux/irq.h>
  30. #include <linux/proc_fs.h>
  31. #include <linux/seq_file.h>
  32. #include <linux/module.h>
  33. #include <asm/atomic.h>
  34. #include <asm/io.h>
  35. #include <asm/smp.h>
  36. #include <asm/system.h>
  37. #include <asm/bitops.h>
  38. #include <asm/uaccess.h>
  39. #include <asm/pgalloc.h>
  40. #include <asm/delay.h>
  41. #include <asm/irq.h>
  42. #include <asm/irc-regs.h>
  43. #include <asm/irq-routing.h>
  44. #include <asm/gdb-stub.h>
  45. extern void __init fpga_init(void);
  46. extern void __init route_mb93493_irqs(void);
  47. static void register_irq_proc (unsigned int irq);
  48. /*
  49. * Special irq handlers.
  50. */
  51. irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) { return IRQ_HANDLED; }
  52. atomic_t irq_err_count;
  53. /*
  54. * Generic, controller-independent functions:
  55. */
  56. int show_interrupts(struct seq_file *p, void *v)
  57. {
  58. struct irqaction *action;
  59. struct irq_group *group;
  60. unsigned long flags;
  61. int level, grp, ix, i, j;
  62. i = *(loff_t *) v;
  63. switch (i) {
  64. case 0:
  65. seq_printf(p, " ");
  66. for_each_online_cpu(j)
  67. seq_printf(p, "CPU%d ",j);
  68. seq_putc(p, '\n');
  69. break;
  70. case 1 ... NR_IRQ_GROUPS * NR_IRQ_ACTIONS_PER_GROUP:
  71. local_irq_save(flags);
  72. grp = (i - 1) / NR_IRQ_ACTIONS_PER_GROUP;
  73. group = irq_groups[grp];
  74. if (!group)
  75. goto skip;
  76. ix = (i - 1) % NR_IRQ_ACTIONS_PER_GROUP;
  77. action = group->actions[ix];
  78. if (!action)
  79. goto skip;
  80. seq_printf(p, "%3d: ", i - 1);
  81. #ifndef CONFIG_SMP
  82. seq_printf(p, "%10u ", kstat_irqs(i));
  83. #else
  84. for_each_online_cpu(j)
  85. seq_printf(p, "%10u ", kstat_cpu(j).irqs[i - 1]);
  86. #endif
  87. level = group->sources[ix]->level - frv_irq_levels;
  88. seq_printf(p, " %12s@%x", group->sources[ix]->muxname, level);
  89. seq_printf(p, " %s", action->name);
  90. for (action = action->next; action; action = action->next)
  91. seq_printf(p, ", %s", action->name);
  92. seq_putc(p, '\n');
  93. skip:
  94. local_irq_restore(flags);
  95. break;
  96. case NR_IRQ_GROUPS * NR_IRQ_ACTIONS_PER_GROUP + 1:
  97. seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
  98. break;
  99. default:
  100. break;
  101. }
  102. return 0;
  103. }
  104. /*
  105. * Generic enable/disable code: this just calls
  106. * down into the PIC-specific version for the actual
  107. * hardware disable after having gotten the irq
  108. * controller lock.
  109. */
  110. /**
  111. * disable_irq_nosync - disable an irq without waiting
  112. * @irq: Interrupt to disable
  113. *
  114. * Disable the selected interrupt line. Disables and Enables are
  115. * nested.
  116. * Unlike disable_irq(), this function does not ensure existing
  117. * instances of the IRQ handler have completed before returning.
  118. *
  119. * This function may be called from IRQ context.
  120. */
  121. void disable_irq_nosync(unsigned int irq)
  122. {
  123. struct irq_source *source;
  124. struct irq_group *group;
  125. struct irq_level *level;
  126. unsigned long flags;
  127. int idx = irq & (NR_IRQ_ACTIONS_PER_GROUP - 1);
  128. group = irq_groups[irq >> NR_IRQ_LOG2_ACTIONS_PER_GROUP];
  129. if (!group)
  130. BUG();
  131. source = group->sources[idx];
  132. if (!source)
  133. BUG();
  134. level = source->level;
  135. spin_lock_irqsave(&level->lock, flags);
  136. if (group->control) {
  137. if (!group->disable_cnt[idx]++)
  138. group->control(group, idx, 0);
  139. } else if (!level->disable_count++) {
  140. __set_MASK(level - frv_irq_levels);
  141. }
  142. spin_unlock_irqrestore(&level->lock, flags);
  143. }
  144. EXPORT_SYMBOL(disable_irq_nosync);
  145. /**
  146. * disable_irq - disable an irq and wait for completion
  147. * @irq: Interrupt to disable
  148. *
  149. * Disable the selected interrupt line. Enables and Disables are
  150. * nested.
  151. * This function waits for any pending IRQ handlers for this interrupt
  152. * to complete before returning. If you use this function while
  153. * holding a resource the IRQ handler may need you will deadlock.
  154. *
  155. * This function may be called - with care - from IRQ context.
  156. */
  157. void disable_irq(unsigned int irq)
  158. {
  159. disable_irq_nosync(irq);
  160. #ifdef CONFIG_SMP
  161. if (!local_irq_count(smp_processor_id())) {
  162. do {
  163. barrier();
  164. } while (irq_desc[irq].status & IRQ_INPROGRESS);
  165. }
  166. #endif
  167. }
  168. EXPORT_SYMBOL(disable_irq);
  169. /**
  170. * enable_irq - enable handling of an irq
  171. * @irq: Interrupt to enable
  172. *
  173. * Undoes the effect of one call to disable_irq(). If this
  174. * matches the last disable, processing of interrupts on this
  175. * IRQ line is re-enabled.
  176. *
  177. * This function may be called from IRQ context.
  178. */
  179. void enable_irq(unsigned int irq)
  180. {
  181. struct irq_source *source;
  182. struct irq_group *group;
  183. struct irq_level *level;
  184. unsigned long flags;
  185. int idx = irq & (NR_IRQ_ACTIONS_PER_GROUP - 1);
  186. int count;
  187. group = irq_groups[irq >> NR_IRQ_LOG2_ACTIONS_PER_GROUP];
  188. if (!group)
  189. BUG();
  190. source = group->sources[idx];
  191. if (!source)
  192. BUG();
  193. level = source->level;
  194. spin_lock_irqsave(&level->lock, flags);
  195. if (group->control)
  196. count = group->disable_cnt[idx];
  197. else
  198. count = level->disable_count;
  199. switch (count) {
  200. case 1:
  201. if (group->control) {
  202. if (group->actions[idx])
  203. group->control(group, idx, 1);
  204. } else {
  205. if (level->usage)
  206. __clr_MASK(level - frv_irq_levels);
  207. }
  208. /* fall-through */
  209. default:
  210. count--;
  211. break;
  212. case 0:
  213. printk("enable_irq(%u) unbalanced from %p\n", irq, __builtin_return_address(0));
  214. }
  215. if (group->control)
  216. group->disable_cnt[idx] = count;
  217. else
  218. level->disable_count = count;
  219. spin_unlock_irqrestore(&level->lock, flags);
  220. }
  221. EXPORT_SYMBOL(enable_irq);
  222. /*****************************************************************************/
  223. /*
  224. * handles all normal device IRQ's
  225. * - registers are referred to by the __frame variable (GR28)
  226. * - IRQ distribution is complicated in this arch because of the many PICs, the
  227. * way they work and the way they cascade
  228. */
  229. asmlinkage void do_IRQ(void)
  230. {
  231. struct irq_source *source;
  232. int level, cpu;
  233. irq_enter();
  234. level = (__frame->tbr >> 4) & 0xf;
  235. cpu = smp_processor_id();
  236. if ((unsigned long) __frame - (unsigned long) (current + 1) < 512)
  237. BUG();
  238. __set_MASK(level);
  239. __clr_RC(level);
  240. __clr_IRL();
  241. kstat_this_cpu.irqs[level]++;
  242. for (source = frv_irq_levels[level].sources; source; source = source->next)
  243. source->doirq(source);
  244. __clr_MASK(level);
  245. irq_exit();
  246. } /* end do_IRQ() */
  247. /*****************************************************************************/
  248. /*
  249. * handles all NMIs when not co-opted by the debugger
  250. * - registers are referred to by the __frame variable (GR28)
  251. */
  252. asmlinkage void do_NMI(void)
  253. {
  254. } /* end do_NMI() */
  255. /*****************************************************************************/
  256. /**
  257. * request_irq - allocate an interrupt line
  258. * @irq: Interrupt line to allocate
  259. * @handler: Function to be called when the IRQ occurs
  260. * @irqflags: Interrupt type flags
  261. * @devname: An ascii name for the claiming device
  262. * @dev_id: A cookie passed back to the handler function
  263. *
  264. * This call allocates interrupt resources and enables the
  265. * interrupt line and IRQ handling. From the point this
  266. * call is made your handler function may be invoked. Since
  267. * your handler function must clear any interrupt the board
  268. * raises, you must take care both to initialise your hardware
  269. * and to set up the interrupt handler in the right order.
  270. *
  271. * Dev_id must be globally unique. Normally the address of the
  272. * device data structure is used as the cookie. Since the handler
  273. * receives this value it makes sense to use it.
  274. *
  275. * If your interrupt is shared you must pass a non NULL dev_id
  276. * as this is required when freeing the interrupt.
  277. *
  278. * Flags:
  279. *
  280. * IRQF_SHARED Interrupt is shared
  281. *
  282. * IRQF_DISABLED Disable local interrupts while processing
  283. *
  284. * IRQF_SAMPLE_RANDOM The interrupt can be used for entropy
  285. *
  286. */
  287. int request_irq(unsigned int irq,
  288. irqreturn_t (*handler)(int, void *, struct pt_regs *),
  289. unsigned long irqflags,
  290. const char * devname,
  291. void *dev_id)
  292. {
  293. int retval;
  294. struct irqaction *action;
  295. #if 1
  296. /*
  297. * Sanity-check: shared interrupts should REALLY pass in
  298. * a real dev-ID, otherwise we'll have trouble later trying
  299. * to figure out which interrupt is which (messes up the
  300. * interrupt freeing logic etc).
  301. */
  302. if (irqflags & IRQF_SHARED) {
  303. if (!dev_id)
  304. printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n",
  305. devname, (&irq)[-1]);
  306. }
  307. #endif
  308. if ((irq >> NR_IRQ_LOG2_ACTIONS_PER_GROUP) >= NR_IRQ_GROUPS)
  309. return -EINVAL;
  310. if (!handler)
  311. return -EINVAL;
  312. action = (struct irqaction *) kmalloc(sizeof(struct irqaction), GFP_KERNEL);
  313. if (!action)
  314. return -ENOMEM;
  315. action->handler = handler;
  316. action->flags = irqflags;
  317. action->mask = CPU_MASK_NONE;
  318. action->name = devname;
  319. action->next = NULL;
  320. action->dev_id = dev_id;
  321. retval = setup_irq(irq, action);
  322. if (retval)
  323. kfree(action);
  324. return retval;
  325. }
  326. EXPORT_SYMBOL(request_irq);
  327. /**
  328. * free_irq - free an interrupt
  329. * @irq: Interrupt line to free
  330. * @dev_id: Device identity to free
  331. *
  332. * Remove an interrupt handler. The handler is removed and if the
  333. * interrupt line is no longer in use by any driver it is disabled.
  334. * On a shared IRQ the caller must ensure the interrupt is disabled
  335. * on the card it drives before calling this function. The function
  336. * does not return until any executing interrupts for this IRQ
  337. * have completed.
  338. *
  339. * This function may be called from interrupt context.
  340. *
  341. * Bugs: Attempting to free an irq in a handler for the same irq hangs
  342. * the machine.
  343. */
  344. void free_irq(unsigned int irq, void *dev_id)
  345. {
  346. struct irq_source *source;
  347. struct irq_group *group;
  348. struct irq_level *level;
  349. struct irqaction **p, **pp;
  350. unsigned long flags;
  351. if ((irq >> NR_IRQ_LOG2_ACTIONS_PER_GROUP) >= NR_IRQ_GROUPS)
  352. return;
  353. group = irq_groups[irq >> NR_IRQ_LOG2_ACTIONS_PER_GROUP];
  354. if (!group)
  355. BUG();
  356. source = group->sources[irq & (NR_IRQ_ACTIONS_PER_GROUP - 1)];
  357. if (!source)
  358. BUG();
  359. level = source->level;
  360. p = &group->actions[irq & (NR_IRQ_ACTIONS_PER_GROUP - 1)];
  361. spin_lock_irqsave(&level->lock, flags);
  362. for (pp = p; *pp; pp = &(*pp)->next) {
  363. struct irqaction *action = *pp;
  364. if (action->dev_id != dev_id)
  365. continue;
  366. /* found it - remove from the list of entries */
  367. *pp = action->next;
  368. level->usage--;
  369. if (p == pp && group->control)
  370. group->control(group, irq & (NR_IRQ_ACTIONS_PER_GROUP - 1), 0);
  371. if (level->usage == 0)
  372. __set_MASK(level - frv_irq_levels);
  373. spin_unlock_irqrestore(&level->lock,flags);
  374. #ifdef CONFIG_SMP
  375. /* Wait to make sure it's not being used on another CPU */
  376. while (desc->status & IRQ_INPROGRESS)
  377. barrier();
  378. #endif
  379. kfree(action);
  380. return;
  381. }
  382. }
  383. EXPORT_SYMBOL(free_irq);
  384. /*
  385. * IRQ autodetection code..
  386. *
  387. * This depends on the fact that any interrupt that comes in on to an
  388. * unassigned IRQ will cause GxICR_DETECT to be set
  389. */
  390. static DECLARE_MUTEX(probe_sem);
  391. /**
  392. * probe_irq_on - begin an interrupt autodetect
  393. *
  394. * Commence probing for an interrupt. The interrupts are scanned
  395. * and a mask of potential interrupt lines is returned.
  396. *
  397. */
  398. unsigned long probe_irq_on(void)
  399. {
  400. down(&probe_sem);
  401. return 0;
  402. }
  403. EXPORT_SYMBOL(probe_irq_on);
  404. /*
  405. * Return a mask of triggered interrupts (this
  406. * can handle only legacy ISA interrupts).
  407. */
  408. /**
  409. * probe_irq_mask - scan a bitmap of interrupt lines
  410. * @val: mask of interrupts to consider
  411. *
  412. * Scan the ISA bus interrupt lines and return a bitmap of
  413. * active interrupts. The interrupt probe logic state is then
  414. * returned to its previous value.
  415. *
  416. * Note: we need to scan all the irq's even though we will
  417. * only return ISA irq numbers - just so that we reset them
  418. * all to a known state.
  419. */
  420. unsigned int probe_irq_mask(unsigned long xmask)
  421. {
  422. up(&probe_sem);
  423. return 0;
  424. }
  425. EXPORT_SYMBOL(probe_irq_mask);
  426. /*
  427. * Return the one interrupt that triggered (this can
  428. * handle any interrupt source).
  429. */
  430. /**
  431. * probe_irq_off - end an interrupt autodetect
  432. * @xmask: mask of potential interrupts (unused)
  433. *
  434. * Scans the unused interrupt lines and returns the line which
  435. * appears to have triggered the interrupt. If no interrupt was
  436. * found then zero is returned. If more than one interrupt is
  437. * found then minus the first candidate is returned to indicate
  438. * their is doubt.
  439. *
  440. * The interrupt probe logic state is returned to its previous
  441. * value.
  442. *
  443. * BUGS: When used in a module (which arguably shouldnt happen)
  444. * nothing prevents two IRQ probe callers from overlapping. The
  445. * results of this are non-optimal.
  446. */
  447. int probe_irq_off(unsigned long xmask)
  448. {
  449. up(&probe_sem);
  450. return -1;
  451. }
  452. EXPORT_SYMBOL(probe_irq_off);
  453. /* this was setup_x86_irq but it seems pretty generic */
  454. int setup_irq(unsigned int irq, struct irqaction *new)
  455. {
  456. struct irq_source *source;
  457. struct irq_group *group;
  458. struct irq_level *level;
  459. struct irqaction **p, **pp;
  460. unsigned long flags;
  461. group = irq_groups[irq >> NR_IRQ_LOG2_ACTIONS_PER_GROUP];
  462. if (!group)
  463. BUG();
  464. source = group->sources[irq & (NR_IRQ_ACTIONS_PER_GROUP - 1)];
  465. if (!source)
  466. BUG();
  467. level = source->level;
  468. p = &group->actions[irq & (NR_IRQ_ACTIONS_PER_GROUP - 1)];
  469. /*
  470. * Some drivers like serial.c use request_irq() heavily,
  471. * so we have to be careful not to interfere with a
  472. * running system.
  473. */
  474. if (new->flags & IRQF_SAMPLE_RANDOM) {
  475. /*
  476. * This function might sleep, we want to call it first,
  477. * outside of the atomic block.
  478. * Yes, this might clear the entropy pool if the wrong
  479. * driver is attempted to be loaded, without actually
  480. * installing a new handler, but is this really a problem,
  481. * only the sysadmin is able to do this.
  482. */
  483. rand_initialize_irq(irq);
  484. }
  485. /* must juggle the interrupt processing stuff with interrupts disabled */
  486. spin_lock_irqsave(&level->lock, flags);
  487. /* can't share interrupts unless all parties agree to */
  488. if (level->usage != 0 && !(level->flags & new->flags & IRQF_SHARED)) {
  489. spin_unlock_irqrestore(&level->lock,flags);
  490. return -EBUSY;
  491. }
  492. /* add new interrupt at end of irq queue */
  493. pp = p;
  494. while (*pp)
  495. pp = &(*pp)->next;
  496. *pp = new;
  497. level->usage++;
  498. level->flags = new->flags;
  499. /* turn the interrupts on */
  500. if (level->usage == 1)
  501. __clr_MASK(level - frv_irq_levels);
  502. if (p == pp && group->control)
  503. group->control(group, irq & (NR_IRQ_ACTIONS_PER_GROUP - 1), 1);
  504. spin_unlock_irqrestore(&level->lock, flags);
  505. register_irq_proc(irq);
  506. return 0;
  507. }
  508. static struct proc_dir_entry * root_irq_dir;
  509. static struct proc_dir_entry * irq_dir [NR_IRQS];
  510. #define HEX_DIGITS 8
  511. static unsigned int parse_hex_value (const char __user *buffer,
  512. unsigned long count, unsigned long *ret)
  513. {
  514. unsigned char hexnum [HEX_DIGITS];
  515. unsigned long value;
  516. int i;
  517. if (!count)
  518. return -EINVAL;
  519. if (count > HEX_DIGITS)
  520. count = HEX_DIGITS;
  521. if (copy_from_user(hexnum, buffer, count))
  522. return -EFAULT;
  523. /*
  524. * Parse the first 8 characters as a hex string, any non-hex char
  525. * is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
  526. */
  527. value = 0;
  528. for (i = 0; i < count; i++) {
  529. unsigned int c = hexnum[i];
  530. switch (c) {
  531. case '0' ... '9': c -= '0'; break;
  532. case 'a' ... 'f': c -= 'a'-10; break;
  533. case 'A' ... 'F': c -= 'A'-10; break;
  534. default:
  535. goto out;
  536. }
  537. value = (value << 4) | c;
  538. }
  539. out:
  540. *ret = value;
  541. return 0;
  542. }
  543. static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
  544. int count, int *eof, void *data)
  545. {
  546. unsigned long *mask = (unsigned long *) data;
  547. if (count < HEX_DIGITS+1)
  548. return -EINVAL;
  549. return sprintf (page, "%08lx\n", *mask);
  550. }
  551. static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer,
  552. unsigned long count, void *data)
  553. {
  554. unsigned long *mask = (unsigned long *) data, full_count = count, err;
  555. unsigned long new_value;
  556. show_state();
  557. err = parse_hex_value(buffer, count, &new_value);
  558. if (err)
  559. return err;
  560. *mask = new_value;
  561. return full_count;
  562. }
  563. #define MAX_NAMELEN 10
  564. static void register_irq_proc (unsigned int irq)
  565. {
  566. char name [MAX_NAMELEN];
  567. if (!root_irq_dir || irq_dir[irq])
  568. return;
  569. memset(name, 0, MAX_NAMELEN);
  570. sprintf(name, "%d", irq);
  571. /* create /proc/irq/1234 */
  572. irq_dir[irq] = proc_mkdir(name, root_irq_dir);
  573. }
  574. unsigned long prof_cpu_mask = -1;
  575. void init_irq_proc (void)
  576. {
  577. struct proc_dir_entry *entry;
  578. int i;
  579. /* create /proc/irq */
  580. root_irq_dir = proc_mkdir("irq", NULL);
  581. /* create /proc/irq/prof_cpu_mask */
  582. entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
  583. if (!entry)
  584. return;
  585. entry->nlink = 1;
  586. entry->data = (void *)&prof_cpu_mask;
  587. entry->read_proc = prof_cpu_mask_read_proc;
  588. entry->write_proc = prof_cpu_mask_write_proc;
  589. /*
  590. * Create entries for all existing IRQs.
  591. */
  592. for (i = 0; i < NR_IRQS; i++)
  593. register_irq_proc(i);
  594. }
  595. /*****************************************************************************/
  596. /*
  597. * initialise the interrupt system
  598. */
  599. void __init init_IRQ(void)
  600. {
  601. route_cpu_irqs();
  602. fpga_init();
  603. #ifdef CONFIG_FUJITSU_MB93493
  604. route_mb93493_irqs();
  605. #endif
  606. } /* end init_IRQ() */