Re: [PATCH] h8300 generic irq

2007-04-30 Thread Yoshinori Sato
At Fri, 27 Apr 2007 19:09:35 -0700,
Andrew Morton wrote:
> 
> On Thu, 26 Apr 2007 17:34:37 +0900
> Yoshinori Sato <[EMAIL PROTECTED]> wrote:
> 
> > h8300 using generic irq handler patch.
> > 
> > Signed-off-by: Yoshinori Sato <[EMAIL PROTECTED]>
> > 
> 
> Minor things:
> 
> >
> > --- /dev/null
> > +++ b/arch/h8300/kernel/irq.c
> > @@ -0,0 +1,211 @@
> > +/*
> > + * linux/arch/h8300/kernel/irq.c
> > + *
> > + * Copyright 2007 Yoshinori Sato <[EMAIL PROTECTED]>
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/*#define DEBUG*/
> > +
> > +extern unsigned long *interrupt_redirect_table;
> > +extern const int h8300_saved_vectors[];
> > +extern const unsigned long h8300_trap_table[];
> > +int h8300_enable_irq_pin(unsigned int irq);
> > +void h8300_disable_irq_pin(unsigned int irq);
> 
> Please always avoid putting extern declarations into C files.  Please them
> in a header file which is visible tot he definition site asw well as all
> callers/users.
> 
> For something which is defined in assembly code (like
> interrupt_redirect_table) it isn't so clear, because we cannot do
> typechecking.  But I think it's still best to include the declaration in a
> header file so that we only have to declare it once.  Plus it _is_ a global
> symbol.

I was sure. correct it.
 
> > +
> > +/*
> > + * h8300 interrupt controler implementation
> > + */
> > +struct irq_chip h8300irq_chip = {
> > +   .name   = "H8300-INTC",
> > +   .startup= h8300_startup_irq,
> > +   .shutdown   = h8300_shutdown_irq,
> > +   .enable = h8300_enable_irq,
> > +   .disable= h8300_disable_irq,
> > +   .ack= NULL,
> > +   .end= h8300_end_irq,
> > +};
> 
> I think this could have static scope.

I do not need to refer from the outside.
I make a change in static.
 
