Index: c/src/lib/libbsp/arm/rtl22xx/ChangeLog
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/ChangeLog	(revision 522348c8cb47b7659ee4beb89038ae4bffb805ce)
+++ c/src/lib/libbsp/arm/rtl22xx/ChangeLog	(revision 336d67ac1711f4c53fc567a343cd28bcfc1843d3)
@@ -1,2 +1,9 @@
+2010-04-30	Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+	* Makefile.am, preinstall.am: Added generic interrupt support modules.
+	* include/bsp.h: Define BSP_FEATURE_IRQ_EXTENSION.
+	* startup/bspstart.c, network/network.c: Interrupt support changes.
+	* console/uart.c: Fixed warnings.
+
 2010-04-30	Sebastian Huber <sebastian.huber@embedded-brains.de>
 
Index: c/src/lib/libbsp/arm/rtl22xx/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/Makefile.am	(revision 522348c8cb47b7659ee4beb89038ae4bffb805ce)
+++ c/src/lib/libbsp/arm/rtl22xx/Makefile.am	(revision 336d67ac1711f4c53fc567a343cd28bcfc1843d3)
@@ -13,4 +13,6 @@
 include_HEADERS = include/bsp.h
 include_HEADERS += ../../shared/include/tm27.h
+
+include_bsp_HEADERS =
 
 nodist_include_HEADERS = include/bspopts.h
@@ -41,4 +43,12 @@
 # console
 libbsp_a_SOURCES += ../../shared/console.c
+# IRQ
+include_bsp_HEADERS += ../../shared/include/irq-generic.h \
+	../../shared/include/irq-info.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
 # simple_abort
 libbsp_a_SOURCES += ../shared/abort/simple_abort.c
Index: c/src/lib/libbsp/arm/rtl22xx/console/uart.c
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/console/uart.c	(revision 522348c8cb47b7659ee4beb89038ae4bffb805ce)
+++ c/src/lib/libbsp/arm/rtl22xx/console/uart.c	(revision 336d67ac1711f4c53fc567a343cd28bcfc1843d3)
@@ -40,5 +40,5 @@
 static int     uart_last_close(int major, int minor, void *arg);
 static int     uart_read(int minor);
-static int     uart_write(int minor, const char *buf, int len);
+static ssize_t uart_write(int minor, const char *buf, size_t len);
 static void    uart_init(int minor);
 static void    uart_write_polled(int minor, char c);
@@ -181,7 +181,7 @@
  * return 1 on success, -1 on error
  */
-static int uart_write(int minor, const char *buf, int len)
-{
-    int i;
+static ssize_t uart_write(int minor, const char *buf, size_t len)
+{
+    size_t i;
 
     if (minor == 0) {
Index: c/src/lib/libbsp/arm/rtl22xx/include/bsp.h
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/include/bsp.h	(revision 522348c8cb47b7659ee4beb89038ae4bffb805ce)
+++ c/src/lib/libbsp/arm/rtl22xx/include/bsp.h	(revision 336d67ac1711f4c53fc567a343cd28bcfc1843d3)
@@ -26,4 +26,5 @@
 #include <rtems/clockdrv.h>
 
+#define BSP_FEATURE_IRQ_EXTENSION
 
 #define CONFIG_ARM_CLK 60000000L
Index: c/src/lib/libbsp/arm/rtl22xx/network/network.c
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/network/network.c	(revision 522348c8cb47b7659ee4beb89038ae4bffb805ce)
+++ c/src/lib/libbsp/arm/rtl22xx/network/network.c	(revision 336d67ac1711f4c53fc567a343cd28bcfc1843d3)
@@ -2,5 +2,5 @@
 #include <rtems.h>
 #include <sys/mbuf.h>
-#include <irq.h>
+#include <bsp/irq.h>
 #include <libchip/cs8900.h>
 
@@ -11,5 +11,5 @@
 void cs8900_isr(rtems_irq_hdl_param unused);
 rtems_irq_connect_data cs8900_isr_data = {LPC22xx_INTERRUPT_EINT2,
-                                         (rtems_irq_hdl)cs8900_isr,
+                                         cs8900_isr,
 					  NULL,
 					  NULL,
Index: c/src/lib/libbsp/arm/rtl22xx/preinstall.am
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/preinstall.am	(revision 522348c8cb47b7659ee4beb89038ae4bffb805ce)
+++ c/src/lib/libbsp/arm/rtl22xx/preinstall.am	(revision 336d67ac1711f4c53fc567a343cd28bcfc1843d3)
@@ -70,2 +70,10 @@
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/uart.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
+
Index: c/src/lib/libbsp/arm/rtl22xx/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/startup/bspstart.c	(revision 522348c8cb47b7659ee4beb89038ae4bffb805ce)
+++ c/src/lib/libbsp/arm/rtl22xx/startup/bspstart.c	(revision 336d67ac1711f4c53fc567a343cd28bcfc1843d3)
@@ -12,4 +12,5 @@
 
 #include <bsp.h>
+#include <bsp/irq-generic.h>
 #include <lpc22xx.h>
 
@@ -17,5 +18,4 @@
  * Function prototypes
  */
-extern void rtems_irq_mngt_init(void);
 extern void rtems_exception_init_mngt(void);
 extern void  UART0_Ini(void);
@@ -78,13 +78,4 @@
   //MAMCR = 2;
 
-  /* init VIC */
-  VICIntEnClr = 0xffffffff;
-  VICVectAddr = 0;
-  VICIntSelect = 0;
-
-  /* disable interrupts */
-  /* Setup interrupt controller.*/
-  VICProtection = 0;
-
   UART0_Ini();
 
@@ -97,5 +88,7 @@
    * Init rtems interrupt management
    */
-  rtems_irq_mngt_init();
+  if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
+    _CPU_Fatal_halt(0xe);
+  }
 } /* bsp_start */
 
