Index: c/src/lib/libbsp/arm/edb7312/ChangeLog
===================================================================
--- c/src/lib/libbsp/arm/edb7312/ChangeLog	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/ChangeLog	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -1,2 +1,11 @@
+2010-04-30	Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+	* irq/bsp_irq_init.c: Removed file.
+	* Makefile.am, preinstall.am: Reflect change above.  Added generic
+	interrupt support modules.
+	* include/bsp.h: Define BSP_FEATURE_IRQ_EXTENSION.
+	* startup/bspstart.c, irq/bsp_irq_asm.S, clock/clockdrv.c,
+	network/network.c: Interrupt support changes.
+
 2010-04-30	Sebastian Huber <sebastian.huber@embedded-brains.de>
 
Index: c/src/lib/libbsp/arm/edb7312/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/edb7312/Makefile.am	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/Makefile.am	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -13,4 +13,6 @@
 include_HEADERS = include/bsp.h
 include_HEADERS += ../../shared/include/tm27.h
+
+include_bsp_HEADERS =
 
 nodist_include_HEADERS = include/bspopts.h
@@ -48,9 +50,15 @@
 libbsp_a_SOURCES += ../shared/abort/abort.c
 
-include_HEADERS += irq/irq.h
 # irq
-libbsp_a_SOURCES += irq/irq.c irq/bsp_irq_init.c \
-    ../../arm/shared/irq/irq_init.c irq/bsp_irq_asm.S \
-    irq/irq.h
+include_bsp_HEADERS += ../../shared/include/irq-generic.h \
+	../../shared/include/irq-info.h \
+	irq/irq.h
+libbsp_a_SOURCES += ../../shared/src/irq-generic.c \
+	../../shared/src/irq-legacy.c \
+	../../shared/src/irq-info.c \
+	../../shared/src/irq-shell.c \
+	../../shared/src/irq-server.c \
+	irq/irq.c \
+	irq/bsp_irq_asm.S
 
 if HAS_NETWORKING
Index: c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
===================================================================
--- c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -15,5 +15,5 @@
 #include <ep7312.h>
 #include <bsp.h>
-#include <irq.h>
+#include <bsp/irq.h>
 
 #if ON_SKYEYE==1
Index: c/src/lib/libbsp/arm/edb7312/include/bsp.h
===================================================================
--- c/src/lib/libbsp/arm/edb7312/include/bsp.h	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/include/bsp.h	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -26,4 +26,6 @@
 #include <rtems/clockdrv.h>
 
+#define BSP_FEATURE_IRQ_EXTENSION
+
 /*
  *  Define the interrupt mechanism for Time Test 27
Index: c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_asm.S
===================================================================
--- c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_asm.S	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_asm.S	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -17,5 +17,5 @@
 #include "irq.h"
 
-#define VECTOR_TABLE 0x40
+	.extern edb7312_interrupt_dispatch
 
 /*
@@ -46,5 +46,5 @@
   tst   r6, #0x0001
   beq   check_extfiq
-  ldr	r0, =(VECTOR_TABLE + (4 * 21)) /* load the vector number */
+  mov   r0, #BSP_DAIINT
   b     get_handler
 
@@ -58,5 +58,5 @@
   tst   r6, #0x0001
   beq   check_bl
-  ldr	r0, =(VECTOR_TABLE + (4 * 0)) /* load the vector number */
+  mov   r0, #BSP_EXTFIQ
   b     get_handler
 
@@ -70,5 +70,5 @@
   tst   r6, #0x0002
   beq   check_we
-  ldr	r0, =(VECTOR_TABLE + (4 * 1)) /* load the vector number */
+  mov   r0, #BSP_BLINT
   b     get_handler
 
@@ -82,5 +82,5 @@
   tst   r6, #0x0004
   beq   check_mc
-  ldr	r0, =(VECTOR_TABLE + (4 * 2)) /* load the vector number */
+  mov   r0, #BSP_WEINT
   b     get_handler
 
@@ -94,5 +94,5 @@
   tst   r6, #0x0008
   beq   check_cs
-  ldr	r0, =(VECTOR_TABLE + (4 * 3)) /* load the vector number */
+  mov   r0, #BSP_MCINT
   b     get_handler
 
@@ -106,5 +106,5 @@
   tst   r6, #0x0010
   beq   check_e1