> > +void ack_bad_irq(unsigned int irq)
> > +{
> > +   printk("unexpected IRQ trap at vector %02x\n", irq);
> > +}
> 
> printks should generally have facility levels (KERN_*)
> 
> > +   panic("interrupt vector serup failed.");
> 
> typo
> 
> > +   for ( i = 0; i < NR_IRQS; i++) {
> 
>   for (i = 0
> 
> > +   if (i == *saved_vector) {
> > +   ramvec_p++;
> > +   saved_vector++;
> > +   } else {
> > +   if ( i < NR_TRAPS ) {
> 
>   if (i < NR_TRAPS)
> 
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] h8300 generic irq

2007-04-30 Thread Yoshinori Sato
At Fri, 27 Apr 2007 19:09:35 -0700,
Andrew Morton wrote:
 
 On Thu, 26 Apr 2007 17:34:37 +0900
 Yoshinori Sato [EMAIL PROTECTED] wrote:
 
  h8300 using generic irq handler patch.
  
  Signed-off-by: Yoshinori Sato [EMAIL PROTECTED]
  
 
 Minor things:
 
 
  --- /dev/null
  +++ b/arch/h8300/kernel/irq.c
  @@ -0,0 +1,211 @@
  +/*
  + * linux/arch/h8300/kernel/irq.c
  + *
  + * Copyright 2007 Yoshinori Sato [EMAIL PROTECTED]
  + */
  +
  +#include linux/module.h
  +#include linux/types.h
  +#include linux/kernel.h
  +#include linux/sched.h
  +#include linux/kernel_stat.h
  +#include linux/seq_file.h
  +#include linux/init.h
  +#include linux/random.h
  +#include linux/bootmem.h
  +#include linux/irq.h
  +
  +#include asm/system.h
  +#include asm/traps.h
  +#include asm/io.h
  +#include asm/setup.h
  +#include asm/errno.h
  +
  +/*#define DEBUG*/
  +
  +extern unsigned long *interrupt_redirect_table;
  +extern const int h8300_saved_vectors[];
  +extern const unsigned long h8300_trap_table[];
  +int h8300_enable_irq_pin(unsigned int irq);
  +void h8300_disable_irq_pin(unsigned int irq);
 
 Please always avoid putting extern declarations into C files.  Please them
 in a header file which is visible tot he definition site asw well as all
 callers/users.
 
 For something which is defined in assembly code (like
 interrupt_redirect_table) it isn't so clear, because we cannot do
 typechecking.  But I think it's still best to include the declaration in a
 header file so that we only have to declare it once.  Plus it _is_ a global
 symbol.

I was sure. correct it.
 
  +
  +/*
  + * h8300 interrupt controler implementation
  + */
  +struct irq_chip h8300irq_chip = {
  +   .name   = H8300-INTC,
  +   .startup= h8300_startup_irq,
  +   .shutdown   = h8300_shutdown_irq,
  +   .enable = h8300_enable_irq,
  +   .disable= h8300_disable_irq,
  +   .ack= NULL,
  +   .end= h8300_end_irq,
  +};
 
 I think this could have static scope.

I do not need to refer from the outside.
I make a change in static.
 
  +void ack_bad_irq(unsigned int irq)
  +{
  +   printk(unexpected IRQ trap at vector %02x\n, irq);
  +}
 
 printks should generally have facility levels (KERN_*)
 
  +   panic(interrupt vector serup failed.);
 
 typo
 
  +   for ( i = 0; i  NR_IRQS; i++) {
 
   for (i = 0
 
  +   if (i == *saved_vector) {
  +   ramvec_p++;
  +   saved_vector++;
  +   } else {
  +   if ( i  NR_TRAPS ) {
 
   if (i  NR_TRAPS)
 
 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] h8300 generic irq

2007-04-28 Thread Christoph Hellwig
On Fri, Apr 27, 2007 at 07:09:35PM -0700, Andrew Morton wrote:
> > +/*
> > + * h8300 interrupt controler implementation
> > + */
> > +struct irq_chip h8300irq_chip = {
> > +   .name   = "H8300-INTC",
> > +   .startup= h8300_startup_irq,
> > +   .shutdown   = h8300_shutdown_irq,
> > +   .enable = h8300_enable_irq,
> > +   .disable= h8300_disable_irq,
> > +   .ack= NULL,
> > +   .end= h8300_end_irq,
> > +};
> 
> I think this could have static scope.

Pluse there's not need to set .ack to NULL explicitly.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] h8300 generic irq

2007-04-28 Thread Christoph Hellwig
On Fri, Apr 27, 2007 at 07:09:35PM -0700, Andrew Morton wrote:
  +/*
  + * h8300 interrupt controler implementation
  + */
  +struct irq_chip h8300irq_chip = {
  +   .name   = H8300-INTC,
  +   .startup= h8300_startup_irq,
  +   .shutdown   = h8300_shutdown_irq,
  +   .enable = h8300_enable_irq,
  +   .disable= h8300_disable_irq,
  +   .ack= NULL,
  +   .end= h8300_end_irq,
  +};
 
 I think this could have static scope.

Pluse there's not need to set .ack to NULL explicitly.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] h8300 generic irq

2007-04-27 Thread Andrew Morton
On Thu, 26 Apr 2007 17:34:37 +0900
Yoshinori Sato <[EMAIL PROTECTED]> wrote:

> h8300 using generic irq handler patch.
> 
> Signed-off-by: Yoshinori Sato <[EMAIL PROTECTED]>
> 

Minor things:

>
> --- /dev/null
> +++ b/arch/h8300/kernel/irq.c
> @@ -0,0 +1,211 @@
> +/*
> + * linux/arch/h8300/kernel/irq.c
> + *
> + * Copyright 2007 Yoshinori Sato <[EMAIL PROTECTED]>
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/*#define DEBUG*/
> +
> +extern unsigned long *interrupt_redirect_table;
> +extern const int h8300_saved_vectors[];
> +extern const unsigned long h8300_trap_table[];
> +int h8300_enable_irq_pin(unsigned int irq);
> +void h8300_disable_irq_pin(unsigned int irq);

Please always avoid putting extern declarations into C files.  Please them
in a header file which is visible tot he definition site asw well as all
callers/users.

For something which is defined in assembly code (like
interrupt_redirect_table) it isn't so clear, because we cannot do
typechecking.  But I think it's still best to include the declaration in a
header file so that we only have to declare it once.  Plus it _is_ a global
symbol.

> +
> +/*
> + * h8300 interrupt controler implementation
> + */
> +struct irq_chip h8300irq_chip = {
> + .name   = "H8300-INTC",
> + .startup= h8300_startup_irq,
> + .shutdown   = h8300_shutdown_irq,
> + .enable = h8300_enable_irq,
> + .disable= h8300_disable_irq,
> + .ack= NULL,
> + .end= h8300_end_irq,
> +};

I think this could have static scope.

> +void ack_bad_irq(unsigned int irq)
> +{
> + printk("unexpected IRQ trap at vector %02x\n", irq);
> +}

printks should generally have facility levels (KERN_*)

> + panic("interrupt vector serup failed.");

typo

> + for ( i = 0; i < NR_IRQS; i++) {

for (i = 0

> + if (i == *saved_vector) {
> + ramvec_p++;
> + saved_vector++;
> + } else {
> + if ( i < NR_TRAPS ) {

if (i < NR_TRAPS)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] h8300 generic irq

2007-04-27 Thread Andrew Morton
On Thu, 26 Apr 2007 17:34:37 +0900
Yoshinori Sato [EMAIL PROTECTED] wrote:

 h8300 using generic irq handler patch.
 
 Signed-off-by: Yoshinori Sato [EMAIL PROTECTED]
 

Minor things:


 --- /dev/null
 +++ b/arch/h8300/kernel/irq.c
 @@ -0,0 +1,211 @@
 +/*
 + * linux/arch/h8300/kernel/irq.c
 + *
 + * Copyright 2007 Yoshinori Sato [EMAIL PROTECTED]
 + */
 +
 +#include linux/module.h
 +#include linux/types.h
 +#include linux/kernel.h
 +#include linux/sched.h
 +#include linux/kernel_stat.h
 +#include linux/seq_file.h
 +#include linux/init.h
 +#include linux/random.h
 +#include linux/bootmem.h
 +#include linux/irq.h
 +
 +#include asm/system.h
 +#include asm/traps.h
 +#include asm/io.h
 +#include asm/setup.h
 +#include asm/errno.h
 +
 +/*#define DEBUG*/
 +
 +extern unsigned long *interrupt_redirect_table;
 +extern const int h8300_saved_vectors[];
 +extern const unsigned long h8300_trap_table[];
 +int h8300_enable_irq_pin(unsigned int irq);
 +void h8300_disable_irq_pin(unsigned int irq);

Please always avoid putting extern declarations into C files.  Please them
in a header file which is visible tot he definition site asw well as all
callers/users.

For something which is defined in assembly code (like
interrupt_redirect_table) it isn't so clear, because we cannot do
typechecking.  But I think it's still best to include the declaration in a
header file so that we only have to declare it once.  Plus it _is_ a global
symbol.

 +
 +/*
 + * h8300 interrupt controler implementation
 + */
 +struct irq_chip h8300irq_chip = {
 + .name   = H8300-INTC,
 + .startup= h8300_startup_irq,
 + .shutdown   = h8300_shutdown_irq,
 + .enable = h8300_enable_irq,
 + .disable= h8300_disable_irq,
 + .ack= NULL,
 + .end= h8300_end_irq,
 +};

I think this could have static scope.

 +void ack_bad_irq(unsigned int irq)
 +{
 + printk(unexpected IRQ trap at vector %02x\n, irq);
 +}

printks should generally have facility levels (KERN_*)

 + panic(interrupt vector serup failed.);

typo

 + for ( i = 0; i  NR_IRQS; i++) {

for (i = 0

 + if (i == *saved_vector) {
 + ramvec_p++;
 + saved_vector++;
 + } else {
 + if ( i  NR_TRAPS ) {

if (i  NR_TRAPS)


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] h8300 generic irq

2007-04-26 Thread Yoshinori Sato
h8300 using generic irq handler patch.

Signed-off-by: Yoshinori Sato <[EMAIL PROTECTED]>

diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 1734d96..82d96ae 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -49,6 +49,10 @@ config GENERIC_HWEIGHT
bool
default y
 
+config GENERIC_HARDIRQS
+   bool
+   default y
+
 config GENERIC_CALIBRATE_DELAY
bool
default y
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index 40b3f56..b2d896a 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -41,7 +41,7 @@ LDFLAGS += $(ldflags-y)
 CROSS_COMPILE = h8300-elf-
 LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(CFLAGS) -print-libgcc-file-name)
 
-head-y := arch/$(ARCH)/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o
+head-y := arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/crt0_$(MODEL).o
 
 core-y += arch/$(ARCH)/kernel/ \
   arch/$(ARCH)/mm/
diff --git a/arch/h8300/kernel/Makefile b/arch/h8300/kernel/Makefile
index 4edbc2e..ccc1a7f 100644
--- a/arch/h8300/kernel/Makefile
+++ b/arch/h8300/kernel/Makefile
@@ -4,10 +4,8 @@
 
 extra-y := vmlinux.lds
 
-obj-y := process.o traps.o ptrace.o ints.o \
+obj-y := process.o traps.o ptrace.o irq.o \
 sys_h8300.o time.o semaphore.o signal.o \
- setup.o gpio.o init_task.o syscalls.o devres.o
-
-devres-y = ../../../kernel/irq/devres.o
+ setup.o gpio.o init_task.o syscalls.o
 
 obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o 
diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c
new file mode 100644
index 000..3e0c37f
--- /dev/null
+++ b/arch/h8300/kernel/irq.c
@@ -0,0 +1,211 @@
+/*
+ * linux/arch/h8300/kernel/irq.c
+ *
+ * Copyright 2007 Yoshinori Sato <[EMAIL PROTECTED]>
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*#define DEBUG*/
+
+extern unsigned long *interrupt_redirect_table;
+extern const int h8300_saved_vectors[];
+extern const unsigned long h8300_trap_table[];
+int h8300_enable_irq_pin(unsigned int irq);
+void h8300_disable_irq_pin(unsigned int irq);
+
+#define CPU_VECTOR ((unsigned long *)0x00)
+#define ADDR_MASK (0xff)
+
+static inline int is_ext_irq(unsigned int irq)
+{
+   return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS));
+}
+
+static void h8300_enable_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   IER_REGS |= 1 << (irq - EXT_IRQ0);
+}
+
+static void h8300_disable_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   IER_REGS &= ~(1 << (irq - EXT_IRQ0));
+}
+
+static void h8300_end_irq(unsigned int irq)
+{
+}
+
+static unsigned int h8300_startup_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   return h8300_enable_irq_pin(irq);
+   else
+   return 0;
+}
+
+static void h8300_shutdown_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   h8300_disable_irq_pin(irq);
+}
+
+/*
+ * h8300 interrupt controler implementation
+ */
+struct irq_chip h8300irq_chip = {
+   .name   = "H8300-INTC",
+   .startup= h8300_startup_irq,
+   .shutdown   = h8300_shutdown_irq,
+   .enable = h8300_enable_irq,
+   .disable= h8300_disable_irq,
+   .ack= NULL,
+   .end= h8300_end_irq,
+};
+
+void ack_bad_irq(unsigned int irq)
+{
+   printk("unexpected IRQ trap at vector %02x\n", irq);
+}
+
+#if defined(CONFIG_RAMKERNEL)
+static unsigned long __init *get_vector_address(void)
+{
+   unsigned long *rom_vector = CPU_VECTOR;
+   unsigned long base,tmp;
+   int vec_no;
+
+   base = rom_vector[EXT_IRQ0] & ADDR_MASK;
+   
+   /* check romvector format */
+   for (vec_no = EXT_IRQ1; vec_no <= EXT_IRQ0+EXT_IRQS; vec_no++) {
+   if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & 
ADDR_MASK))
+   return NULL;
+   }
+
+   /* ramvector base address */
+   base -= EXT_IRQ0*4;
+
+   /* writerble check */
+   tmp = ~(*(volatile unsigned long *)base);
+   (*(volatile unsigned long *)base) = tmp;
+   if ((*(volatile unsigned long *)base) != tmp)
+   return NULL;
+   return (unsigned long *)base;
+}
+
+static void __init setup_vector(void)
+{
+   int i;
+   unsigned long *ramvec,*ramvec_p;
+   const unsigned long *trap_entry;
+   const int *saved_vector;
+
+   ramvec = get_vector_address();
+   if (ramvec == NULL)
+   panic("interrupt vector serup failed.");
+   else
+   printk(KERN_INFO "virtual vector at 0x%08lx\n",(unsigned 
long)ramvec);
+
+   /* create redirect table */
+   ramvec_p = ramvec;
+   trap_entry = h8300_trap_table;
+   saved_vector = h8300_saved_vectors;
+   for ( i = 0; i < NR_IRQS; i++) {
+   if (i == *saved_vector) {
+   ramvec_p++;
+

[PATCH] h8300 generic irq

2007-04-26 Thread Yoshinori Sato
h8300 using generic irq handler patch.

Signed-off-by: Yoshinori Sato [EMAIL PROTECTED]

diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 1734d96..82d96ae 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -49,6 +49,10 @@ config GENERIC_HWEIGHT
bool
default y
 
+config GENERIC_HARDIRQS
+   bool
+   default y
+
 config GENERIC_CALIBRATE_DELAY
bool
default y
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index 40b3f56..b2d896a 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -41,7 +41,7 @@ LDFLAGS += $(ldflags-y)
 CROSS_COMPILE = h8300-elf-
 LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(CFLAGS) -print-libgcc-file-name)
 
-head-y := arch/$(ARCH)/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o
+head-y := arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/crt0_$(MODEL).o
 
 core-y += arch/$(ARCH)/kernel/ \
   arch/$(ARCH)/mm/
diff --git a/arch/h8300/kernel/Makefile b/arch/h8300/kernel/Makefile
index 4edbc2e..ccc1a7f 100644
--- a/arch/h8300/kernel/Makefile
+++ b/arch/h8300/kernel/Makefile
@@ -4,10 +4,8 @@
 
 extra-y := vmlinux.lds
 
-obj-y := process.o traps.o ptrace.o ints.o \
+obj-y := process.o traps.o ptrace.o irq.o \
 sys_h8300.o time.o semaphore.o signal.o \
- setup.o gpio.o init_task.o syscalls.o devres.o
-
-devres-y = ../../../kernel/irq/devres.o
+ setup.o gpio.o init_task.o syscalls.o
 
 obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o 
diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c
new file mode 100644
index 000..3e0c37f
--- /dev/null
+++ b/arch/h8300/kernel/irq.c
@@ -0,0 +1,211 @@
+/*
+ * linux/arch/h8300/kernel/irq.c
+ *
+ * Copyright 2007 Yoshinori Sato [EMAIL PROTECTED]
+ */
+
+#include linux/module.h
+#include linux/types.h
+#include linux/kernel.h
+#include linux/sched.h
+#include linux/kernel_stat.h
+#include linux/seq_file.h
+#include linux/init.h
+#include linux/random.h
+#include linux/bootmem.h
+#include linux/irq.h
+
+#include asm/system.h
+#include asm/traps.h
+#include asm/io.h
+#include asm/setup.h
+#include asm/errno.h
+
+/*#define DEBUG*/
+
+extern unsigned long *interrupt_redirect_table;
+extern const int h8300_saved_vectors[];
+extern const unsigned long h8300_trap_table[];
+int h8300_enable_irq_pin(unsigned int irq);
+void h8300_disable_irq_pin(unsigned int irq);
+
+#define CPU_VECTOR ((unsigned long *)0x00)
+#define ADDR_MASK (0xff)
+
+static inline int is_ext_irq(unsigned int irq)
+{
+   return (irq = EXT_IRQ0  irq = (EXT_IRQ0 + EXT_IRQS));
+}
+
+static void h8300_enable_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   IER_REGS |= 1  (irq - EXT_IRQ0);
+}
+
+static void h8300_disable_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   IER_REGS = ~(1  (irq - EXT_IRQ0));
+}
+
+static void h8300_end_irq(unsigned int irq)
+{
+}
+
+static unsigned int h8300_startup_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   return h8300_enable_irq_pin(irq);
+   else
+   return 0;
+}
+
+static void h8300_shutdown_irq(unsigned int irq)
+{
+   if (is_ext_irq(irq))
+   h8300_disable_irq_pin(irq);
+}
+
+/*
+ * h8300 interrupt controler implementation
+ */
+struct irq_chip h8300irq_chip = {
+   .name   = H8300-INTC,
+   .startup= h8300_startup_irq,
+   .shutdown   = h8300_shutdown_irq,
+   .enable = h8300_enable_irq,
+   .disable= h8300_disable_irq,
+   .ack= NULL,
+   .end= h8300_end_irq,
+};
+
+void ack_bad_irq(unsigned int irq)
+{
+   printk(unexpected IRQ trap at vector %02x\n, irq);
+}
+
+#if defined(CONFIG_RAMKERNEL)
+static unsigned long __init *get_vector_address(void)
+{
+   unsigned long *rom_vector = CPU_VECTOR;
+   unsigned long base,tmp;
+   int vec_no;
+
+   base = rom_vector[EXT_IRQ0]  ADDR_MASK;
+   
+   /* check romvector format */
+   for (vec_no = EXT_IRQ1; vec_no = EXT_IRQ0+EXT_IRQS; vec_no++) {
+   if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no]  
ADDR_MASK))
+   return NULL;
+   }
+
+   /* ramvector base address */
+   base -= EXT_IRQ0*4;
+
+   /* writerble check */
+   tmp = ~(*(volatile unsigned long *)base);
+   (*(volatile unsigned long *)base) = tmp;
+   if ((*(volatile unsigned long *)base) != tmp)
+   return NULL;
+   return (unsigned long *)base;
+}
+
+static void __init setup_vector(void)
+{
+   int i;
+   unsigned long *ramvec,*ramvec_p;
+   const unsigned long *trap_entry;
+   const int *saved_vector;
+
+   ramvec = get_vector_address();
+   if (ramvec == NULL)
+   panic(interrupt vector serup failed.);
+   else
+   printk(KERN_INFO virtual vector at 0x%08lx\n,(unsigned 
long)ramvec);
+
+   /* create redirect table */
+   ramvec_p = ramvec;
+   trap_entry = h8300_trap_table;
+