7 #include <linux/module.h>
8 #include <linux/types.h>
9 #include <linux/kernel.h>
10 #include <linux/sched.h>
14 #include <linux/random.h>
19 #include <asm/traps.h>
21 #include <asm/setup.h>
22 #include <asm/errno.h>
32 #define CPU_VECTOR ((unsigned long *)0x000000)
33 #define ADDR_MASK (0xffffff)
35 static inline int is_ext_irq(
unsigned int irq)
37 return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS));
42 if (is_ext_irq(data->
irq))
43 IER_REGS |= 1 << (data->
irq - EXT_IRQ0);
46 static void h8300_disable_irq(
struct irq_data *data)
48 if (is_ext_irq(data->
irq))
49 IER_REGS &= ~(1 << (data->
irq - EXT_IRQ0));
52 static unsigned int h8300_startup_irq(
struct irq_data *data)
54 if (is_ext_irq(data->
irq))
60 static void h8300_shutdown_irq(
struct irq_data *data)
62 if (is_ext_irq(data->
irq))
71 .irq_startup = h8300_startup_irq,
72 .irq_shutdown = h8300_shutdown_irq,
73 .irq_enable = h8300_enable_irq,
74 .irq_disable = h8300_disable_irq,
77 #if defined(CONFIG_RAMKERNEL)
78 static unsigned long __init *get_vector_address(
void)
87 for (vec_no = EXT_IRQ1; vec_no <= EXT_IRQ0+EXT_IRQS; vec_no++) {
88 if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & ADDR_MASK))
96 tmp = ~(*(
volatile unsigned long *)base);
97 (*(
volatile unsigned long *)base) =
tmp;
98 if ((*(
volatile unsigned long *)base) != tmp)
100 return (
unsigned long *)base;
106 unsigned long *ramvec,*ramvec_p;
108 const int *saved_vector;
110 ramvec = get_vector_address();
112 panic(
"interrupt vector serup failed.");
120 for ( i = 0; i <
NR_IRQS; i++) {
121 if (i == *saved_vector) {
125 if ( i < NR_TRAPS ) {
127 *ramvec_p =
VECTOR(*trap_entry);
137 for (i = 0; i <
NR_IRQS; i++) {
147 #define setup_vector() do { } while(0)