-  ldr	r0, =(VECTOR_TABLE + (4 * 4)) /* load the vector number */
+  mov   r0, #BSP_CSINT
   b     get_handler
 
@@ -118,5 +118,5 @@
   tst   r6, #0x0020
   beq   check_e2
-  ldr	r0, =(VECTOR_TABLE + (4 * 5)) /* load the vector number */
+  mov   r0, #BSP_EINT1
   b     get_handler
 
@@ -130,5 +130,5 @@
   tst   r6, #0x0040
   beq   check_e3
-  ldr	r0, =(VECTOR_TABLE + (4 * 6)) /* load the vector number */
+  mov   r0, #BSP_EINT2
   b     get_handler
 
@@ -142,5 +142,5 @@
   tst   r6, #0x0080
   beq   check_tc1
-  ldr	r0, =(VECTOR_TABLE + (4 * 7)) /* load the vector number */
+  mov   r0, #BSP_EINT3
   b     get_handler
 
@@ -154,5 +154,5 @@
   tst   r6, #0x0100
   beq   check_tc2
-  ldr	r0, =(VECTOR_TABLE + (4 * 8)) /* load the vector number */
+  mov   r0, #BSP_TC1OI
   b     get_handler
 
@@ -166,5 +166,5 @@
   tst   r6, #0x0200
   beq   check_rtc
-  ldr	r0, =(VECTOR_TABLE + (4 * 9)) /* load the vector number */
+  mov   r0, #BSP_TC2OI
   b     get_handler
 
@@ -178,5 +178,5 @@
   tst   r6, #0x0400
   beq   check_tick
-  ldr	r0, =(VECTOR_TABLE + (4 * 10)) /* load the vector number */
+  mov   r0, #BSP_RTCMI
   b     get_handler
 
@@ -190,5 +190,5 @@
   tst   r6, #0x0800
   beq   check_utx1
-  ldr	r0, =(VECTOR_TABLE + (4 * 11)) /* load the vector number */
+  mov   r0, #BSP_TINT
   b     get_handler
 
@@ -202,5 +202,5 @@
   tst   r6, #0x1000
   beq   check_urx1
-  ldr	r0, =(VECTOR_TABLE + (4 * 12)) /* load the vector number */
+  mov   r0, #BSP_UTXINT1
   b     get_handler
 
@@ -214,5 +214,5 @@
   tst   r6, #0x2000
   beq   check_ums
-  ldr	r0, =(VECTOR_TABLE + (4 * 13)) /* load the vector number */
+  mov   r0, #BSP_URXINT1
   b     get_handler
 
@@ -226,5 +226,5 @@
   tst   r6, #0x4000
   beq   check_sse
-  ldr	r0, =(VECTOR_TABLE + (4 * 14)) /* load the vector number */
+  mov   r0, #BSP_UMSINT
   b     get_handler
 
@@ -238,5 +238,5 @@
   tst   r6, #0x8000
   beq   check_kbd
-  ldr	r0, =(VECTOR_TABLE + (4 * 15)) /* load the vector number */
+  mov   r0, #BSP_SSEOTI
   b     get_handler
 
@@ -250,5 +250,5 @@
   tst   r6, #0x0001
   beq   check_ss2rx
-  ldr	r0, =(VECTOR_TABLE + (4 * 16)) /* load the vector number */
+  mov   r0, #BSP_KBDINT
   b     get_handler
 
@@ -262,5 +262,5 @@
   tst   r6, #0x0002
   beq   check_ss2tx
-  ldr	r0, =(VECTOR_TABLE + (4 * 17)) /* load the vector number */
+  mov   r0, #BSP_SS2RX
   b     get_handler
 
@@ -274,5 +274,5 @@
   tst   r6, #0x0004
   beq   check_utx2
-  ldr	r0, =(VECTOR_TABLE + (4 * 18)) /* load the vector number */
+  mov   r0, #BSP_SS2TX
   b     get_handler
 
@@ -286,5 +286,5 @@
   tst   r6, #0x1000
   beq   check_urx2
-  ldr	r0, =(VECTOR_TABLE + (4 * 19)) /* load the vector number */
+  mov   r0, #BSP_UTXINT2
   b     get_handler
 
