2 * Interrupt handling H8/300H depend.
3 * Yoshinori Sato <ysato@users.sourceforge.jp>
7 #include <linux/init.h>
8 #include <linux/errno.h>
10 #include <asm/ptrace.h>
11 #include <asm/traps.h>
14 #include <asm/gpio-internal.h>
15 #include <asm/regs306x.h>
17 const int __initdata h8300_saved_vectors
[] = {
18 #if defined(CONFIG_GDB_DEBUG)
19 TRAP3_VEC
, /* TRAPA #3 is GDB breakpoint */
24 const h8300_vector __initdata h8300_trap_table
[] = {
25 0, 0, 0, 0, 0, 0, 0, 0,
32 int h8300_enable_irq_pin(unsigned int irq
)
35 if (irq
< EXT_IRQ0
|| irq
> EXT_IRQ5
)
38 /* initialize IRQ pin */
39 bitmask
= 1 << (irq
- EXT_IRQ0
);
45 if (H8300_GPIO_RESERVE(H8300_GPIO_P8
, bitmask
) == 0)
47 H8300_GPIO_DDR(H8300_GPIO_P8
, bitmask
, H8300_GPIO_INPUT
);
51 if (H8300_GPIO_RESERVE(H8300_GPIO_P9
, bitmask
) == 0)
53 H8300_GPIO_DDR(H8300_GPIO_P9
, bitmask
, H8300_GPIO_INPUT
);
60 void h8300_disable_irq_pin(unsigned int irq
)
63 if (irq
< EXT_IRQ0
|| irq
> EXT_IRQ5
)
66 /* disable interrupt & release IRQ pin */
67 bitmask
= 1 << (irq
- EXT_IRQ0
);
73 *(volatile unsigned char *)IER
&= ~bitmask
;
74 H8300_GPIO_FREE(H8300_GPIO_P8
, bitmask
);
78 *(volatile unsigned char *)IER
&= ~bitmask
;
79 H8300_GPIO_FREE(H8300_GPIO_P9
, bitmask
);