<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><div><br class="Apple-interchange-newline">Hello,</div><div><br></div><div>This pc386 patch is big as compared to previous patches. I've modified major portions, but I apologize in advance, if any mistakes might've crept in.</div><div class="yui_3_7_2_36_1373566172102_63" style="font-family: arial, helvetica, clean, sans-serif; background-color: transparent;"><br></div><div class="yui_3_7_2_36_1373566172102_65" style="font-family: arial, helvetica, clean, sans-serif; background-color: transparent;">Regards</div><div class="yui_3_7_2_36_1373566172102_67" style="font-family: arial, helvetica, clean, sans-serif; background-color: transparent;"><span style="background-color: transparent; line-height: 1.22;">Vipul Nayyar </span></div><div><span style="background-color: transparent; line-height: 1.22;"><br></span></div></div><div
style="color: rgb(0, 0, 0); font-size: 12.727272033691406px; font-family: arial, helvetica, clean, sans-serif; background-color: transparent; font-style: normal;"><br></div><div><br></div> <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Vipul Nayyar <nayyar_vipul@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> rtems-devel@rtems.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, 12 July 2013 1:02 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [PATCH] Updated Legacy code in i386 pc386<br> </font> </div> <div class="y_msg_container"><br>---<br> c/src/lib/libbsp/i386/pc386/3c509/3c509.c | 105 +++++-------------------<br>
c/src/lib/libbsp/i386/pc386/clock/ckinit.c | 54 ++++++------<br> c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c | 53 +++++-------<br> c/src/lib/libbsp/i386/pc386/console/vgacons.c | 34 +++-----<br> c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c | 57 ++++---------<br> c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c | 41 ++++-----<br> c/src/lib/libbsp/i386/shared/comm/tty_drv.c | 89 +++++++-------------<br> c/src/lib/libbsp/i386/shared/smp/smp-imps.c | 22 +++--<br> 8 files changed, 158 insertions(+), 297 deletions(-)<br><br>diff --git a/c/src/lib/libbsp/i386/pc386/3c509/3c509.c b/c/src/lib/libbsp/i386/pc386/3c509/3c509.c<br>index ec309ba..6047d19 100644<br>--- a/c/src/lib/libbsp/i386/pc386/3c509/3c509.c<br>+++ b/c/src/lib/libbsp/i386/pc386/3c509/3c509.c<br>@@ -60,6 +60,7 @@<br> #include <errno.h><br> #include
<rtems/error.h><br> #include <rtems/rtems_bsdnet.h><br>+#include <assert.h><br> <br> #include <sys/param.h><br> #include <sys/mbuf.h><br>@@ -163,11 +164,11 @@ struct ep_softc<br> struct ep_board *epb;<br> int unit;<br> <br>- rtems_irq_connect_data irqInfo;<br>- rtems_id rxDaemonTid;<br>- rtems_id txDaemonTid;<br>+ rtems_id rxDaemonTid;<br>+ rtems_id txDaemonTid;<br>+ rtems_vector_number name;<br> <br>- int acceptBroadcast;<br>+ int acceptBroadcast;<br> <br> short tx_underrun;<br> short rx_no_first;<br>@@ -210,6 +211,8 @@ static void epread( register
struct ep_softc *sc );<br> static int ep_isa_attach( struct isa_device *is );<br> static int get_eeprom_data( int id_port, int offset );<br> static void ep_intr( struct ep_softc *sc );<br>+int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *config );<br>+void __inline outb( unsigned short io_addr, uint8_t out_data );<br> <br> /* external functions */<br> extern void Wait_X_ms( unsigned int timeToWait ); /* timer.c ??? */<br>@@ -403,46 +406,6 @@ static int get_eeprom_data( int id_port, int offset )<br> <br> /**********************************************************************************<br> *<br>- * DESCRIPTION: Waits until the EEPROM of the card is ready to be accessed.<br>- *<br>- * RETURNS: 0 - not ready; 1 - ok<br>- *<br>- **********************************************************************************/<br>-static int eeprom_rdy( struct ep_softc *sc )<br>-{<br>- int i;<br>-<br>- for (i = 0;
is_eeprom_busy(BASE) && i < MAX_EEPROMBUSY; i++)<br>- continue;<br>- if (i >= MAX_EEPROMBUSY)<br>- {<br>- printf("ep%d: eeprom failed to come ready.\n", sc->unit);<br>- return (0);<br>- }<br>- return (1);<br>-}<br>-<br>-/**********************************************************************************<br>- *<br>- * DESCRIPTION:<br>- * get_e: gets a 16 bits word from the EEPROM.<br>- * We must have set the window before call this routine.<br>- *<br>- * RETURNS: data from EEPROM<br>- *<br>- **********************************************************************************/<br>-u_short get_e( struct ep_softc *sc, int offset )<br>-{<br>- if( !eeprom_rdy(sc) )<br>- return (0xffff);<br>- outw(BASE + EP_W0_EEPROM_COMMAND, EEPROM_CMD_RD | offset
);<br>- if( !eeprom_rdy(sc) )<br>- return( 0xffff );<br>- return( inw( BASE + EP_W0_EEPROM_DATA ) );<br>-}<br>-<br>-/**********************************************************************************<br>- *<br> * DESCRIPTION:<br> * Driver interrupt handler. This routine is called by the RTEMS kernel when this<br> * interrupt is raised.<br>@@ -464,30 +427,6 @@ static rtems_isr ap_interrupt_handler( rtems_vector_number v )<br> /**********************************************************************************<br> *<br> * DESCRIPTION:<br>- *<br>- * RETURNS:<br>- *<br>- **********************************************************************************/<br>-static void nopOn(const rtems_irq_connect_data* notUsed)<br>-{<br>- /* does nothing */<br>-}<br>-<br>-/**********************************************************************************<br>- *<br>- * DESCRIPTION:<br>-
*<br>- * RETURNS:<br>- *<br>- **********************************************************************************/<br>-static int _3c509_IsOn(const rtems_irq_connect_data* irq)<br>-{<br>- return BSP_irq_enabled_at_i8259s (irq->name);<br>-}<br>-<br>-/**********************************************************************************<br>- *<br>- * DESCRIPTION:<br> * Initializes the ethernet hardware.<br> *<br> * RETURNS: nothing.<br>@@ -495,24 +434,22 @@ static int _3c509_IsOn(const rtems_irq_connect_data* irq)<br> **********************************************************************************/<br> static void _3c509_initialize_hardware (struct ep_softc *sc)<br> {<br>- rtems_status_code st;<br>+ rtems_status_code status;<br> <br> epinit( sc );<br> <br> /*<br> * Set up interrupts<br> */<br>- sc->irqInfo.hdl = ( rtems_irq_hdl )ap_interrupt_handler;<br>-
sc->irqInfo.on = nopOn;<br>- sc->irqInfo.off = nopOn;<br>- sc->irqInfo.isOn = _3c509_IsOn;<br>-<br>- printf ("3c509: IRQ with Kernel: %d\n", sc->irqInfo.name );<br>- st = BSP_install_rtems_irq_handler( &sc->irqInfo );<br>- if( !st )<br>- {<br>- rtems_panic ("Can't attach WD interrupt handler for irq %d\n", sc->irqInfo.name );<br>- }<br>+ printf ("3c509: IRQ with Kernel: %d\n", (int)sc->name );<br>+ status = rtems_interrupt_handler_install(<br>+ sc->name,<br>+ "3c509",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ ( rtems_irq_hdl )ap_interrupt_handler,<br>+ NULL<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> }<br> <br> /**********************************************************************************<br>@@ -782,9 +719,9 @@ int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig
*config )<br> mtu = ETHERMTU;<br> <br> if (config->irno)<br>- sc->irqInfo.name = config->irno;<br>+ sc->name = config->irno;<br> else<br>- sc->irqInfo.name = 10;<br>+ sc->name = 10;<br> <br> if (config->port)<br> sc->ep_io_addr = config->port;<br>@@ -1046,13 +983,13 @@ static int ep_isa_attach( struct isa_device *is )<br> <br> irq = is->id_irq;<br> /* update the interrupt line number to registered with kernel */<br>- sc->irqInfo.name = irq;<br>+ sc->name = irq;<br> <br> GO_WINDOW( 0 );<br> SET_IRQ( BASE, irq );<br> <br> printf(
"3C509: I/O=0x%x, IRQ=%d, CONNECTOR=%s, ",<br>- sc->ep_io_addr, sc->irqInfo.name,ep_conn_type[ sc->ep_connector ] );<br>+ sc->ep_io_addr, (int)sc->name,ep_conn_type[ sc->ep_connector ] );<br> <br> ep_attach( sc );<br> return 1;<br>diff --git a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c<br>index 37b0408..b6ebd43 100644<br>--- a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c<br>+++ b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c<br>@@ -27,6 +27,7 @@<br> #include <bsp/irq.h><br> #include <bspopts.h><br> #include <libcpu/cpuModel.h><br>+#include <assert.h><br> <br> #define CLOCK_VECTOR 0<br> <br>@@ -41,8 +42,8 @@ void Clock_driver_support_at_tick_empty(void);<br> uint32_t bsp_clock_nanoseconds_since_last_tick_tsc(void);<br> uint32_t bsp_clock_nanoseconds_since_last_tick_i8254(void);<br>
void Clock_isr_handler(rtems_irq_hdl_param param);<br>-int clockIsOn(const rtems_irq_connect_data* unused);<br>-void clockOff(const rtems_irq_connect_data* unused);<br>+int clockIsOn(void);<br>+void clockOff(void);<br> void Clock_driver_install_handler(void);<br> void Clock_driver_support_initialize_hardware(void);<br> <br>@@ -232,9 +233,7 @@ static void calibrate_tsc(void)<br> pc586_tsc_per_tick /= rtems_clock_get_ticks_per_second();<br> }<br> <br>-static void clockOn(<br>- const rtems_irq_connect_data* unused<br>-)<br>+static void clockOn(void)<br> {<br> pc386_isrs_per_tick = 1;<br> pc386_microseconds_per_isr = rtems_configuration_get_microseconds_per_tick();<br>@@ -267,7 +266,7 @@ static void clockOn(<br> calibrate_tsc();<br> }<br> <br>-void clockOff(const rtems_irq_connect_data* unused)<br>+void clockOff(void)<br> {<br> /* reset timer mode to standard (BIOS) value
*/<br> outport_byte(TIMER_MODE, TIMER_SEL0 | TIMER_16BIT | TIMER_RATEGEN);<br>@@ -275,35 +274,31 @@ void clockOff(const rtems_irq_connect_data* unused)<br> outport_byte(TIMER_CNTR0, 0);<br> } /* Clock_exit */<br> <br>-int clockIsOn(const rtems_irq_connect_data* unused)<br>+int clockIsOn(void)<br> {<br> return ((i8259s_cache & 0x1) == 0);<br> }<br> <br> bool Clock_isr_enabled = false;<br>-void Clock_isr_handler(<br>- rtems_irq_hdl_param param <br>-)<br>+<br>+void Clock_isr_handler(rtems_irq_hdl_param param )<br> {<br> if ( Clock_isr_enabled )<br> Clock_isr( param );<br> }<br> <br>-static rtems_irq_connect_data clockIrqData = {<br>- BSP_PERIODIC_TIMER,<br>- Clock_isr_handler,<br>- 0,<br>- clockOn,<br>- clockOff,<br>- clockIsOn<br>-};<br>-<br> void Clock_driver_install_handler(void)<br> {<br>- if (!BSP_install_rtems_irq_handler (&clockIrqData)) {<br>-
printk("Unable to install system clock ISR handler\n");<br>- rtems_fatal_error_occurred(1);<br>- }<br>+ rtems_status_code status = RTEMS_SUCCESSFUL;<br>+ status = rtems_interrupt_handler_install(<br>+ BSP_PERIODIC_TIMER,<br>+ "Clock",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ Clock_isr_handler,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br>+ clockOn();<br> }<br> <br> void Clock_driver_support_initialize_hardware(void)<br>@@ -347,9 +342,16 @@ void Clock_driver_support_initialize_hardware(void)<br> Clock_isr_enabled = true;<br> }<br> <br>-#define Clock_driver_support_shutdown_hardware() \<br>- do { \<br>- BSP_remove_rtems_irq_handler (&clockIrqData); \<br>+#define Clock_driver_support_shutdown_hardware()
\<br>+ do { \<br>+ rtems_status_code status = RTEMS_SUCCESSFUL; \<br>+ clockOff(); \<br>+ status = rtems_interrupt_handler_remove( \<br>+ BSP_PERIODIC_TIMER, \<br>+ Clock_isr_handler, \<br>+ 0 \<br>+ );
\<br>+ assert(status == RTEMS_SUCCESSFUL); \<br> } while (0)<br> <br> #include "../../../shared/clockdrv_shell.h"<br>diff --git a/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c b/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c<br>index d0af6b9..99c6720 100644<br>--- a/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c<br>+++ b/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c<br>@@ -17,6 +17,7 @@<br> #include <string.h><br> #include <errno.h><br> #include <sys/types.h><br>+#include <assert.h><br> <br> #include <bsp.h><br> #include <bsp/irq.h><br>@@ -57,6 +58,8 @@ static unsigned char mouse_reply_expected = 0;<br> #define MAX_RETRIES 60 /* some aux operations take long time*/<br> <br> static
void ps2_mouse_interrupt(rtems_irq_hdl_param);<br>+void ps2_set_driver_handler(int port, mouse_parser_enqueue_handler handler);<br>+size_t read_aux(char * buffer, size_t count );<br> static mouse_parser_enqueue_handler driver_input_handler_ps2 = NULL;<br> <br> /*<br>@@ -78,30 +81,6 @@ static void mdelay( unsigned long t )<br> <br> static void* termios_ttyp_paux = NULL;<br> <br>-static void<br>-isr_on(const rtems_irq_connect_data *unused)<br>-{<br>- return;<br>-}<br>-<br>-static void<br>-isr_off(const rtems_irq_connect_data *unused)<br>-{<br>- return;<br>-}<br>-<br>-static int isr_is_on(const rtems_irq_connect_data *irq)<br>-{<br>- return BSP_irq_enabled_at_i8259s( irq->name );<br>-}<br>-<br>-static rtems_irq_connect_data ps2_isr_data = { AUX_IRQ,<br>-
ps2_mouse_interrupt,<br>- 0,<br>- isr_on,<br>- isr_off,<br>- isr_is_on };<br>-<br> /*<br> * Wait for keyboard controller input buffer to drain.<br> *<br>@@ -323,11 +302,18 @@ static int queue_empty(void)<br> <br> static int release_aux(void)<br> {<br>+ rtems_status_code status;<br>+<br> if
(--aux_count)<br> return 0;<br> kbd_write_cmd(AUX_INTS_OFF); /* Disable controller ints */<br> kbd_write_command_w(KBD_CCMD_MOUSE_DISABLE);<br>- BSP_remove_rtems_irq_handler( &ps2_isr_data );<br>+ status = rtems_interrupt_handler_remove(<br>+ AUX_IRQ,<br>+ ps2_mouse_interrupt,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> return 0;<br> }<br> <br>@@ -338,18 +324,21 @@ static int release_aux(void)<br> <br> static int open_aux(void)<br> {<br>- int status;<br>+ rtems_status_code status;<br> <br> if (aux_count++) {<br> return 0;<br> }<br> queue->head = queue->tail = 0; /* Flush input queue */<br> <br>- status = BSP_install_rtems_irq_handler(
&ps2_isr_data );<br>- if( !status ) {<br>- printk("Error installing ps2-mouse interrupt handler!\n" );<br>- rtems_fatal_error_occurred( status );<br>- }<br>+ status = rtems_interrupt_handler_install(<br>+ AUX_IRQ,<br>+ "PS2_Mouse",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ ps2_mouse_interrupt,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> <br> kbd_write_command_w(KBD_CCMD_MOUSE_ENABLE); /* Enable the auxiliary port on<br> controller. */<br>@@ -429,7 +418,7 @@ static int psaux_init( void )<br> /*<br> * paux device driver INITIALIZE entry point.<br> */<br>-rtems_device_driver
paux_initialize( <br>+rtems_device_driver paux_initialize(<br> rtems_device_major_number major,<br> rtems_device_minor_number minor,<br> void *arg)<br>diff --git a/c/src/lib/libbsp/i386/pc386/console/vgacons.c b/c/src/lib/libbsp/i386/pc386/console/vgacons.c<br>index d1143da..9f26388 100644<br>--- a/c/src/lib/libbsp/i386/pc386/console/vgacons.c<br>+++ b/c/src/lib/libbsp/i386/pc386/console/vgacons.c<br>@@ -1,5 +1,5 @@<br> /*<br>- * This file contains the termios TTY driver for the i386 <br>+ * This file contains the termios TTY driver for the i386<br> * vga.<br> *<br> * COPYRIGHT (c) 1989-2011.<br>@@ -20,23 +20,10 @@<br> #include <bsp/irq.h><br> #include <bsp.h><br> #include <crt.h><br>+#include <assert.h><br> <br> #define VGACONS_STATIC static<br> <br>-static int isr_is_on(const
rtems_irq_connect_data *irq)<br>-{<br>- return BSP_irq_enabled_at_i8259s(irq->name);<br>-}<br>-<br>-static rtems_irq_connect_data keyboard_isr_data = {<br>- BSP_KEYBOARD,<br>- keyboard_interrupt,<br>- 0,<br>- NULL,<br>- NULL,<br>- isr_is_on<br>-};<br>-<br> /*<br> * vgacons_init<br> *<br>@@ -44,7 +31,7 @@ static rtems_irq_connect_data keyboard_isr_data = {<br> */<br> VGACONS_STATIC void vgacons_init(int minor)<br> {<br>- /* <br>+ /*<br> * Note: We do not initialize the KBD interface here since<br> * it was initialized regardless of whether the<br> * vga is available or not. Therefore it is initialized<br>@@ -160,7 +147,7 @@ bool vgacons_probe(<br> int minor<br> )<br> {<br>- int status;<br>+ rtems_status_code status;<br>
static bool firstTime = true;<br> <br> if ((*(unsigned char*) NB_MAX_ROW_ADDR == 0) &&<br>@@ -175,11 +162,14 @@ bool vgacons_probe(<br> * can be COM1 and you can still use the mouse/VGA for graphics.<br> */<br> if ( firstTime ) {<br>- status = BSP_install_rtems_irq_handler(&keyboard_isr_data);<br>- if (!status) {<br>- printk("Error installing keyboard interrupt handler!\n");<br>- rtems_fatal_error_occurred(status);<br>- }<br>+ status = rtems_interrupt_handler_install(<br>+ BSP_KEYBOARD,<br>+ "VGACONS",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ keyboard_interrupt,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> }<br> firstTime = false;<br> <br>diff --git
a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c<br>index b23699d..f3d0ddd 100644<br>--- a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c<br>+++ b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c<br>@@ -401,41 +401,18 @@ ne_interrupt_handler (rtems_irq_hdl_param cdata)<br> /* Turn NE2000 interrupts on. */<br> <br> static void<br>-ne_interrupt_on (const rtems_irq_connect_data *irq)<br>+ne_interrupt_on (const rtems_vector_number name)<br> {<br> struct ne_softc *sc;<br> <br> #ifdef DEBUG_NE<br> printk ("ne_interrupt_on()\n");<br> #endif<br>- sc = ne_device_for_irno (irq->name);<br>+ sc = ne_device_for_irno (name);<br> if (sc != NULL)<br> outport_byte (sc->port + IMR, NE_INTERRUPTS);<br> }<br> <br>-/* Turn NE2000 interrupts off. See ne_interrupt_on. */<br>-<br>-static void<br>-ne_interrupt_off (const rtems_irq_connect_data *irq)<br>-{<br>- struct
ne_softc *sc;<br>-<br>-#ifdef DEBUG_NE<br>- printk ("ne_interrupt_off()\n");<br>-#endif<br>- sc = ne_device_for_irno (irq->name);<br>- if (sc != NULL)<br>- outport_byte (sc->port + IMR, 0);<br>-}<br>-<br>-/* Return whether NE2000 interrupts are on. */<br>-<br>-static int<br>-ne_interrupt_is_on (const rtems_irq_connect_data *irq)<br>-{<br>- return BSP_irq_enabled_at_i8259s (irq->name);<br>-}<br>-<br> /* Initialize the NE2000 hardware. */<br> <br> static void<br>@@ -516,20 +493,22 @@ ne_init_hardware (struct ne_softc *sc)<br> static void<br> ne_init_irq_handler(int irno)<br> {<br>- rtems_irq_connect_data irq;<br>+ rtems_status_code status;<br> <br> #ifdef DEBUG_NE<br> printk("ne_init_irq_handler(%d)\n", irno);<br> #endif<br>- irq.name = irno;<br>- irq.hdl = ne_interrupt_handler;<br>- irq.handle = (rtems_irq_hdl) irno;<br>- irq.on =
ne_interrupt_on;<br>- irq.off = ne_interrupt_off;<br>- irq.isOn = ne_interrupt_is_on;<br>-<br>- if (!BSP_install_rtems_irq_handler (&irq))<br>- rtems_panic ("Can't attach NE interrupt handler for irq %d\n", irno);<br>+<br>+ status = rtems_interrupt_handler_install(<br>+ irno,<br>+ "ne2000",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ ne_interrupt_handler,<br>+ (rtems_irq_hdl) irno<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br>+ ne_interrupt_on(irno);<br>+<br> }<br> <br> /* The NE2000 packet receive daemon. This task is started when the<br>@@ -1075,7 +1054,7 @@ static int ne_set_multicast_filter(struct ne_softc* sc)<br> int i=0;<br> unsigned int port = sc->port;<br> unsigned char cmd = 0;<br>- <br>+<br> /* Save CMDR settings */<br> inport_byte(port + CMDR,
cmd);<br> /* Change to page 1 */<br>@@ -1087,7 +1066,7 @@ static int ne_set_multicast_filter(struct ne_softc* sc)<br> }<br> <br> /* Revert to original CMDR settings */<br>- outport_byte(port + CMDR, cmd); <br>+ outport_byte(port + CMDR, cmd);<br> <br> return 0;<br> }<br>@@ -1125,12 +1104,12 @@ ne_ioctl (struct ifnet *ifp, ioctl_command_t command, caddr_t data)<br> break;<br> }<br> break;<br>- <br>+<br> case SIOCADDMULTI:<br> case SIOCDELMULTI:<br> {<br> struct ifreq* ifr = (struct ifreq*) data;<br>- error = (command == SIOCADDMULTI ? <br>+ error = (command == SIOCADDMULTI ?<br> ether_addmulti(ifr, &(sc->arpcom)) :<br> ether_delmulti(ifr, &(sc->arpcom)) );<br> /* ENETRESET indicates that driver should update its multicast filters
*/<br>diff --git a/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c b/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c<br>index d26464c..79ed3dd 100644<br>--- a/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c<br>+++ b/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c<br>@@ -18,6 +18,7 @@<br> #include <errno.h><br> #include <rtems/error.h><br> #include <rtems/rtems_bsdnet.h><br>+#include <assert.h><br> <br> #include <sys/param.h><br> #include <sys/mbuf.h><br>@@ -73,7 +74,6 @@<br> */<br> struct wd_softc {<br> struct arpcom arpcom;<br>- rtems_irq_connect_data irqInfo;<br> struct mbuf **rxMbuf;<br> struct mbuf **txMbuf;<br> int
acceptBroadcast;<br>@@ -84,6 +84,7 @@ struct wd_softc {<br> int txBdActiveCount;<br> rtems_id rxDaemonTid;<br> rtems_id txDaemonTid;<br>+ rtems_vector_number name;<br> <br> unsigned int port;<br> unsigned char *base;<br>@@ -169,19 +170,6 @@ wd8003Enet_interrupt_handler (void *unused)<br> <br> }<br> <br>-static void nopOn(const rtems_irq_connect_data* notUsed)<br>-{<br>- /*<br>- * code should be moved from wd8003Enet_initialize_hardware<br>- * to this location<br>- */<br>-}<br>-<br>-static int wdIsOn(const rtems_irq_connect_data* irq)<br>-{<br>- return BSP_irq_enabled_at_i8259s
(irq->name);<br>-}<br>-<br> /*<br> * Initialize the ethernet hardware<br> */<br>@@ -191,7 +179,7 @@ wd8003Enet_initialize_hardware (struct wd_softc *sc)<br> int i1, ultra;<br> char cc1, cc2;<br> unsigned char temp;<br>- rtems_status_code st;<br>+ rtems_status_code status;<br> unsigned int tport;<br> unsigned char *hwaddr;<br> <br>@@ -257,15 +245,14 @@ wd8003Enet_initialize_hardware (struct wd_softc *sc)<br> /*<br> * Set up interrupts<br> */<br>- sc->irqInfo.hdl = wd8003Enet_interrupt_handler;<br>- sc->irqInfo.on = nopOn;<br>- sc->irqInfo.off = nopOn;<br>- sc->irqInfo.isOn = wdIsOn;<br>-<br>- st = BSP_install_rtems_irq_handler (&sc->irqInfo);<br>- if (!st)<br>- rtems_panic ("Can't attach WD interrupt handler for irq %d\n",<br>-
sc->irqInfo.name);<br>+ status = rtems_interrupt_handler_install(<br>+ sc->name,<br>+ "wd8003",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ wd8003Enet_interrupt_handler,<br>+ NULL<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> }<br> <br> static void<br>@@ -397,7 +384,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)<br> /*<br> * Driver transmit daemon<br> */<br>-void<br>+static void<br> wd_txDaemon (void *arg)<br> {<br> struct wd_softc *sc = (struct wd_softc *)arg;<br>@@ -607,9 +594,9 @@ rtems_wd_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)<br> mtu = ETHERMTU;<br> <br> if (config->irno)<br>- sc->irqInfo.name = config->irno;<br>+ sc->name = config->irno;<br>
else<br>- sc->irqInfo.name = 5;<br>+ sc->name = 5;<br> <br> if (config->port)<br> sc->port = config->port;<br>diff --git a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c<br>index aafb02a..a0ffbb5 100644<br>--- a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c<br>+++ b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c<br>@@ -33,57 +33,12 @@ int BSP_poll_read(int);<br> /* Internal routines */<br> static int tty1_conSetAttr( int minor, const struct termios *t);<br> static int tty2_conSetAttr( int minor, const struct termios *t);<br>-static void isr_on(const rtems_irq_connect_data *);<br>-static void isr_off(const rtems_irq_connect_data *);<br>-static int isr_is_on(const rtems_irq_connect_data *);<br> <br> extern BSP_polling_getchar_function_type
BSP_poll_char;<br> extern int BSPConsolePort;<br> extern void rtems_set_waiting_id_comx( int port, rtems_id id, rtems_event_set event );<br> <br> /*<br>- * Interrupt structure for tty1<br>- */<br>-static rtems_irq_connect_data tty1_isr_data =<br>-{<br>- BSP_UART_COM1_IRQ,<br>- BSP_uart_termios_isr_com1,<br>- 0,<br>- isr_on,<br>- isr_off,<br>- isr_is_on};<br>-<br>-/*<br>- * Interrupt structure for tty2<br>- */<br>-static rtems_irq_connect_data tty2_isr_data =<br>-{<br>- BSP_UART_COM2_IRQ,<br>- BSP_uart_termios_isr_com2,<br>- 0,<br>- isr_on,<br>- isr_off,<br>- isr_is_on};<br>-<br>-static void<br>-isr_on(const rtems_irq_connect_data *unused)<br>-{<br>- return;<br>-}<br>-<br>-static void<br>-isr_off(const rtems_irq_connect_data *unused)<br>-{<br>- return;<br>-}<br>-<br>-static int<br>-isr_is_on(const rtems_irq_connect_data *irq)<br>-{<br>- return
BSP_irq_enabled_at_i8259s(irq->name);<br>-}<br>-<br>-/*<br> * TTYS1 - device driver INITIALIZE entry point.<br> */<br> rtems_device_driver<br>@@ -111,12 +66,14 @@ tty1_initialize(rtems_device_major_number major,<br> */<br> /* 9600-8-N-1, without hardware flow control */<br> BSP_uart_init( BSP_UART_COM1, 9600, CHR_8_BITS, 0, 0, 0 );<br>- status = BSP_install_rtems_irq_handler( &tty1_isr_data );<br>- if( !status )<br>- {<br>- printk("Error installing ttyS1 interrupt handler!\n");<br>- rtems_fatal_error_occurred(status);<br>- }<br>+ status = rtems_interrupt_handler_install(<br>+ BSP_UART_COM1_IRQ,<br>+ "tty_drv",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ BSP_uart_termios_isr_com1,<br>+ 0<br>+ );<br>+
assert(status == RTEMS_SUCCESSFUL);<br> /*<br> * Register the device<br> */<br>@@ -132,7 +89,13 @@ tty1_initialize(rtems_device_major_number major,<br> <br> static int tty1_last_close(int major, int minor, void *arg)<br> {<br>- BSP_remove_rtems_irq_handler( &tty1_isr_data );<br>+ rtems_status_code status;<br>+ status = rtems_interrupt_handler_remove(<br>+ BSP_UART_COM1_IRQ,<br>+ BSP_uart_termios_isr_com1,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> return 0;<br> }<br> <br>@@ -339,12 +302,14 @@ tty2_initialize(rtems_device_major_number major,<br> */<br> /* 9600-8-N-1, without hardware flow control */<br> BSP_uart_init( BSP_UART_COM2, 9600, CHR_8_BITS, 0, 0, 0);<br>- status = BSP_install_rtems_irq_handler( &tty2_isr_data );<br>-
if( !status )<br>- {<br>- printk("Error installing serial console interrupt handler!\n");<br>- rtems_fatal_error_occurred(status);<br>- }<br>+ status = rtems_interrupt_handler_install(<br>+ BSP_UART_COM2_IRQ,<br>+ "tty_drv",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ BSP_uart_termios_isr_com2,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> /*<br> * Register the device<br> */<br>@@ -360,7 +325,13 @@ tty2_initialize(rtems_device_major_number major,<br> <br> static int tty2_last_close(int major, int minor, void *arg)<br> {<br>- BSP_remove_rtems_irq_handler( &tty2_isr_data );<br>+ rtems_status_code status;<br>+ status = rtems_interrupt_handler_remove(<br>+
BSP_UART_COM2_IRQ,<br>+ BSP_uart_termios_isr_com2,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> return 0;<br> }<br> <br>diff --git a/c/src/lib/libbsp/i386/shared/smp/smp-imps.c b/c/src/lib/libbsp/i386/shared/smp/smp-imps.c<br>index f1be625..76b4244 100644<br>--- a/c/src/lib/libbsp/i386/shared/smp/smp-imps.c<br>+++ b/c/src/lib/libbsp/i386/shared/smp/smp-imps.c<br>@@ -55,6 +55,7 @@<br> <br> #include <bsp/apic.h><br> #include <bsp/smp-imps.h><br>+#include <assert.h><br> <br> /*<br> * XXXXX The following absolutely must be defined!!!<br>@@ -121,7 +122,7 @@ static void UDELAY(int x)<br> while ( _i-- )<br> _pc386_delay();<br> }<br>- <br>+<br> #define READ_MSR_LO(_x) \<br> (unsigned int)(read_msr(_x) & 0xffffffff)<br> <br>@@ -131,7 +132,7 @@ static void UDELAY(int x)<br> static inline unsigned
long long read_msr(unsigned int msr)<br> {<br> unsigned long long value;<br>- <br>+<br> asm volatile("rdmsr" : "=A" (value) : "c" (msr));<br> return value;<br> }<br>@@ -403,7 +404,7 @@ imps_read_config_table(unsigned start, int count)<br> case IMPS_BCT_PROCESSOR:<br> if ( imps_num_cpus < rtems_configuration_smp_maximum_processors ) {<br> add_processor((imps_processor *)start);<br>- } else <br>+ } else<br> imps_num_cpus++;<br> start += 12; /* 20 total */<br> break;<br>@@ -781,10 +782,15 @@ static rtems_irq_connect_data apIPIIrqData = {<br> extern void bsp_reset(void);<br> void ipi_install_irq(void)<br> {<br>- if (!BSP_install_rtems_irq_handler (&apIPIIrqData)) {<br>- printk("Unable to initialize IPI\n");<br>-
bsp_reset();<br>- }<br>+ rtems_status_code status;<br>+ status = rtems_interrupt_handler_install(<br>+ 16,<br>+ "smp-imps",<br>+ RTEMS_INTERRUPT_UNIQUE,<br>+ (void *)ap_ipi_isr,<br>+ 0<br>+ );<br>+ assert(status == RTEMS_SUCCESSFUL);<br> }<br> <br> #ifdef __SSE__<br>@@ -856,7 +862,7 @@ void bsp_smp_wait_for(<br> <br> /*<br> * Until i386 ms delay does not depend upon the clock we<br>- * will use this less sophisticated delay. <br>+ * will use this less sophisticated delay.<br> */<br> for(i=5000; i>0; i--)<br> ;<br>-- <br>1.7.11.7<br><br>_______________________________________________<br>rtems-devel mailing list<br><a
ymailto="mailto:rtems-devel@rtems.org" href="mailto:rtems-devel@rtems.org">rtems-devel@rtems.org</a><br><a href="http://www.rtems.org/mailman/listinfo/rtems-devel" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-devel</a><br><br><br></div> </div> </div> </div></body></html>