@@ -298,5 +298,5 @@
   tst   r6, #0x2000
   beq   IRQ_NoInterrupt
-  ldr	r0, =(VECTOR_TABLE + (4 * 20)) /* load the vector number */
+  mov   r0, #BSP_URXINT2
   b     get_handler
 
@@ -304,6 +304,4 @@
 
   ldmia	  sp!,{r4, r5, r6}
-
-  ldr	r0, [r0]		/* extract the IT handler @ */
 
   /*
@@ -317,10 +315,6 @@
 */
 
-  stmdb	  sp!,{lr}
-  ldr     lr, =IRQ_return         /* prepare the return from handler  */
-
-  mov     pc, r0			/* EXECUTE INT HANDLER */
-
-IRQ_return:
+  stmdb sp!,{lr}
+  bl    edb7312_interrupt_dispatch
   ldmia sp!,{lr}
 
Index: src/lib/libbsp/arm/edb7312/irq/bsp_irq_init.c
===================================================================
--- c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_init.c	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ 	(revision )
@@ -1,123 +1,0 @@
-/*
- * Cirrus EP7312 Intererrupt handler
- *
- * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
- *
- * Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *
- *  http://www.rtems.com/license/LICENSE.
- *
- *
- *  $Id$
-*/
-#include <irq.h>
-#include <bsp.h>
-#include <ep7312.h>
-
-void BSP_rtems_irq_mngt_init(void)
-{
-	long int_stat;
-        long *vectorTable;
-        int i;
-
-        vectorTable = (long *) VECTOR_TABLE;
-
-        /* Initialize the vector table contents with default handler */
-        for (i=0; i<BSP_MAX_INT; i++) {
-            *(vectorTable + i) = (long)(default_int_handler);
-        }
-
-	/* mask all interrupts */
-	*EP7312_INTMR1 = 0x0;
-	*EP7312_INTMR2 = 0x0;
-	*EP7312_INTMR3 = 0x0;
-
-	/* clear all pending interrupt status' */
-	int_stat = *EP7312_INTSR1;
-	if(int_stat & EP7312_INTR1_EXTFIQ)
-	{
-	}
-	if(int_stat & EP7312_INTR1_BLINT)
-	{
-		*EP7312_BLEOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_WEINT)
-	{
-            *EP7312_TEOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_MCINT)
-	{
-	}
-	if(int_stat & EP7312_INTR1_CSINT)
-	{
-		*EP7312_COEOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_EINT1)
-	{
-	}
-	if(int_stat & EP7312_INTR1_EINT2)
-	{
-	}
-	if(int_stat & EP7312_INTR1_EINT3)
-	{
-	}
-	if(int_stat & EP7312_INTR1_TC1OI)
-	{
-            *EP7312_TC1EOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_TC2OI)
-	{
-            *EP7312_TC2EOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_RTCMI)
-	{
-            *EP7312_RTCEOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_TINT)
-	{
-            *EP7312_TEOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_URXINT1)
-	{
-	}
-	if(int_stat & EP7312_INTR1_UTXINT1)
-	{
-	}
-	if(int_stat & EP7312_INTR1_UMSINT)
-	{
-            *EP7312_UMSEOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR1_SSEOTI)
-	{
-            *EP7312_SYNCIO;
-	}
-	int_stat = *EP7312_INTSR1;
-
-	int_stat = *EP7312_INTSR2;
-	if(int_stat & EP7312_INTR2_KBDINT)
-	{
-            *EP7312_KBDEOI = 0xFFFFFFFF;
-	}
-	if(int_stat & EP7312_INTR2_SS2RX)
-	{
-	}
-	if(int_stat & EP7312_INTR2_SS2TX)
-	{
-	}
-	if(int_stat & EP7312_INTR2_URXINT2)
-	{
-	}
-	if(int_stat & EP7312_INTR2_UTXINT2)
-	{
-	}
-	int_stat = *EP7312_INTSR2;
-
-	int_stat = *EP7312_INTSR3;
-	if(int_stat & EP7312_INTR2_DAIINT)
-	{
-	}
-	int_stat = *EP7312_INTSR3;
-}
Index: c/src/lib/libbsp/arm/edb7312/irq/irq.c
===================================================================
--- c/src/lib/libbsp/arm/edb7312/irq/irq.c	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/irq/irq.c	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -1,4 +1,6 @@
 /*
  * Cirrus EP7312 Intererrupt handler
+ *
+ * Copyright (c) 2010 embedded brains GmbH.
  *
  * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
@@ -14,140 +16,170 @@
  *  $Id$
 */
