2 * linux/arch/h8300/platform/h8300h/ints_h8300h.c
3 * Interrupt handling CPU variants
5 * Yoshinori Sato <ysato@users.sourceforge.jp>
9 #include <linux/config.h>
10 #include <linux/init.h>
11 #include <linux/errno.h>
13 #include <asm/ptrace.h>
14 #include <asm/traps.h>
18 #include <asm/regs306x.h>
20 /* saved vector list */
21 const int __initdata h8300_saved_vectors[]={
22 #if defined(CONFIG_GDB_DEBUG)
28 /* trap entry table */
29 const unsigned long __initdata h8300_trap_table[NR_TRAPS]={
31 (unsigned long)system_call, /* TRAPA #0 */
33 (unsigned long)trace_break, /* TRAPA #3 */
36 int h8300_enable_irq_pin(unsigned int irq)
39 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
42 /* initialize IRQ pin */
43 bitmask = 1 << (irq - EXT_IRQ0);
49 if (H8300_GPIO_RESERVE(H8300_GPIO_P8, bitmask) == 0)
51 H8300_GPIO_DDR(H8300_GPIO_P8, bitmask, H8300_GPIO_INPUT);
55 if (H8300_GPIO_RESERVE(H8300_GPIO_P9, bitmask) == 0)
57 H8300_GPIO_DDR(H8300_GPIO_P9, bitmask, H8300_GPIO_INPUT);
64 void h8300_disable_irq_pin(unsigned int irq)
67 if (irq < EXT_IRQ0 || irq > EXT_IRQ5)
70 /* disable interrupt & release IRQ pin */
71 bitmask = 1 << (irq - EXT_IRQ0);
77 *(volatile unsigned char *)IER &= ~bitmask;
78 H8300_GPIO_FREE(H8300_GPIO_P8, bitmask);
82 *(volatile unsigned char *)IER &= ~bitmask;
83 H8300_GPIO_FREE(H8300_GPIO_P9, bitmask);