2 * linux/arch/h8300/platform/h8300h/ints_h8300h.c
3 * Interrupt handling CPU variants
5 * Yoshinori Sato <ysato@users.sourceforge.jp>
9 #include <linux/init.h>
10 #include <linux/errno.h>
12 #include <asm/ptrace.h>
13 #include <asm/traps.h>
17 #include <asm/regs306x.h>
19 /* saved vector list */
20 const int __initdata h8300_saved_vectors[]={
21 #if defined(CONFIG_GDB_DEBUG)
27 /* trap entry table */
28 const unsigned long __initdata h8300_trap_table[NR_TRAPS]={
30 (unsigned long)system_call, /* TRAPA #0 */
32 (unsigned long)trace_break, /* TRAPA #3 */
35 int h8300_enable_irq_pin(unsigned int irq)
38 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
41 /* initialize IRQ pin */
42 bitmask = 1 << (irq - EXT_IRQ0);
48 if (H8300_GPIO_RESERVE(H8300_GPIO_P8, bitmask) == 0)
50 H8300_GPIO_DDR(H8300_GPIO_P8, bitmask, H8300_GPIO_INPUT);
54 if (H8300_GPIO_RESERVE(H8300_GPIO_P9, bitmask) == 0)
56 H8300_GPIO_DDR(H8300_GPIO_P9, bitmask, H8300_GPIO_INPUT);
63 void h8300_disable_irq_pin(unsigned int irq)
66 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
69 /* disable interrupt & release IRQ pin */
70 bitmask = 1 << (irq - EXT_IRQ0);
76 *(volatile unsigned char *)IER &= ~bitmask;
77 H8300_GPIO_FREE(H8300_GPIO_P8, bitmask);
81 *(volatile unsigned char *)IER &= ~bitmask;
82 H8300_GPIO_FREE(H8300_GPIO_P9, bitmask);