+
 #include <bsp.h>
-#include <irq.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/apiext.h>
+#include <bsp/irq.h>
+#include <bsp/irq-generic.h>
+
 #include <ep7312.h>
 
-/*
- * This function check that the value given for the irq line
- * is valid.
- */
-
-static int isValidInterrupt(int irq)
+void edb7312_interrupt_dispatch(rtems_vector_number vector)
 {
-  if ( (irq < 0) || (irq > BSP_MAX_INT))
-    return 0;
-  return 1;
+  bsp_interrupt_handler_dispatch(vector);
 }
 
-/*
- * -------------------- RTEMS Single Irq Handler Mngt Routines ----------------
- */
-
-int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
+rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
 {
-    rtems_irq_hdl *HdlTable;
-    rtems_interrupt_level level;
-
-    if (!isValidInterrupt(irq->name)) {
-      return 0;
+    if(vector >= BSP_EXTFIQ && vector <= BSP_SSEOTI)
+    {
+        /* interrupt managed by INTMR1 and INTSR1 */
+        *EP7312_INTMR1 |= (1 << vector);
     }
-    /*
-     * Check if default handler is actually connected. If not issue an error.
-     */
-    HdlTable = (rtems_irq_hdl *) VECTOR_TABLE;
-    if (*(HdlTable + irq->name) != default_int_handler) {
-      return 0;
+    else if(vector >= BSP_KBDINT && vector <= BSP_SS2TX)
+    {
+        /* interrupt managed by INTMR2 and INTSR2 */
+        *EP7312_INTMR2 |= (1 << (vector - 16));
+    }
+    else if(vector >= BSP_UTXINT2 && vector <= BSP_URXINT2)
+    {
+        /* interrupt managed by INTMR2 and INTSR2 */
+        *EP7312_INTMR2 |= (1 << (vector - 7));
+    }
+    else if(vector == BSP_DAIINT)
+    {
+        /* interrupt managed by INTMR3 and INTSR3 */
+        *EP7312_INTMR3 |= (1 << (vector - 21));
     }
 
-    rtems_interrupt_disable(level);
+  return RTEMS_SUCCESSFUL;
+}
 
-    /*
-     * store the new handler
-     */
-    *(HdlTable + irq->name) = irq->hdl;
-
-    /*
-     * unmask interrupt
-     */
-    if(irq->name >= BSP_EXTFIQ && irq->name <= BSP_SSEOTI)
+rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
+{
+    if(vector >= BSP_EXTFIQ && vector <= BSP_SSEOTI)
     {
         /* interrupt managed by INTMR1 and INTSR1 */
-        *EP7312_INTMR1 |= (1 << irq->name);
+        *EP7312_INTMR1 &= ~(1 << vector);
     }
-    else if(irq->name >= BSP_KBDINT && irq->name <= BSP_SS2TX)
+    else if(vector >= BSP_KBDINT && vector <= BSP_SS2TX)
     {
         /* interrupt managed by INTMR2 and INTSR2 */
-        *EP7312_INTMR2 |= (1 << (irq->name - 16));
+        *EP7312_INTMR2 &= ~(1 << (vector - 16));
     }
-    else if(irq->name >= BSP_UTXINT2 && irq->name <= BSP_URXINT2)
+    else if(vector >= BSP_UTXINT2 && vector <= BSP_URXINT2)
     {
         /* interrupt managed by INTMR2 and INTSR2 */
-        *EP7312_INTMR2 |= (1 << (irq->name - 7));
+        *EP7312_INTMR2 &= ~(1 << (vector - 7));
     }
-    else if(irq->name == BSP_DAIINT)
+    else if(vector == BSP_DAIINT)
     {
         /* interrupt managed by INTMR3 and INTSR3 */
-        *EP7312_INTMR3 |= (1 << (irq->name - 21));
+        *EP7312_INTMR3 &= ~(1 << (vector - 21));
     }
 
-    /*
-     * Enable interrupt on device
-     */
-    if(irq->on)
-    {
-    	irq->on(irq);
-    }
-
-    rtems_interrupt_enable(level);
-
-    return 1;
+  return RTEMS_SUCCESSFUL;
 }
 
-int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
+rtems_status_code bsp_interrupt_facility_initialize(void)
 {
-    rtems_irq_hdl *HdlTable;
-    rtems_interrupt_level level;
+  uint32_t int_stat = 0;
 
-    if (!isValidInterrupt(irq->name)) {
-      return 0;
-    }
-    /*
-     * Check if the handler is actually connected. If not issue an error.
-     */
-    HdlTable = (rtems_irq_hdl *) VECTOR_TABLE;
-    if (*(HdlTable + irq->name) != irq->hdl) {
-      return 0;
-    }
-    rtems_interrupt_disable(level);
+  /* mask all interrupts */
+  *EP7312_INTMR1 = 0x0;
+  *EP7312_INTMR2 = 0x0;
+  *EP7312_INTMR3 = 0x0;
+  
+  /* clear all pending interrupt status' */
+  int_stat = *EP7312_INTSR1;
+  if(int_stat & EP7312_INTR1_EXTFIQ)
+  {
+  }
+  if(int_stat & EP7312_INTR1_BLINT)
+  {
+      *EP7312_BLEOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_WEINT)
+  {
+      *EP7312_TEOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_MCINT)
+  {
+  }
+  if(int_stat & EP7312_INTR1_CSINT)
+  {
+      *EP7312_COEOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_EINT1)
+  {
+  }
+  if(int_stat & EP7312_INTR1_EINT2)
+  {
+  }
+  if(int_stat & EP7312_INTR1_EINT3)
+  {
+  }
+  if(int_stat & EP7312_INTR1_TC1OI)
+  {
+      *EP7312_TC1EOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_TC2OI)
+  {
+      *EP7312_TC2EOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_RTCMI)
+  {
+      *EP7312_RTCEOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_TINT)
+  {
+      *EP7312_TEOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_URXINT1)
+  {
+  }
+  if(int_stat & EP7312_INTR1_UTXINT1)
+  {
+  }
+  if(int_stat & EP7312_INTR1_UMSINT)
+  {
+      *EP7312_UMSEOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR1_SSEOTI)
+  {
+      *EP7312_SYNCIO;
+  }
+  int_stat = *EP7312_INTSR1;
+  
+  int_stat = *EP7312_INTSR2;
+  if(int_stat & EP7312_INTR2_KBDINT)
+  {
+      *EP7312_KBDEOI = 0xFFFFFFFF;
+  }
+  if(int_stat & EP7312_INTR2_SS2RX)
+  {
+  }
+  if(int_stat & EP7312_INTR2_SS2TX)
+  {
+  }
+  if(int_stat & EP7312_INTR2_URXINT2)
+  {
+  }
+  if(int_stat & EP7312_INTR2_UTXINT2)
+  {
+  }
+  int_stat = *EP7312_INTSR2;
+  
+  int_stat = *EP7312_INTSR3;
+  if(int_stat & EP7312_INTR2_DAIINT)
+  {
+  }
+  int_stat = *EP7312_INTSR3;
 
-    /*
-     * mask interrupt
-     */
-    if(irq->name >= BSP_EXTFIQ && irq->name <= BSP_SSEOTI)
-    {
-        /* interrupt managed by INTMR1 and INTSR1 */
-        *EP7312_INTMR1 &= ~(1 << irq->name);
-    }
-    else if(irq->name >= BSP_KBDINT && irq->name <= BSP_SS2TX)
-    {
-        /* interrupt managed by INTMR2 and INTSR2 */
-        *EP7312_INTMR2 &= ~(1 << (irq->name - 16));
-    }
-    else if(irq->name >= BSP_UTXINT2 && irq->name <= BSP_URXINT2)
-    {
-        /* interrupt managed by INTMR2 and INTSR2 */
-        *EP7312_INTMR2 &= ~(1 << (irq->name - 7));
-    }
-    else if(irq->name == BSP_DAIINT)
-    {
-        /* interrupt managed by INTMR3 and INTSR3 */
-        *EP7312_INTMR3 &= ~(1 << (irq->name - 21));
-    }
+  _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
 
-    /*
-     * Disable interrupt on device
-     */
-    if(irq->off)
-        irq->off(irq);
+  return RTEMS_SUCCESSFUL;
+}
 
-    /*
-     * restore the default irq value
-     */
-    *(HdlTable + irq->name) = default_int_handler;
-
-    rtems_interrupt_enable(level);
-
-    return 1;
+void bsp_interrupt_handler_default(rtems_vector_number vector)
+{
+  printk("spurious interrupt: %u\n", vector);
 }
Index: c/src/lib/libbsp/arm/edb7312/irq/irq.h
===================================================================
--- c/src/lib/libbsp/arm/edb7312/irq/irq.h	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/irq/irq.h	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -1,4 +1,6 @@
 /*
  * Cirrus EP7312 Intererrupt handler
+ *
+ * Copyright (c) 2010 embedded brains GmbH.
  *
  * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
@@ -18,27 +20,12 @@
 #define __IRQ_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-  /* define that can be useful (the values are just examples) */
-#define VECTOR_TABLE	 0x40
-
 #ifndef __asm__
 
-/*
- * Include some preprocessor value also used by assember code
- */
+#include <rtems.h>
+#include <rtems/irq.h>
+#include <rtems/irq-extension.h>
 
-#include <rtems/irq.h>
-#include <rtems.h>
+#endif /* __asm__ */
 
-extern void default_int_handler(rtems_irq_hdl_param unused);
-/*-------------------------------------------------------------------------+
-| Constants
-+--------------------------------------------------------------------------*/
-
-  /* enum of the possible interrupt sources */
-typedef unsigned int rtems_irq_number;
   /* int interrupt status/mask register 1 */
 #define BSP_EXTFIQ     0
@@ -68,22 +55,7 @@
 #define BSP_MAX_INT   22
 
-/*-------------------------------------------------------------------------+
-| Function Prototypes.
-+--------------------------------------------------------------------------*/
-/*
- * ------------------- RTEMS Single Irq Handler Mngt Routines ----------------
- */
+#define BSP_INTERRUPT_VECTOR_MIN 0
 
-/*
- * function to initialize the interrupt for a specific BSP
- */
-void BSP_rtems_irq_mngt_init();
-
-
-#endif /* __asm__ */
-
-#ifdef __cplusplus
-}
-#endif
+#define BSP_INTERRUPT_VECTOR_MAX (BSP_MAX_INT - 1)
 
 #endif /* __IRQ_H__ */
Index: c/src/lib/libbsp/arm/edb7312/network/network.c
===================================================================
--- c/src/lib/libbsp/arm/edb7312/network/network.c	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/network/network.c	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -1,5 +1,5 @@
 #include <rtems.h>
 #include <sys/mbuf.h>
-#include <irq.h>
+#include <bsp/irq.h>
 #include <libchip/cs8900.h>
 
Index: c/src/lib/libbsp/arm/edb7312/preinstall.am
===================================================================
--- c/src/lib/libbsp/arm/edb7312/preinstall.am	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/preinstall.am	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -74,6 +74,14 @@
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/uart.h
 
-$(PROJECT_INCLUDE)/irq.h: irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/irq.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/irq.h
+$(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h
 
+$(PROJECT_INCLUDE)/bsp/irq-info.h: ../../shared/include/irq-info.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-info.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-info.h
+
+$(PROJECT_INCLUDE)/bsp/irq.h: irq/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
+
Index: c/src/lib/libbsp/arm/edb7312/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/arm/edb7312/startup/bspstart.c	(revision 14cd67c08093336f448a2b1ce883f4451224ece9)
+++ c/src/lib/libbsp/arm/edb7312/startup/bspstart.c	(revision 6e6886d5812e9824a7402bee7362ed5da80c452e)
@@ -12,4 +12,5 @@
 
 #include <bsp.h>
+#include <bsp/irq-generic.h>
 #include <ep7312.h>
 #include <uart.h>
@@ -18,5 +19,4 @@
  * Function prototypes
  */
-extern void rtems_irq_mngt_init(void);
 extern void rtems_exception_init_mngt(void);
 
@@ -46,5 +46,7 @@
    * Init rtems interrupt management
    */
-  rtems_irq_mngt_init();
+  if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
+    _CPU_Fatal_halt(0xe);
+  }
 } /* bsp_start */
 
