summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
commit6128a4aa5e791ed4e0a655bfd346a52d92da7883 (patch)
treeaf53ca3f67ce405b6fbc6c98399c8e0c87e01a9e /c/src/lib/libbsp/i386
parent2004-04-20 Ralf Corsepius <ralf_corsepius@rtems.org> (diff)
downloadrtems-6128a4aa5e791ed4e0a655bfd346a52d92da7883.tar.bz2
Remove stray white spaces.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/i386/i386ex/clock/ckinit.c32
-rw-r--r--c/src/lib/libbsp/i386/i386ex/console/console.c92
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/bsp.h8
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/netexterns.h2
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/network.c738
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/uti596.h24
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/80386ex.h2
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/start.S218
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/bspstart.c8
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/timer.c4
-rw-r--r--c/src/lib/libbsp/i386/pc386/3c509/3c509.c269
-rw-r--r--c/src/lib/libbsp/i386/pc386/clock/ckinit.c24
-rw-r--r--c/src/lib/libbsp/i386/pc386/clock/rtc.c22
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/console.c84
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/defkeymap.c56
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/fb_vga.c53
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/fb_vga.h7
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/i386kbd.h2
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/inch.c8
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/kd.h35
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/keyboard.c8
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/keyboard.h8
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/mouse_parser.c8
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/mouse_parser.h6
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/outch.c32
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/pc_keyb.c10
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/ps2_drv.h5
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c24
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/ps2_mouse.h2
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/serial_mouse.c80
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/serial_mouse.h7
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/videoAsm.S2
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/vt.c10
-rw-r--r--c/src/lib/libbsp/i386/pc386/ide/ide.c32
-rw-r--r--c/src/lib/libbsp/i386/pc386/ide/idecfg.c4
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/bsp.h12
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/crt.h4
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/wd80x3.h4
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start.S20
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start16.S14
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspstart.c28
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/ldsegs.S48
-rw-r--r--c/src/lib/libbsp/i386/pc386/timer/timer.c66
-rw-r--r--c/src/lib/libbsp/i386/pc386/timer/timerisr.S4
-rw-r--r--c/src/lib/libbsp/i386/pc386/tools/bin2boot.c44
-rw-r--r--c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c58
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c18
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/i386-stub.c28
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/i386_io.h9
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/tty_drv.c97
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/tty_drv.h5
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/uart.c126
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/uart.h2
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/idt.c38
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.c32
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.h20
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.S34
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_init.c12
-rw-r--r--c/src/lib/libbsp/i386/shared/pci/pcibios.c80
-rw-r--r--c/src/lib/libbsp/i386/shared/pci/pcibios.h6
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/clock/ckinit.c32
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/clock/rtc.c22
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/console/console.c90
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/include/bsp.h8
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/include/wd80x3.h4
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/network/ne2000.c10
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/start/80386ex.h2
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/start/start.S136
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/startup/bspstart.c8
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/timer/timer.c6
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/init.c4
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/serial_debug.adb1
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c4
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h4
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c4
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/i386_ports.ads2
-rw-r--r--c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/init.c4
77 files changed, 1587 insertions, 1489 deletions
diff --git a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c b/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
index 0bece0732a..20d50a35e0 100644
--- a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
+++ b/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
@@ -41,7 +41,7 @@ void Clock_exit( void );
/*
* These are set by clock driver during its init
*/
-
+
rtems_device_major_number rtems_clock_major = ~0;
rtems_device_major_number rtems_clock_minor = 0;
@@ -91,28 +91,28 @@ rtems_device_driver Clock_initialize(
{
unsigned timer_counter_init_value;
unsigned char clock_lsb, clock_msb;
-
+
Clock_driver_ticks = 0;
- Clock_isrs =
- Clock_initial_isr_value =
+ Clock_isrs =
+ Clock_initial_isr_value =
BSP_Configuration.microseconds_per_tick / 1000; /* ticks per clock_isr */
-
+
/*
* configure the counter timer ( should be based on microsecs/tick )
* NB. The divisor(Clock_isrs) resolves the is the same number that appears in confdefs.h
* when setting the microseconds_per_tick value.
*/
ClockOff ( &clockIrqData );
-
+
timer_counter_init_value = BSP_Configuration.microseconds_per_tick / Clock_isrs;
clock_lsb = (unsigned char)timer_counter_init_value;
clock_msb = timer_counter_init_value >> 8;
-
- outport_byte ( TMRCON , 0x34 );
+
+ outport_byte ( TMRCON , 0x34 );
outport_byte ( TMR0 , clock_lsb ); /* load LSB first */
outport_byte ( TMR0 , clock_msb ); /* then MSB */
-
+
if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
printk("Unable to initialize system clock\n");
rtems_fatal_error_occurred(1);
@@ -121,10 +121,10 @@ rtems_device_driver Clock_initialize(
/*
* make major/minor avail to others such as shared memory driver
*/
-
+
rtems_clock_major = major;
rtems_clock_minor = minor;
-
+
return RTEMS_SUCCESSFUL;
}
@@ -135,15 +135,15 @@ rtems_device_driver Clock_control(
)
{
rtems_libio_ioctl_args_t *args = pargp;
-
+
if (args == 0)
goto done;
-
+
/*
* This is hokey, but until we get a defined interface
* to do this, it will just be this simple...
*/
-
+
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
{
Clock_isr();
@@ -159,13 +159,13 @@ rtems_device_driver Clock_control(
printk("Clock installed AGAIN\n");
#endif
}
-
+
done:
return RTEMS_SUCCESSFUL;
}
void Clock_exit()
{
- ClockOff(&clockIrqData);
+ ClockOff(&clockIrqData);
BSP_remove_rtems_irq_handler (&clockIrqData);
}
diff --git a/c/src/lib/libbsp/i386/i386ex/console/console.c b/c/src/lib/libbsp/i386/i386ex/console/console.c
index 651735cefa..628f0027b5 100644
--- a/c/src/lib/libbsp/i386/i386ex/console/console.c
+++ b/c/src/lib/libbsp/i386/i386ex/console/console.c
@@ -1,7 +1,7 @@
/*-------------------------------------------------------------------------+
| console.c v1.1 - i386ex BSP - 1997/08/07
+--------------------------------------------------------------------------+
-| This file contains the i386ex console I/O package. It is just a termios
+| This file contains the i386ex console I/O package. It is just a termios
| wrapper.
+--------------------------------------------------------------------------+
| (C) Copyright 1997 -
@@ -48,7 +48,7 @@
* Possible value for console input/output :
* BSP_UART_COM1
* BSP_UART_COM2
- * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
+ * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
* All references to either keyboard or video handling have been removed.
*/
@@ -67,7 +67,7 @@ static int isr_is_on(const rtems_irq_connect_data *);
* Change references to com2 if required.
*/
-static rtems_irq_connect_data console_isr_data =
+static rtems_irq_connect_data console_isr_data =
{ BSP_UART_COM2_IRQ,
BSP_uart_termios_isr_com2,
isr_on,
@@ -79,7 +79,7 @@ isr_on(const rtems_irq_connect_data *unused)
{
return;
}
-
+
static void
isr_off(const rtems_irq_connect_data *unused)
{
@@ -108,21 +108,21 @@ console_initialize(rtems_device_major_number major,
* Set up TERMIOS
*/
rtems_termios_initialize ();
-
+
/*
* Do device-specific initialization
*/
-
+
/* 9600-8-N-1, no hardware flow control */
BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
-
-
+
+
/* Set interrupt handler */
if(BSPConsolePort == BSP_UART_COM1)
{
console_isr_data.name = BSP_UART_COM1_IRQ;
console_isr_data.hdl = BSP_uart_termios_isr_com1;
-
+
}
else
{
@@ -130,9 +130,9 @@ console_initialize(rtems_device_major_number major,
console_isr_data.name = BSP_UART_COM2_IRQ;
console_isr_data.hdl = BSP_uart_termios_isr_com2;
}
-
+
status = BSP_install_rtems_irq_handler(&console_isr_data);
-
+
if (!status){
printk("Error installing serial console interrupt handler!\n");
rtems_fatal_error_occurred(status);
@@ -146,7 +146,7 @@ console_initialize(rtems_device_major_number major,
printk("Error registering console device!\n");
rtems_fatal_error_occurred (status);
}
-
+
if(BSPConsolePort == BSP_UART_COM1)
{
printk("Initialized console on port COM1 9600-8-N-1\n\n");
@@ -176,7 +176,7 @@ console_open(rtems_device_major_number major,
void *arg)
{
rtems_status_code status;
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
console_last_close, /* lastClose */
@@ -204,9 +204,9 @@ console_open(rtems_device_major_number major,
/*
* Pass data area info down to driver
*/
- BSP_uart_termios_set(BSPConsolePort,
+ BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
-
+
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
@@ -223,10 +223,10 @@ console_close(rtems_device_major_number major,
{
return (rtems_termios_close (arg));
-
+
} /* console_close */
-
+
/*-------------------------------------------------------------------------+
| Console device driver READ entry point.
+--------------------------------------------------------------------------+
@@ -248,7 +248,7 @@ console_read(rtems_device_major_number major,
return sc;
} /* console_read */
-
+
/*-------------------------------------------------------------------------+
| Console device driver WRITE entry point.
@@ -261,20 +261,20 @@ console_write(rtems_device_major_number major,
void * arg)
{
return rtems_termios_write (arg);
-
+
} /* console_write */
-
+
/*
* Handle ioctl request.
*/
-rtems_device_driver
+rtems_device_driver
console_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
return rtems_termios_ioctl (arg);
}
@@ -283,45 +283,45 @@ conSetAttr(int minor, const struct termios *t)
{
int baud;
- switch (t->c_cflag & CBAUD)
+ switch (t->c_cflag & CBAUD)
{
- case B50:
+ case B50:
baud = 50;
break;
- case B75:
- baud = 75;
+ case B75:
+ baud = 75;
break;
- case B110:
- baud = 110;
+ case B110:
+ baud = 110;
break;
- case B134:
- baud = 134;
+ case B134:
+ baud = 134;
break;
- case B150:
- baud = 150;
+ case B150:
+ baud = 150;
break;
case B200:
- baud = 200;
+ baud = 200;
break;
- case B300:
+ case B300:
baud = 300;
break;
- case B600:
- baud = 600;
+ case B600:
+ baud = 600;
break;
- case B1200:
+ case B1200:
baud = 1200;
break;
- case B1800:
- baud = 1800;
+ case B1800:
+ baud = 1800;
break;
- case B2400:
+ case B2400:
baud = 2400;
break;
- case B4800:
+ case B4800:
baud = 4800;
break;
- case B9600:
+ case B9600:
baud = 9600;
break;
case B19200:
@@ -330,7 +330,7 @@ conSetAttr(int minor, const struct termios *t)
case B38400:
baud = 38400;
break;
- case B57600:
+ case B57600:
baud = 57600;
break;
case B115200:
@@ -351,13 +351,13 @@ conSetAttr(int minor, const struct termios *t)
* BSP initialization
*/
-BSP_output_char_function_type BSP_output_char =
+BSP_output_char_function_type BSP_output_char =
(BSP_output_char_function_type) BSP_output_char_via_serial;
-BSP_polling_getchar_function_type BSP_poll_char =
+BSP_polling_getchar_function_type BSP_poll_char =
(BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
int BSP_poll_read(int ttyMinor){
-
+
return BSP_poll_char_via_serial();
}
diff --git a/c/src/lib/libbsp/i386/i386ex/include/bsp.h b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
index c7c41dfa99..535bc1f3bd 100644
--- a/c/src/lib/libbsp/i386/i386ex/include/bsp.h
+++ b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
@@ -27,7 +27,7 @@ extern "C" {
#include <rtems/bspIo.h>
#include <libcpu/cpu.h>
#include <irq.h>
-
+
/*
* confdefs.h overrides for this BSP:
* - number of termios serial ports (defaults to 1)
@@ -120,15 +120,15 @@ extern "C" {
/*
* Device Driver Table Entries
*/
-
+
/*
* NOTE: Use the standard Console driver entry
*/
-
+
/*
* NOTE: Use the standard Clock driver entry
*/
-
+
/* miscellaneous stuff assumed to exist */
extern rtems_configuration_table BSP_Configuration;
diff --git a/c/src/lib/libbsp/i386/i386ex/network/netexterns.h b/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
index 76259b7bae..4ad43f2231 100644
--- a/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
+++ b/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
@@ -11,7 +11,7 @@
extern int uti596_attach(struct rtems_bsdnet_ifconfig *);
extern int uti596dump(char * );
-extern void uti596reset(void);
+extern void uti596reset(void);
extern void uti596Diagnose(int);
extern void uti596_request_reset(void);
diff --git a/c/src/lib/libbsp/i386/i386ex/network/network.c b/c/src/lib/libbsp/i386/i386ex/network/network.c
index dc30a97703..f15873928d 100644
--- a/c/src/lib/libbsp/i386/i386ex/network/network.c
+++ b/c/src/lib/libbsp/i386/i386ex/network/network.c
@@ -7,7 +7,7 @@ void dump_scb(void);
void printk_time(void);
#ifdef DBG_VERSION
-#define BREAKPOINT() asm(" int $3");
+#define BREAKPOINT() asm(" int $3");
#else
#define BREAKPOINT()
#endif
@@ -16,7 +16,7 @@ void printk_time(void);
/*
-
+
EII: Oct 16 : Version 0.0
*/
@@ -25,9 +25,9 @@ void printk_time(void);
#define DMA_MASK_REG 0x0A
#define DMA_MODE_REG 0x0B
#define DMA_ENABLE 0x0
-#define DMA_DISABLE 0x4
+#define DMA_DISABLE 0x4
-struct i596_rfd *pISR_Rfd;
+struct i596_rfd *pISR_Rfd;
void show_buffers (void);
void show_queues(void);
@@ -111,7 +111,7 @@ char uti596initSetup[] = {
/* These are extern, and non-inline for testing purposes */
void uti596addCmd (struct i596_cmd *pCmd);
-void uti596_initMem (struct uti596_softc *);
+void uti596_initMem (struct uti596_softc *);
void uti596_init (void * );
int uti596initRxBufs (int num);
int uti596_initRFA (int num);
@@ -139,7 +139,7 @@ void uti596addPolledCmd(struct i596_cmd *);
void uti596supplyFD(struct i596_rfd *);
struct i596_rfd * uti596dequeue( struct i596_rfd ** );
-void uti596append( struct i596_rfd ** , struct i596_rfd * );
+void uti596append( struct i596_rfd ** , struct i596_rfd * );
#ifdef DEBUG_INIT
static void print_eth (unsigned char *);
@@ -167,7 +167,7 @@ void send_packet(struct ifnet *, struct mbuf *);
}
/*************************************************************************/
-void
+void
uti596_request_reset(void){
rtems_status_code sc;
@@ -225,7 +225,7 @@ int uti596_initRFA(int num)
printf ("%s: uti596_initRFA %d.\n", num);
#endif
- /*
+ /*
* Initialize the first rfd in the rfa
*/
pRfd = (struct i596_rfd *) calloc (1,sizeof (struct i596_rfd));
@@ -236,7 +236,7 @@ int uti596_initRFA(int num)
else {
uti596_softc.countRFD = 1;
uti596_softc.pBeginRFA = uti596_softc.pEndRFA = pRfd;
- printf ( "First Rfd allocated is: %p\n",
+ printf ( "First Rfd allocated is: %p\n",
uti596_softc.pBeginRFA);
}
@@ -244,31 +244,31 @@ int uti596_initRFA(int num)
pRfd = (struct i596_rfd *) calloc (1,sizeof (struct i596_rfd) );
if ( pRfd != NULL ) {
uti596_softc.countRFD++;
- uti596_softc.pEndRFA -> next = pRfd; /* link it in */
+ uti596_softc.pEndRFA -> next = pRfd; /* link it in */
uti596_softc.pEndRFA = pRfd; /* move the end */
#ifdef DBG_596_RFA
printf("Allocated RFD @ %p\n", pRfd);
#endif
}
- else {
+ else {
printf("Can't allocate all buffers: only %d allocated\n", i);
break;
}
} /* end for */
-
+
uti596_softc.pEndRFA -> next = I596_NULL;
- UTI_596_ASSERT(uti596_softc.countRFD == RX_BUF_COUNT,"INIT:WRONG RFD COUNT\n" );
-
+ UTI_596_ASSERT(uti596_softc.countRFD == RX_BUF_COUNT,"INIT:WRONG RFD COUNT\n" );
+
#ifdef DBG_596_RFA
- printf ( "Head of RFA is buffer %p\nEnd of RFA is buffer %p \n",
- uti596_softc.pBeginRFA,
+ printf ( "Head of RFA is buffer %p\nEnd of RFA is buffer %p \n",
+ uti596_softc.pBeginRFA,
uti596_softc.pEndRFA );
#endif
/* initialize the Rfd's */
for ( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL;
pRfd = pRfd -> next ) {
-
+
pRfd->cmd = 0x0000;
pRfd->stat = 0x0000;
pRfd->pRbd = I596_NULL;
@@ -278,7 +278,7 @@ int uti596_initRFA(int num)
printf("Can't allocate the RFD data buffer\n");
}
- /* mark the last FD */
+ /* mark the last FD */
uti596_softc.pEndRFA -> cmd = CMD_EOL; /* moved jan 13 from before the init stuff */
#ifdef DBG_596_RFA
@@ -286,15 +286,15 @@ int uti596_initRFA(int num)
#endif
- uti596_softc.pSavedRfdQueue =
+ uti596_softc.pSavedRfdQueue =
uti596_softc.pEndSavedQueue = I596_NULL; /* initially empty */
-
+
uti596_softc.savedCount = 0;
uti596_softc.nop.cmd.command = CmdNOp; /* initialize the nop command */
return (i); /* the number of allocated buffers */
-
+
}
/***********************************************************************
* Function: uti596supplyFD
@@ -316,10 +316,10 @@ void uti596supplyFD(struct i596_rfd * pRfd )
pRfd -> next = I596_NULL;
pRfd -> stat = 0x0000; /* clear STAT_C and STAT_B bits */
- /*
+ /*
* Check if the list is empty:
*/
- if ( uti596_softc.pBeginRFA == I596_NULL ) {
+ if ( uti596_softc.pBeginRFA == I596_NULL ) {
/* Init a list w/ one entry */
uti596_softc.pBeginRFA = uti596_softc.pEndRFA = pRfd;
UTI_596_ASSERT(uti596_softc.countRFD == 0, "Null begin, but non-zero count\n");
@@ -332,22 +332,22 @@ void uti596supplyFD(struct i596_rfd * pRfd )
* Check if the last RFD is used/read by the 596.
*/
pLastRfd = uti596_softc.pEndRFA;
-
- if ( pLastRfd != I596_NULL &&
+
+ if ( pLastRfd != I596_NULL &&
! (pLastRfd -> stat & ( STAT_C | STAT_B ) )) { /* C = complete, B = busy (prefetched) */
-
- /*
- * Not yet too late to add it
+
+ /*
+ * Not yet too late to add it
*/
pLastRfd -> next = pRfd;
pLastRfd -> cmd &= ~CMD_EOL; /* RESET_EL : reset EL bit to 0 */
- uti596_softc.countRFD++; /* Lets assume we add it successfully
+ uti596_softc.countRFD++; /* Lets assume we add it successfully
If not, the RFD may be used, and may decrement countRFD < 0 !!*/
/*
* Check if the last RFD was used while appending.
*/
if ( pLastRfd -> stat & ( STAT_C | STAT_B ) ) { /* completed or was prefetched */
- /*
+ /*
* Either the EL bit of the last rfd has been read by the 82596,
* and it will stop after reception,( true when RESET_EL not reached ) or
* the EL bit was NOT read by the 82596 and it will use the linked
@@ -356,7 +356,7 @@ void uti596supplyFD(struct i596_rfd * pRfd )
* Therefore, the end of list CANNOT be updated.
*/
UTI_596_ASSERT ( uti596_softc.pLastUnkRFD == I596_NULL, "Too many Unk RFD's\n" );
- uti596_softc.pLastUnkRFD = pRfd;
+ uti596_softc.pLastUnkRFD = pRfd;
return;
}
else {
@@ -364,20 +364,20 @@ void uti596supplyFD(struct i596_rfd * pRfd )
* The RFD being added was not touched by the 82596
*/
if (uti596_softc.pLastUnkRFD != I596_NULL ) {
-
+
uti596append(&uti596_softc.pSavedRfdQueue, pRfd); /* Only here! saved Q */
uti596_softc.pEndSavedQueue = pRfd;
uti596_softc.savedCount++;
uti596_softc.countRFD--;
-
+
}
else {
uti596_softc.pEndRFA = pRfd; /* the RFA has been extended */
- if ( ( uti596_softc.scb.status & SCB_STAT_RNR ||
+ if ( ( uti596_softc.scb.status & SCB_STAT_RNR ||
uti596_softc.scb.status & RU_NO_RESOURCES ) &&
uti596_softc.countRFD > 1 ) { /* was == 2 */
uti596_softc.pBeginRFA -> cmd &= ~CMD_EOL; /* Ensure that beginRFA is not EOL */
-
+
UTI_596_ASSERT(uti596_softc.pEndRFA -> next == I596_NULL, "supply: List buggered\n");
UTI_596_ASSERT(uti596_softc.pEndRFA -> cmd & CMD_EOL, "supply: No EOL at end.\n");
UTI_596_ASSERT(uti596_softc.scb.command == 0, "Supply: scb command must be zero\n");
@@ -389,24 +389,24 @@ void uti596supplyFD(struct i596_rfd * pRfd )
uti596_softc.scb.pRfd = uti596_softc.pBeginRFA;
uti596_softc.scb.command = RX_START | SCB_STAT_RNR; /* Don't ack RNR! The receiver should be stopped in this case */
UTI_596_ASSERT( !(uti596_softc.scb.status & SCB_STAT_FR),"FRAME RECEIVED INT COMING!\n");
- outport_byte(CHAN_ATTN, 0);
+ outport_byte(CHAN_ATTN, 0);
}
}
return;
-
+
}
- }
+ }
else {
- /*
- * too late , pLastRfd in use ( or NULL ),
- * in either case, EL bit has been read, and RNR condition will occur
+ /*
+ * too late , pLastRfd in use ( or NULL ),
+ * in either case, EL bit has been read, and RNR condition will occur
*/
uti596append( &uti596_softc.pSavedRfdQueue, pRfd); /* save it for RNR */
-
- uti596_softc.pEndSavedQueue = pRfd; /* reset end of saved queue */
+
+ uti596_softc.pEndSavedQueue = pRfd; /* reset end of saved queue */
uti596_softc.savedCount++;
-
-
+
+
return;
}
}
@@ -427,7 +427,7 @@ uti596_initialize_hardware(struct uti596_softc *sc)
rtems_status_code status_code;
printf("uti596_initialize_hardware\n");
-
+
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
@@ -442,12 +442,12 @@ uti596_initialize_hardware(struct uti596_softc *sc)
#ifdef DBG_INIT
printf("initialize_hardware:change scp address to : %p\n",sc->pScp);
#endif
-
+
/* change the scp address */
#ifdef DBG_INIT
printf("Change the SCP address\n");
#endif
-
+
/*
* Set the DMA mode to enable the 82596 to become a bus-master
*/
@@ -458,37 +458,37 @@ uti596_initialize_hardware(struct uti596_softc *sc)
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
-
+
outport_word(PORT_ADDR, ((((int)sc->pScp) & 0xffff) | 2 ));
outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
-
+
/* This is linear mode, LOCK function is disabled */
-
+
sc->pScp->sysbus = 0x00540000;
sc->pScp->iscp = &sc->iscp;
sc->iscp.scb = &sc->scb;
sc->iscp.stat = 0x0001;
-
+
sc->pCmdHead = sc->scb.pCmd = I596_NULL;
-
+
#ifdef DBG_596
printf("Starting i82596.\n");
#endif
-
+
/* Pass the scb address to the 596 */
outport_word(CHAN_ATTN,0);
-
+
while (sc->iscp.stat)
if (--boguscnt == 0)
{
- printf("initialize_hardware: timed out with status %4.4lx\n",
+ printf("initialize_hardware: timed out with status %4.4lx\n",
sc->iscp.stat );
break;
}
-
+
/* clear the command word */
sc->scb.command = 0;
-
+
/*
* Set up interrupts ( NEW irq style )
*/
@@ -497,7 +497,7 @@ uti596_initialize_hardware(struct uti596_softc *sc)
sc->irqInfo.on = uti596_maskOn;
sc->irqInfo.off = uti596_maskOff;
sc->irqInfo.isOn = uti596_isOn;
-
+
status_code = BSP_install_rtems_irq_handler (&sc->irqInfo);
if (!status_code)
rtems_panic ("Can't attach uti596 interrupt handler for irq %d\n",
@@ -505,7 +505,7 @@ uti596_initialize_hardware(struct uti596_softc *sc)
/* Initialize the 82596 memory ( Transmit buffers ) */
uti596_initMem(sc);
-
+
#ifdef DBG_INIT
printf("After attach, status of board = 0x%x\n", sc->scb.status );
#endif
@@ -519,11 +519,11 @@ uti596_reset_hardware(struct uti596_softc *sc)
int boguscnt = 1000;
rtems_status_code status_code;
struct i596_cmd *pCmd;
-
+
printf("uti596_reset_hardware\n");
pCmd = sc->pCmdHead; /* This is a tx command for sure (99.99999%) */
-
+
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
@@ -538,17 +538,17 @@ uti596_reset_hardware(struct uti596_softc *sc)
#endif
sc->pScp = (struct i596_scp *)
((((int)uti596_softc.pScp) + 0xf) & 0xfffffff0);
-
+
#ifdef DBG_RESET
printf("reset_hardware:change scp address to : %p\n",sc->pScp);
#endif
-
+
/* change the scp address */
#ifdef DBG_RESET
printf("Change the SCP address\n");
#endif
-
+
/*
* Set the DMA mode to enable the 82596 to become a bus-master
*/
@@ -559,52 +559,52 @@ uti596_reset_hardware(struct uti596_softc *sc)
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
-
+
/* outport_word(PORT_ADDR, ((((int)uti596_softc.pScp) & 0xffff) | 2 ));
outport_word(PORT_ADDR, (( (int)uti596_softc.pScp) >> 16 ) & 0xffff ); */
-
+
outport_word(PORT_ADDR, ((((int)sc->pScp) & 0xffff) | 2 ));
outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
-
+
/* This is linear mode, LOCK function is disabled */
-
+
sc->pScp->sysbus = 0x00540000;
sc->pScp->iscp = &sc->iscp;
sc->iscp.scb = &sc->scb;
sc->iscp.stat = 0x0001;
-
+
sc->pCmdHead = sc->scb.pCmd = I596_NULL;
/*
- * Wake the transmitter if needed.
+ * Wake the transmitter if needed.
*/
- if ( uti596_softc.txDaemonTid && pCmd != I596_NULL ){
+ if ( uti596_softc.txDaemonTid && pCmd != I596_NULL ){
printf("****RESET: wakes transmitter!\n");
- status_code = rtems_event_send (uti596_softc.txDaemonTid,
+ status_code = rtems_event_send (uti596_softc.txDaemonTid,
INTERRUPT_EVENT);
-
+
if ( status_code != RTEMS_SUCCESSFUL )
printk("****ERROR:Could NOT send event to tid 0x%x : %s\n",
uti596_softc.txDaemonTid, rtems_status_text (status_code) );
}
-
+
#ifdef DBG_596
printf("reset_hardware: starting i82596.\n");
#endif
-
+
/* Pass the scb address to the 596 */
outport_word(CHAN_ATTN,0);
-
+
while (sc->iscp.stat)
if (--boguscnt == 0)
{
- printf("reset_hardware: timed out with status %4.4lx\n",
+ printf("reset_hardware: timed out with status %4.4lx\n",
sc->iscp.stat );
break;
}
-
+
/* clear the command word */
sc->scb.command = 0;
-
+
#ifdef DBG_RESET
printf("After reset_hardware, status of board = 0x%x\n", sc->scb.status );
#endif
@@ -635,18 +635,18 @@ uti596_initMem(struct uti596_softc * sc)
sc->resetDone = 0; /* ??? */
/*
- * Set up receive frame area (RFA)
+ * Set up receive frame area (RFA)
*/
i = uti596_initRFA( sc->rxBdCount );
- if ( i < sc->rxBdCount )
+ if ( i < sc->rxBdCount )
printf("init_rfd: only able to allocate %d receive frame descriptors\n", i);
-
- sc->scb.pRfd = sc->pBeginRFA;
+
+ sc->scb.pRfd = sc->pBeginRFA;
#ifdef DBG_INIT
printf(" IRQ %d.\n", sc->irqInfo.name);
-#endif
-
+#endif
+
/*
* Diagnose the health of the board
*/
@@ -678,7 +678,7 @@ uti596_initMem(struct uti596_softc * sc)
/*******/
- /*
+ /*
* Create the IA setup command
*/
@@ -692,11 +692,11 @@ uti596_initMem(struct uti596_softc * sc)
sc->cmdOk = 0;
uti596addPolledCmd((struct i596_cmd *)&sc->set_add);
/*******/
-
+
count = 2000;
while( !(sc->set_add.cmd.status & STAT_C ) && --count)
printf(".");
-
+
if ( count )
printf ("Set Address OK, count= %d\n",count);
else
@@ -704,9 +704,9 @@ uti596_initMem(struct uti596_softc * sc)
/*******/
#ifdef DBG_INIT
- printf( "After initialization, status and command: 0x%x, 0x%x\n",
+ printf( "After initialization, status and command: 0x%x, 0x%x\n",
sc->scb.status, sc->scb.status);
-
+
#endif
/* initialize transmit buffer descriptors*/
@@ -716,19 +716,19 @@ uti596_initMem(struct uti596_softc * sc)
sc->pTxCmd -> pTbd = sc->pTbd;
sc->pTxCmd->cmd.command = CMD_FLEX|CmdTx;
sc->pTxCmd->pad = 0;
- sc->pTxCmd->size = 0; /* all bytes are in list of TBD's */
+ sc->pTxCmd->size = 0; /* all bytes are in list of TBD's */
pTbd = sc->pTbd;
for ( i=0; i<sc->txBdCount; i++)
pTbd = pTbd -> next = (struct i596_tbd *) calloc (1,sizeof (struct i596_tbd) );
-
+
pTbd -> next = I596_NULL;
- memset ( &sc->zeroes, 0, 64);
+ memset ( &sc->zeroes, 0, 64);
#ifdef DBG_596
- printf( "After receiver start, status and command: 0x%x, 0x%x\n",
+ printf( "After receiver start, status and command: 0x%x, 0x%x\n",
sc->scb.status, sc->scb.status);
#endif
printf("uti596_initMem allows ISR's\n");
@@ -743,7 +743,7 @@ uti596_initMem(struct uti596_softc * sc)
*
* Description: Dump 596 registers
*
- * Algorithm:
+ * Algorithm:
***********************************************************************/
/* static */ int
uti596dump(char * pDumpArea)
@@ -752,7 +752,7 @@ uti596dump(char * pDumpArea)
int boguscnt = 25000000; /* over a second! */
-#ifdef DBG_596
+#ifdef DBG_596
printf("uti596dump:\n");
#endif
@@ -770,8 +770,8 @@ printf("uti596dump:\n");
if ( uti596_softc.cmdOk )
return 1; /* successful completion */
}
-
-
+
+
}
/***********************************************************************
@@ -779,7 +779,7 @@ printf("uti596dump:\n");
*
* Description: Receiver task
*
- * Algorithm: Extract the packet from an RFD, and place into an
+ * Algorithm: Extract the packet from an RFD, and place into an
* mbuf chain. Place the mbuf chain in the network task
* queue. Assumes that the frame check sequence is removed
* by the 82596.
@@ -798,19 +798,19 @@ uti596_rxDaemon(void *arg)
int tid;
rtems_event_set events;
struct ether_header *eh;
-
+
int frames = 0;
-
+
#ifdef DBG_596
printf ("uti596_rxDaemon\n");
printf("&scb = %p, pRfd = %p\n", &sc->scb,sc->scb.pRfd);
-#endif
+#endif
rtems_task_ident (0, 0, &tid);
#ifdef DBG_596
printf("RX tid = 0x%x\n", tid);
-#endif
+#endif
for(;;) {
/*
@@ -824,16 +824,16 @@ uti596_rxDaemon(void *arg)
RTEMS_WAIT|RTEMS_EVENT_ANY,
RTEMS_NO_TIMEOUT,
&events);
-
+
#ifdef DBG_596
printf("Receiver wakes\n");
#endif
- /*
+ /*
* While received frames are available. Note that the frame may be
* a fragment, so it is NOT a complete packet.
*/
pRfd = uti596dequeue( &sc->pInboundFrameQueue);
- while ( pRfd &&
+ while ( pRfd &&
pRfd != I596_NULL &&
pRfd -> stat & STAT_C )
{
@@ -852,12 +852,12 @@ uti596_rxDaemon(void *arg)
#endif
frames++;
-
- /*
+
+ /*
* Allocate an mbuf to give to the stack
* The format of the data portion of the RFD is:
- * <ethernet header, payload>.
- * The FRAME CHECK SEQUENCE / CRC is stripped by the uti596.
+ * <ethernet header, payload>.
+ * The FRAME CHECK SEQUENCE / CRC is stripped by the uti596.
* This is to be optimized later.... should not have to memcopy!
*/
MGETHDR(m, M_WAIT, MT_DATA);
@@ -865,8 +865,8 @@ uti596_rxDaemon(void *arg)
m->m_pkthdr.rcvif = ifp;
/* move everything into an mbuf */
- memcpy(m->m_data,
- pRfd->data,
+ memcpy(m->m_data,
+ pRfd->data,
pkt_len);
m->m_len = m->m_pkthdr.len = pkt_len - sizeof(struct ether_header) - 4;
@@ -892,43 +892,43 @@ uti596_rxDaemon(void *arg)
ether_input (ifp, eh, m);
} /* end if STAT_OK */
-
+
else {
- /*
+ /*
* A bad frame is present: Note that this could be the last RFD!
*/
#ifdef DBG_596
printf("Bad frame\n");
#endif
- /*
+ /*
* FIX ME: use the statistics from the SCB
*/
sc->stats.rx_errors++;
- if ((sc->scb.pRfd->stat) & 0x0001)
+ if ((sc->scb.pRfd->stat) & 0x0001)
sc->stats.collisions++;
- if ((sc->scb.pRfd->stat) & 0x0080)
+ if ((sc->scb.pRfd->stat) & 0x0080)
sc->stats.rx_length_errors++;
- if ((sc->scb.pRfd->stat) & 0x0100)
+ if ((sc->scb.pRfd->stat) & 0x0100)
sc->stats.rx_over_errors++;
- if ((sc->scb.pRfd->stat) & 0x0200)
+ if ((sc->scb.pRfd->stat) & 0x0200)
sc->stats.rx_fifo_errors++;
- if ((sc->scb.pRfd->stat) & 0x0400)
+ if ((sc->scb.pRfd->stat) & 0x0400)
sc->stats.rx_frame_errors++;
- if ((sc->scb.pRfd->stat) & 0x0800)
+ if ((sc->scb.pRfd->stat) & 0x0800)
sc->stats.rx_crc_errors++;
- if ((sc->scb.pRfd->stat) & 0x1000)
+ if ((sc->scb.pRfd->stat) & 0x1000)
sc->stats.rx_length_errors++;
}
UTI_596_ASSERT(pRfd != I596_NULL, "Supplying NULL RFD\n");
-#ifdef DBG_SUPPLY_FD
+#ifdef DBG_SUPPLY_FD
printf("Supply FD Starting\n");
#endif
_ISR_Disable(level);
uti596supplyFD ( pRfd ); /* Return RFD to RFA. CAN WE REALLY?*/
_ISR_Enable(level);
-#ifdef DBG_SUPPLY_FD
+#ifdef DBG_SUPPLY_FD
printf("Supply FD Complete\n");
#endif
#ifdef DBG_VERSION
@@ -936,14 +936,14 @@ uti596_rxDaemon(void *arg)
#endif
pRfd = uti596dequeue( &sc->pInboundFrameQueue); /* grab next frame */
-
+
} /* end while */
} /* end for(;;)*/
-
+
#ifdef DBG_596
printf ("frames %d\n", frames);
#endif
-
+
}
/***********************************************************************
@@ -951,7 +951,7 @@ uti596_rxDaemon(void *arg)
*
* Description:
* Clear the stat fields for all rfd's
- * Algorithm:
+ * Algorithm:
*
***********************************************************************/
@@ -961,7 +961,7 @@ uti596clearListStatus(struct i596_rfd *pRfd)
while ( pRfd != I596_NULL ) {
pRfd -> stat = 0; /* clear the status field */
- pRfd = pRfd-> next;
+ pRfd = pRfd-> next;
}
}
@@ -978,15 +978,15 @@ void uti596reset(void)
sc->resetDone = 0;
sc->irqInfo.off(&sc->irqInfo);
- UTI_WAIT_COMMAND_ACCEPTED(10000, "reset: wait for previous command complete");
+ UTI_WAIT_COMMAND_ACCEPTED(10000, "reset: wait for previous command complete");
/* abort ALL of the current work */
- /* FEB 17 REMOVED
+ /* FEB 17 REMOVED
>>>>>
sc->scb.command = CUC_ABORT | RX_ABORT;
outport_word(CHAN_ATTN,0);
UTI_WAIT_COMMAND_ACCEPTED(4000, "reset: abort requested");
- <<<<<
+ <<<<<
*/
uti596_reset_hardware(&uti596_softc); /* reset the ethernet hardware. must re-config */
@@ -998,38 +998,38 @@ void uti596reset(void)
sc->set_conf.cmd.command = CmdConfigure;
memcpy (sc->set_conf.data, uti596initSetup, 14);
uti596addPolledCmd( (struct i596_cmd *) &sc->set_conf);
-
+
/****
* POLL
****/
-
+
count = 2000;
while( !( sc->set_conf.cmd.status & STAT_C ) && --count )
printf(".");
-
+
if ( count )
printf("Configure OK, count = %d\n",count);
else
printf("***reset: Configure failed\n");
-
- /*
+
+ /*
* Create the IA setup command
*/
-
+
#ifdef DBG_RESET
printf("reset: Setting Address\n");
#endif
sc->set_add.cmd.command = CmdSASetup;
for ( i=0; i<6; i++)
sc->set_add.data[i]=sc->arpcom.ac_enaddr[i];
-
+
sc->cmdOk = 0;
uti596addPolledCmd((struct i596_cmd *)&sc->set_add);
-
+
count = 2000;
while( !(sc->set_add.cmd.status & STAT_C ) && --count)
printf(".");
-
+
if ( count )
printf ("Reset Set Address OK, count= %d\n",count);
else
@@ -1039,11 +1039,11 @@ void uti596reset(void)
sc->pCmdHead = sc->pCmdTail = sc->scb.pCmd = I596_NULL; /* Feb 17. clear these out */
#ifdef DBG_RESET
- printf( "After reset, status and command: 0x%x, 0x%x\n",
+ printf( "After reset, status and command: 0x%x, 0x%x\n",
sc->scb.status, sc->scb.status);
-
+
#endif
-
+
/* restore the RFA */
@@ -1051,9 +1051,9 @@ void uti596reset(void)
if ( sc->pLastUnkRFD != I596_NULL ) {
sc-> pEndRFA = sc->pLastUnkRFD; /* The end position can be updated */
- sc-> pLastUnkRFD = I596_NULL;
+ sc-> pLastUnkRFD = I596_NULL;
}
-
+
sc->pEndRFA->next = sc->pSavedRfdQueue;
if ( sc->pSavedRfdQueue != I596_NULL ) {
sc->pEndRFA = sc->pEndSavedQueue;
@@ -1067,7 +1067,7 @@ void uti596reset(void)
sc->pEndRFA -> next = sc->pInboundFrameQueue;
sc->pInboundFrameQueue = pRfd;
} while( pRfd != I596_NULL ) ;
-
+
}
*/
@@ -1081,14 +1081,14 @@ void uti596reset(void)
sc->scb.command = RX_START;
sc->started = 1; /* we assume that the start works */
sc->resetDone = 1; /* moved here from after channel attn. */
- outport_word(CHAN_ATTN,0 );
+ outport_word(CHAN_ATTN,0 );
UTI_WAIT_COMMAND_ACCEPTED(4000, "reset");
printf("Reset:Start complete \n");
UTI_596_ASSERT(sc->pCmdHead == I596_NULL, "Reset: CMD not cleared\n");
sc->irqInfo.on(&sc->irqInfo); /* moved back here. Tried it before RX command issued. */
-
+
/* uti596addCmd(&uti506_softc.nop); */ /* just for fun */
-
+
#ifdef DBG_RESET
printf("reset: complete\n");
#endif
@@ -1117,7 +1117,7 @@ void uti596reset(void)
#endif
#ifdef DEBUG_ADD
-
+
switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */
case CmdConfigure:
printf("ADD: Configure Command 0x%x\n", pCmd->command);
@@ -1146,7 +1146,7 @@ void uti596reset(void)
printf("****Unknown Command encountered 0x%x\n", pCmd->command);
break;
} /* end switch */
-
+
#endif
@@ -1159,7 +1159,7 @@ void uti596reset(void)
_ISR_Disable(level);
if (uti596_softc.pCmdHead == I596_NULL)
{
- uti596_softc.pCmdHead =
+ uti596_softc.pCmdHead =
uti596_softc.pCmdTail =
uti596_softc.scb.pCmd = pCmd;
#ifdef DBG_596
@@ -1171,23 +1171,23 @@ void uti596reset(void)
outport_word (CHAN_ATTN,0);
_ISR_Enable(level);
}
- else
+ else
{
#ifdef DBG_596
printf("Chained Cmd\n");
#endif
- uti596_softc.pCmdTail->next = pCmd;
+ uti596_softc.pCmdTail->next = pCmd;
uti596_softc.pCmdTail = pCmd; /* added Jan 30 */
_ISR_Enable(level);
}
#ifdef DBG_596
- printf("Scb status & command 0x%x 0x%x\n",
+ printf("Scb status & command 0x%x 0x%x\n",
uti596_softc.scb.status,
uti596_softc.scb.command );
#endif
-
+
}
/***********************************************************************
@@ -1199,7 +1199,7 @@ void uti596reset(void)
*
* Algorithm:
* Give the command to the driver. ( CUC_START is ALWAYS required )
- * Poll for completion.
+ * Poll for completion.
*
***********************************************************************/
@@ -1211,7 +1211,7 @@ void uti596addPolledCmd(struct i596_cmd *pCmd)
#endif
#ifdef DBG_POLLED_CMD
-
+
switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */
case CmdConfigure:
printf("PolledCMD: Configure Command 0x%x\n", pCmd->command);
@@ -1240,7 +1240,7 @@ void uti596addPolledCmd(struct i596_cmd *pCmd)
printf("PolledCMD: ****Unknown Command encountered 0x%x\n", pCmd->command);
break;
} /* end switch */
-
+
#endif
pCmd->status = 0;
@@ -1254,15 +1254,15 @@ void uti596addPolledCmd(struct i596_cmd *pCmd)
uti596_softc.scb.command = CUC_START;
outport_word (CHAN_ATTN,0);
- UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: start");
+ UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: start");
uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = I596_NULL;
#ifdef DBG_POLLED_CMD
- printf("Scb status & command 0x%x 0x%x\n",
+ printf("Scb status & command 0x%x 0x%x\n",
uti596_softc.scb.status,
uti596_softc.scb.command );
#endif
-
+
}
/*
* Driver transmit daemon
@@ -1279,15 +1279,15 @@ uti596_txDaemon (void *arg)
/*
* Wait for packet from stack
*/
- rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
+ rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
+ RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events);
-
+
/*
* Send packets till queue is empty.
* Ensure that irq is on before sending.
*/
- for (;;) {
+ for (;;) {
/* Feb 17: No need to make sure a reset is in progress,
* Since reset daemon runs at same priority as this thread
*/
@@ -1297,7 +1297,7 @@ uti596_txDaemon (void *arg)
IF_DEQUEUE(&ifp->if_snd, m);
if (!m)
break;
-
+
send_packet (ifp, m); /* blocks */
} /* end for */
ifp->if_flags &= ~IFF_OACTIVE; /* no more to send, mark output inactive */
@@ -1321,8 +1321,8 @@ uti596_resetDaemon (void *arg)
/*
* Wait for reset event from ISR
*/
- rtems_bsdnet_event_receive (NIC_RESET_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
+ rtems_bsdnet_event_receive (NIC_RESET_EVENT,
+ RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events);
rtems_clock_get(RTEMS_CLOCK_GET_TOD, &tm_struct);
@@ -1344,7 +1344,7 @@ uti596_resetDaemon (void *arg)
* Function: send_packet
*
* Description: Send a raw ethernet packet
- *
+ *
* Algorithm:
* increment some stats counters,
* create the transmit command,
@@ -1359,22 +1359,22 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
*pRemainingTbdList,
*pTbd;
struct mbuf *n, *input_m = m;
-
+
struct uti596_softc *sc = ifp->if_softc; /* is this available from ifp ?*/
- struct mbuf *l = NULL;
+ struct mbuf *l = NULL;
unsigned int length = 0;
rtems_status_code status;
int bd_count = 0;
rtems_event_set events;
- /*
- * For all mbufs in the chain,
+ /*
+ * For all mbufs in the chain,
* fill a transmit buffer descriptor
*/
pTbd = sc->pTxCmd->pTbd;
- do {
+ do {
if (m->m_len) {
/*
* Fill in the buffer descriptor
@@ -1404,30 +1404,30 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
printf("TX ERROR:Too many mbufs in the packet!!!\n");
printf("Must coalesce!\n");
}
-
-
+
+
if ( length < UTI_596_ETH_MIN_SIZE ) {
pTbd->data = sc->zeroes; /* add padding to pTbd */
pTbd->size = UTI_596_ETH_MIN_SIZE - length; /* zeroes have no effect on the CRC */
}
else
pTbd = pPrev; /* Don't use pTbd in the send routine */
-
+
/* Disconnect the packet from the list of Tbd's */
pRemainingTbdList = pTbd->next;
- pTbd->next = I596_NULL;
- pTbd->size |= UTI_596_END_OF_FRAME;
-
+ pTbd->next = I596_NULL;
+ pTbd->size |= UTI_596_END_OF_FRAME;
+
#ifdef DBG_RAW
printf("RAW:Add cmd and sleep\n");
#endif
-
- sc->rawsndcnt++;
-
+
+ sc->rawsndcnt++;
+
#ifdef DBG_RAW
printf ("sending packet\n");
#endif
-
+
/* Sending Zero length packet: shouldn't happen */
if (pTbd->size <= 0) return ;
@@ -1445,23 +1445,23 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
/* add the command to the output command queue */
uti596addCmd ( (struct i596_cmd *) sc->pTxCmd );
-
+
/* sleep until the command has been processed or Timeout encountered. */
status= rtems_bsdnet_event_receive (INTERRUPT_EVENT,
RTEMS_WAIT|RTEMS_EVENT_ANY,
RTEMS_NO_TIMEOUT,
&events);
-
+
if ( status != RTEMS_SUCCESSFUL ) {
- printf("Could not sleep %s\n", rtems_status_text(status));
+ printf("Could not sleep %s\n", rtems_status_text(status));
}
-
+
#ifdef DBG_RAW
printf("RAW: wake\n");
#endif
-
+
sc->txInterrupts++;
-
+
#ifdef DEBUG_INIT
printf("\nTransmitter issued packet\n");
print_hdr ( sc->pTxCmd->pTbd -> data ); /* print the first part */
@@ -1476,23 +1476,23 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
printf("******Driver Error 0x%x\n", sc->pTxCmd -> cmd.status );
#endif
sc->stats.tx_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0020 )
+ if ( sc->pTxCmd->cmd.status & 0x0020 )
sc->stats.tx_retries_exceeded++;
- if (!(sc->pTxCmd->cmd.status & 0x0040))
+ if (!(sc->pTxCmd->cmd.status & 0x0040))
sc->stats.tx_heartbeat_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0400 )
+ if ( sc->pTxCmd->cmd.status & 0x0400 )
sc->stats.tx_carrier_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0800 )
+ if ( sc->pTxCmd->cmd.status & 0x0800 )
sc->stats.collisions++;
- if ( sc->pTxCmd->cmd.status & 0x1000 )
+ if ( sc->pTxCmd->cmd.status & 0x1000 )
sc->stats.tx_aborted_errors++;
- } /* end if stat_ok */
-
- /*
+ } /* end if stat_ok */
+
+ /*
* Restore the transmited buffer descriptor chain.
*/
pTbd -> next = pRemainingTbdList;
-
+
/*
* Free the mbufs used by the sender.
*/
@@ -1502,7 +1502,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
m = n;
}
-
+
}
/***********************************************************************
@@ -1578,7 +1578,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
{ /* an IP packet */
printf("*********************IP HEADER******************\n");
printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
+ printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
add[18],add[19], add[20], add[21]);
printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
@@ -1706,7 +1706,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
{ /* an IP packet */
printf("*********************IP HEADER******************\n");
printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
+ printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
add[18],add[19], add[20], add[21]);
printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
@@ -1755,55 +1755,55 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
short int length;
if ( add[12] == 0x08 && add[13] == 0x00 ){ /* an IP packet */
-
+
printf("Packet Location %p\n", add);
-
+
printf ("Dest ");
-
+
for (i = 0; i < 6; i++)
printf(" %2.2X", add[i]);
-
+
printf ("\n");
-
+
printf ("Source");
-
+
for (i = 6; i < 12; i++)
printf(" %2.2X", add[i]);
-
+
printf ("\n");
-
+
printf ("frame type %2.2X%2.2X\n", add[12], add[13]);
-
+
printf("*********************IP HEADER******************\n");
printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
+ printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
add[18],add[19], add[20], add[21]);
printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
add[22],add[23],add[24],add[25]);
printf("IP packet type: %2.2X code %2.2X\n", add[34],add[35]);
-
+
printf("Source IP address: ");
for ( i=0; i< 3 ; i++)
printf( "%u.", add[26 + i]);
-
+
printf("%u\n", add[29]);
-
+
printf("Destination IP address: ");
for ( i=0; i< 3 ; i++)
printf( "%u.", add[30 + i]);
printf("%u\n", add[33]);
-
+
printf("********************IP Packet Data*******************\n");
length -=20;
for ( i=0; i < length ; i++)
printf("0x%2.2x ", add[34+i]);
printf("\n");
-
+
printf("ICMP checksum: %2.2x %2.2x\n", add[36], add[37]);
printf("ICMP identifier: %2.2x %2.2x\n", add[38], add[39]);
printf("ICMP sequence nbr: %2.2x %2.2x\n", add[40], add[41]);
- }
+ }
}
#endif
@@ -1823,7 +1823,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
* initialize required rx and tx buffers
* hook interrupt
* issue start command and some diagnostics
- * return
+ * return
*
***********************************************************************/
@@ -1833,31 +1833,31 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
struct uti596_softc *sc = &uti596_softc; /* soft config */
struct ifnet * ifp = &sc->arpcom.ac_if;
int i = 0;
-
+
#ifdef DBG_ATTACH
printf("attach");
#endif
-
+
sc->started = 0; /* The NIC is not started yet */
sc->ioAddr = IO_ADDR;
- /* Indicate to ULCS that this is initialized */
- ifp->if_softc = sc;
+ /* Indicate to ULCS that this is initialized */
+ ifp->if_softc = sc;
sc -> pScp = NULL;
-
+
/* Assign the name */
ifp->if_name = "uti";
-
+
/* Assign the unit number */
ifp->if_unit = 1;
-
+
/* Assign mtu */
if ( pConfig -> mtu )
ifp->if_mtu = pConfig -> mtu;
else
ifp->if_mtu = ETHERMTU;
-
+
/* Assign and possibly override the hw address */
if ( !pConfig->hardware_address) { /* Read the ethernet address from the board */
@@ -1865,14 +1865,14 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
inport_byte(NIC_ADDR+i,sc->arpcom.ac_enaddr[i] );
}
else {
- /* hwaddr override */
+ /* hwaddr override */
memcpy (sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);
}
-
+
/* Test for valid hwaddr */
if(memcmp(sc->arpcom.ac_enaddr,"\xAA\x55\x01",3)!= 0)/* b0 of byte 0 != 0 => multicast */
return ENODEV;
-
+
/* Assign requested receive buffer descriptor count */
if (pConfig->rbuf_count)
sc->rxBdCount = pConfig->rbuf_count;
@@ -1894,15 +1894,15 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/* to init_hardware */
sc->started = 1;
sc->pInboundFrameQueue = I596_NULL;
-
-
+
+
ifp->if_ioctl = uti596_ioctl;
ifp->if_init = uti596_init;
ifp->if_start = uti596_start;
ifp->if_output = ether_output;
-
+
sc->scb.command = 0;
-
+
/*
* Attach the interface
*/
@@ -1945,8 +1945,8 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/* printk("***INFO: ACK %x\n", scbStatus);*/
uti596_softc.scb.command = scbStatus;
outport_word(CHAN_ATTN, 0);
-
- if( uti596_softc.resetDone ) {
+
+ if( uti596_softc.resetDone ) {
/* stack is attached */
UTI_WAIT_COMMAND_ACCEPTED(20000, "****ERROR:ACK");
}
@@ -1959,7 +1959,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("\n***ERROR: Spurious interrupt. Resetting...\n");
uti596_softc.nic_reset = 1;
}
-
+
if ( (scbStatus & SCB_STAT_CX) && !(scbStatus & SCB_STAT_CNA) ){
printk_time();
printk("\n*****ERROR: Command Complete, and CNA available: 0x%x\nResetting...", scbStatus);
@@ -1987,7 +1987,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.nic_reset = 1;
return;
}
-
+
if ( scbStatus & SCB_STAT_RNR ) {
printk_time();
printk("\n*****WARNING: RNR %x\n",scbStatus);
@@ -1995,13 +1995,13 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.pBeginRFA -> cmd,
uti596_softc.pBeginRFA -> stat);
}
-
- /*
+
+ /*
* Receive Unit Control
*/
if ( scbStatus & SCB_STAT_FR ) { /* a frame has been received */
uti596_softc.rxInterrupts++;
-
+
#ifdef DBG_FR
printk("\nISR:FR\n");
#endif
@@ -2010,9 +2010,9 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.nic_reset = 1;
}
else
- while ( uti596_softc.pBeginRFA != I596_NULL &&
+ while ( uti596_softc.pBeginRFA != I596_NULL &&
( uti596_softc.pBeginRFA -> stat & STAT_C)) {
-
+
#ifdef DBG_ISR
printk("ISR:pBeginRFA != NULL\n");
#endif
@@ -2020,19 +2020,19 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
if ( count_rx > 1)
printk("****WARNING: Received 2 frames on 1 interrupt \n");
- /*
- * Give Received Frame to the ULCS
- */
+ /*
+ * Give Received Frame to the ULCS
+ */
uti596_softc.countRFD--;
-
+
if ( uti596_softc.countRFD < 0 )
printk("Count < 0 !!!: count == %d, beginRFA = %p\n",
uti596_softc.countRFD, uti596_softc.pBeginRFA);
-
+
uti596_softc.stats.rx_packets++;
pIsrRfd = uti596_softc.pBeginRFA -> next; /* the append destroys the link */
uti596append( &uti596_softc.pInboundFrameQueue , uti596_softc.pBeginRFA );
-
+
/*
* if we have just received the a frame int he last unknown RFD,
* then it is certain that the RFA is empty.
@@ -2041,60 +2041,60 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
UTI_596_ASSERT(uti596_softc.pLastUnkRFD != I596_NULL,"****ERROR:LastUnk is NULL, begin ptr @ end!\n");
uti596_softc.pEndRFA = uti596_softc.pLastUnkRFD = I596_NULL;
}
-
+
#ifdef DBG_ISR
printk("Wake %#x\n",uti596_softc.rxDaemonTid);
#endif
sc = rtems_event_send(uti596_softc.rxDaemonTid, INTERRUPT_EVENT);
if ( sc != RTEMS_SUCCESSFUL )
- rtems_panic ("Can't notify rxDaemon: %s\n",
- rtems_status_text (sc));
+ rtems_panic ("Can't notify rxDaemon: %s\n",
+ rtems_status_text (sc));
#ifdef DBG_RAW_ISR
else
printk("Rx Wake: %#x\n",uti596_softc.rxDaemonTid);
#endif
-
+
uti596_softc.pBeginRFA = pIsrRfd;
} /* end while */
-
+
if ( uti596_softc.pBeginRFA == I596_NULL ){ /* adjust the pEndRFA to reflect an empty list */
if ( uti596_softc.pLastUnkRFD == I596_NULL && uti596_softc.countRFD != 0 )
printk("Last Unk is NULL, BeginRFA is null, and count == %d\n",uti596_softc.countRFD);
-
+
uti596_softc.pEndRFA = I596_NULL;
if ( uti596_softc.countRFD != 0 ) {
printk("****ERROR:Count is %d, but begin ptr is NULL\n",uti596_softc.countRFD );
}
}
-
+
} /* end scb_stat_fr */
-
+
/*
* Check For Command Complete
*/
if ( scbStatus & SCB_STAT_CX ){
#ifdef DBG_ISR
printk("ISR:CU\n");
-#endif
-
+#endif
+
pIsrCmd = uti596_softc.pCmdHead;
-
- /*
+
+ /*
* For ALL completed commands
*/
if ( pIsrCmd != I596_NULL && pIsrCmd->status & STAT_C ){
-
+
#ifdef DBG_RAW_ISR
printk("ISR:pIsrCmd != NULL\n");
#endif
-
- /*
- * Adjust the command block list
+
+ /*
+ * Adjust the command block list
*/
uti596_softc.pCmdHead = pIsrCmd -> next;
-
+
/*
- * If there are MORE commands to process,
+ * If there are MORE commands to process,
* the serialization in the raw routine has failed.
* ( Perhaps AddCmd is bad? )
*/
@@ -2110,9 +2110,9 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/* printk("****INFO:Configure OK\n"); */
uti596_softc.cmdOk = 1;
break;
-
+
case CmdDump:
-
+
#ifdef DBG_ISR
printk("dump!\n");
#endif
@@ -2120,13 +2120,13 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
break;
case CmdDiagnose:
-
+
#ifdef DBG_ISR
printk("diagnose!\n");
#endif
uti596_softc.cmdOk = 1;
break;
-
+
case CmdSASetup:
/* printk("****INFO:Set address interrupt\n"); */
@@ -2135,7 +2135,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
else
printk("****ERROR:SET ADD FAILED\n");
break;
-
+
case CmdTx:
{
UTI_596_ASSERT(uti596_softc.txDaemonTid, "****ERROR:Null txDaemonTid\n");
@@ -2143,7 +2143,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("wake TX:0x%x\n",uti596_softc.txDaemonTid);
#endif
if ( uti596_softc.txDaemonTid ){ /* Ensure that the transmitter is present */
- sc = rtems_event_send (uti596_softc.txDaemonTid,
+ sc = rtems_event_send (uti596_softc.txDaemonTid,
INTERRUPT_EVENT);
if ( sc != RTEMS_SUCCESSFUL )
@@ -2152,22 +2152,22 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
#ifdef DBG_RAW_ISR
else
printk("****INFO:Tx wake: %#x\n",uti596_softc.txDaemonTid);
-#endif
+#endif
}
} /* End case Cmd_Tx */
break;
-
+
case CmdMulticastList:
printk("***ERROR:Multicast?!\n");
pIsrCmd->next = I596_NULL;
break;
-
+
case CmdTDR:
{
unsigned long status = *( (unsigned long *)pIsrCmd)+1;
printk("****ERROR:TDR?!\n");
-
+
if (status & STAT_C)
{
/*
@@ -2183,47 +2183,47 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("****WARNING:Termination problem.\n");
if (status & 0x1000)
printk("****WARNING:Short circuit.\n");
-
+
/* printk("****INFO:Time %ld.\n", status & 0x07ff); */
}
}
break;
-
- default:
- /*
- * This should never be reached
+
+ default:
+ /*
+ * This should never be reached
*/
printk("CX but NO known command\n");
} /* end switch */
- pIsrCmd = uti596_softc.pCmdHead; /* next command */
+ pIsrCmd = uti596_softc.pCmdHead; /* next command */
if ( pIsrCmd != I596_NULL )
printk("****WARNING: more commands in list, but no start to NIC\n");
} /* end if pIsrCmd != NULL && pIsrCmd->stat & STAT_C */
else {
if ( pIsrCmd != I596_NULL ) { /* The command MAY be NULL from a RESET */
-
+
/* Reset the ethernet card, and wake the transmitter (if necessary) */
printk_time();
printk("****INFO: Request board reset ( tx )\n");
uti596_softc.nic_reset = 1;
if ( uti596_softc.txDaemonTid){ /* Ensure that a transmitter is present */
- sc = rtems_event_send (uti596_softc.txDaemonTid,
+ sc = rtems_event_send (uti596_softc.txDaemonTid,
INTERRUPT_EVENT);
-
+
if ( sc != RTEMS_SUCCESSFUL )
printk("****ERROR:Could NOT send event to tid 0x%x : %s\n",uti596_softc.txDaemonTid, rtems_status_text (sc) );
#ifdef DBG_RAW_ISR
else
printk("****INFO:Tx wake: %#x\n",uti596_softc.txDaemonTid);
-#endif
+#endif
}
}
- }
- } /* end if command complete */
-
-
- /* if the receiver has stopped,
- * check if this is a No Resources scenario,
+ }
+ } /* end if command complete */
+
+
+ /* if the receiver has stopped,
+ * check if this is a No Resources scenario,
* Try to add more RFD's ( no RBDs are used )
*/
if ( uti596_softc.started ) {
@@ -2234,16 +2234,16 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/*
* THE RECEIVER IS OFF!
*/
- if ( uti596_softc.pLastUnkRFD != I596_NULL ){ /* We have an unknown RFD, it is not inbound*/
+ if ( uti596_softc.pLastUnkRFD != I596_NULL ){ /* We have an unknown RFD, it is not inbound*/
if ( uti596_softc.pLastUnkRFD -> stat & (STAT_C | STAT_B )) /* in use */
uti596_softc.pEndRFA = uti596_softc.pLastUnkRFD; /* update end */
- else {
- /*
+ else {
+ /*
* It is NOT in use, and since RNR, we know EL bit of pEndRFA was read!
* So, unlink it from the RFA and move it to the saved queue.
* But pBegin can equal LastUnk!
*/
-
+
if ( uti596_softc.pEndRFA != I596_NULL ){ /* check added feb24. */
#ifdef DEBUG_RFA
if (uti596_softc.pEndRFA -> next != uti596_softc.pLastUnkRFD){
@@ -2260,7 +2260,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.savedCount++;
uti596_softc.pEndSavedQueue = uti596_softc.pLastUnkRFD;
uti596_softc.countRFD--; /* It was not in the RFA */
- /*
+ /*
* The Begin pointer CAN advance this far. We must resynch the CPU side
* with the chip.
*/
@@ -2277,11 +2277,11 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
}
uti596_softc.pLastUnkRFD = I596_NULL;
-
+
} /* end if exists UnkRFD */
- /*
- * Append the saved queue to the RFA.
+ /*
+ * Append the saved queue to the RFA.
* Any further RFD's being supplied will be added to
* this new list.
*/
@@ -2292,11 +2292,11 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("****ERROR:Begin pointer is NULL, but count == %d\n",uti596_softc.countRFD);
}
#endif
- uti596_softc.pBeginRFA = uti596_softc.pSavedRfdQueue;
+ uti596_softc.pBeginRFA = uti596_softc.pSavedRfdQueue;
uti596_softc.pEndRFA = uti596_softc.pEndSavedQueue;
uti596_softc.pSavedRfdQueue = uti596_softc.pEndSavedQueue = I596_NULL; /* Reset the End */
}
- else {
+ else {
#ifdef DEBUG_RFA
if ( uti596_softc.countRFD <= 0) {
printk("****ERROR:Begin pointer is not NULL, but count == %d\n",uti596_softc.countRFD);
@@ -2304,15 +2304,15 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
#endif
UTI_596_ASSERT( uti596_softc.pEndRFA != I596_NULL, "****WARNING: END RFA IS NULL\n");
UTI_596_ASSERT( uti596_softc.pEndRFA->next == I596_NULL, "****ERROR:END RFA -> next must be NULL\n");
-
- uti596_softc.pEndRFA->next = uti596_softc.pSavedRfdQueue;
- uti596_softc.pEndRFA->cmd &= ~CMD_EOL; /* clear the end of list */
+
+ uti596_softc.pEndRFA->next = uti596_softc.pSavedRfdQueue;
+ uti596_softc.pEndRFA->cmd &= ~CMD_EOL; /* clear the end of list */
uti596_softc.pEndRFA = uti596_softc.pEndSavedQueue;
uti596_softc.pSavedRfdQueue = uti596_softc.pEndSavedQueue = I596_NULL; /* Reset the End */
#ifdef DEBUG_ISR
printk("count: %d, saved: %d \n", uti596_softc.countRFD , uti596_softc.savedCount);
#endif
-
+
}
/* printk("Isr: countRFD = %d\n",uti596_softc.countRFD); */
uti596_softc.countRFD += uti596_softc.savedCount;
@@ -2320,15 +2320,15 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.savedCount = 0;
}
-
+
#ifdef DBG_596_RFD
printk("The list starts here %p\n",uti596_softc.pBeginRFA );
#endif
-
+
if ( uti596_softc.countRFD > 1) {
/****REMOVED FEB 18.
- &&
- !( uti596_softc.pBeginRFA -> stat & (STAT_C | STAT_B ))) {
+ &&
+ !( uti596_softc.pBeginRFA -> stat & (STAT_C | STAT_B ))) {
*****/
printk_time();
printk("****INFO: pBeginRFA -> stat = 0x%x\n",uti596_softc.pBeginRFA -> stat);
@@ -2337,7 +2337,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
UTI_596_ASSERT(uti596_softc.scb.command == 0, "****ERROR:scb command must be zero\n");
uti596_softc.scb.pRfd = uti596_softc.pBeginRFA;
/* start RX here */
- printk("****INFO: ISR Starting receiver\n");
+ printk("****INFO: ISR Starting receiver\n");
uti596_softc.scb.command = RX_START; /* should this also be CU start? */
outport_word(CHAN_ATTN, 0);
}
@@ -2345,39 +2345,39 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
else {
printk("****WARNING: Receiver NOT Started -- countRFD = %d\n", uti596_softc.countRFD);
printk("82596 cmd: 0x%x, status: 0x%x RFA len: %d\n",
- uti596_softc.scb.command,
+ uti596_softc.scb.command,
uti596_softc.scb.status,
uti596_softc.countRFD);
-
+
printk("\nRFA: \n");
for ( pISR_Rfd = uti596_softc.pBeginRFA;
pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
+ pISR_Rfd = pISR_Rfd->next)
printk("Frame @ %x, status: %x, cmd: %x\n",
pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
-
+
printk("\nInbound: \n");
for ( pISR_Rfd = uti596_softc.pInboundFrameQueue;
pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
+ pISR_Rfd = pISR_Rfd->next)
printk("Frame @ %x, status: %x, cmd: %x\n",
pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
-
-
+
+
printk("\nSaved: \n");
for ( pISR_Rfd = uti596_softc.pSavedRfdQueue;
pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
+ pISR_Rfd = pISR_Rfd->next)
printk("Frame @ %x, status: %x, cmd: %x\n",
pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
printk("\nUnknown: %p\n",uti596_softc.pLastUnkRFD);
}
*****/
- } /* end stat_rnr */
+ } /* end stat_rnr */
} /* end if receiver started */
/* UTI_596_ASSERT(uti596_softc.scb.status == scbStatus, "****WARNING:scbStatus change!\n"); */
-
+
#ifdef DBG_ISR
printk("X\n");
#endif
@@ -2413,13 +2413,13 @@ struct i596_rfd * uti596dequeue( struct i596_rfd ** ppQ )
struct i596_rfd * pRfd;
_ISR_Disable(level);
-
+
/* invalid address, or empty queue or emptied queue */
if( ppQ == NULL || *ppQ == NULL || *ppQ == I596_NULL) {
_ISR_Enable(level);
return I596_NULL;
}
-
+
pRfd = *ppQ; /* The dequeued buffer */
*ppQ = pRfd->next; /* advance the queue pointer */
pRfd->next = I596_NULL; /* unlink the rfd being returned */
@@ -2427,7 +2427,7 @@ struct i596_rfd * uti596dequeue( struct i596_rfd ** ppQ )
_ISR_Enable(level);
return pRfd;
-}
+}
/***********************************************************************
* Function: void uti596append
@@ -2435,13 +2435,13 @@ struct i596_rfd * uti596dequeue( struct i596_rfd ** ppQ )
* Description:
* adds an RFD to the end of the received frame queue,
* for processing by the rxproc.
- * Also removes this RFD from the RFA
+ * Also removes this RFD from the RFA
*
* Algorithm:
*
***********************************************************************/
-void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
+void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
{
struct i596_rfd *p;
@@ -2449,7 +2449,7 @@ void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
if ( pRfd != NULL && pRfd != I596_NULL) {
pRfd -> next = I596_NULL;
pRfd -> cmd |= CMD_EOL; /* set EL bit */
-
+
if ( *ppQ == NULL || *ppQ == I596_NULL ) {
/* Empty or emptied */
*ppQ = pRfd;
@@ -2458,7 +2458,7 @@ void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
{
for ( p=*ppQ; p -> next != I596_NULL; p=p->next)
;
-
+
p->cmd &= ~CMD_EOL; /* Clear EL bit at end */
p->next = pRfd;
}
@@ -2479,14 +2479,14 @@ void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
* mark transmitter as busy
* abort any transmissions/receptions
* clean-up all buffers ( RFD's et. al. )
- *
- *
- *
+ *
+ *
+ *
*
***********************************************************************/
-/* static */
+/* static */
void uti596_stop(struct uti596_softc *sc)
{
sc->started = 0;
@@ -2546,7 +2546,7 @@ uti596_ioctl (struct ifnet *ifp, int command, caddr_t data)
printk("show stats\n");
uti596_stats (sc);
break;
-
+
/*
* FIXME: All sorts of multicast commands need to be added here!
*/
@@ -2571,7 +2571,7 @@ uti596_ioctl (struct ifnet *ifp, int command, caddr_t data)
***********************************************************************/
-void
+void
uti596_stats(struct uti596_softc *sc)
{
printf(" CPU Reports:\n");
@@ -2580,14 +2580,14 @@ uti596_stats(struct uti596_softc *sc)
printf ("Tx Interrupts:%-8lu\n", sc->txInterrupts);
printf ("Rx Packets:%-8u", sc->stats.rx_packets);
printf ("Tx Attempts:%-u\n", sc->stats.tx_packets);
-
+
printf ("Rx Dropped:%-8u", sc->stats.rx_dropped);
printf ("Rx IP Packets:%-8u", sc->stats.rx_packets);
printf ("Tx Errors:%-8u\n", sc->stats.tx_errors);
printf ("Tx aborted:%-8u", sc->stats.tx_aborted_errors);
printf ("Tx Dropped:%-8u\n", sc->stats.tx_dropped);
printf ("Tx IP packets:%-8u", sc->stats.tx_packets);
-
+
printf ("Collisions Detected:%-8u\n", sc->stats.collisions);
printf ("Tx Heartbeat Errors:%-8u", sc->stats.tx_heartbeat_errors);
printf ("Tx Carrier Errors:%-8u\n", sc->stats.tx_carrier_errors);
@@ -2614,19 +2614,19 @@ void dumpQ(void) {
printf("savedQ:\n");
for( pRfd = uti596_softc.pSavedRfdQueue;
pRfd != I596_NULL;
- pRfd = pRfd -> next)
+ pRfd = pRfd -> next)
printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
printf("Inbound:\n");
for( pRfd = uti596_softc.pInboundFrameQueue;
pRfd != I596_NULL;
- pRfd = pRfd -> next)
+ pRfd = pRfd -> next)
printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
printf("Last Unk: %p\n", uti596_softc.pLastUnkRFD );
-
+
printf("RFA:\n");
for( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL;
- pRfd = pRfd -> next)
+ pRfd = pRfd -> next)
printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
}
@@ -2646,34 +2646,34 @@ void uti596Diagnose(int verbose){
printf("Status diagnostic: 0x%2.2x\n", diagnose.status);
}
-void show_buffers (void)
+void show_buffers (void)
{
struct i596_rfd *pRfd;
printf("82596 cmd: 0x%x, status: 0x%x RFA len: %d\n",
- uti596_softc.scb.command,
+ uti596_softc.scb.command,
uti596_softc.scb.status,
uti596_softc.countRFD);
-
+
printf("\nRFA: \n");
for ( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL;
- pRfd = pRfd->next)
+ pRfd = pRfd->next)
printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
pRfd, pRfd->stat, pRfd->cmd);
-
+
printf("\nInbound: \n");
for ( pRfd = uti596_softc.pInboundFrameQueue;
pRfd != I596_NULL;
- pRfd = pRfd->next)
+ pRfd = pRfd->next)
printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
pRfd, pRfd->stat, pRfd->cmd);
-
+
printf("\nSaved: \n");
for ( pRfd = uti596_softc.pSavedRfdQueue;
pRfd != I596_NULL;
- pRfd = pRfd->next)
+ pRfd = pRfd->next)
printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
pRfd, pRfd->stat, pRfd->cmd);
printf("\nUnknown: %p\n",uti596_softc.pLastUnkRFD);
@@ -2684,26 +2684,26 @@ void show_queues(void)
struct i596_rfd *pRfd;
- printf("CMD: 0x%x, Status: 0x%x\n",
+ printf("CMD: 0x%x, Status: 0x%x\n",
uti596_softc.scb.command,
uti596_softc.scb.status);
printf("saved Q\n");
-
+
for ( pRfd = uti596_softc.pSavedRfdQueue;
pRfd != I596_NULL &&
pRfd != NULL;
pRfd = pRfd->next)
printf("0x%p\n", pRfd);
-
+
printf("End saved Q 0x%p\n", uti596_softc.pEndSavedQueue);
-
+
printf("\nRFA:\n");
for ( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL &&
pRfd != NULL;
pRfd = pRfd->next)
printf("0x%p\n", pRfd);
-
+
printf("uti596_softc.pEndRFA: %p\n",uti596_softc.pEndRFA);
}
@@ -2717,17 +2717,17 @@ void uti596_init(void * arg){
if (sc->txDaemonTid == 0) {
uti596_initialize_hardware(sc);
-
+
/*
* Start driver tasks
*/
-
+
sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, sc);
sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, sc);
- sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096,
+ sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096,
uti596_resetDaemon, sc);
-
-
+
+
#ifdef DBG_INIT
printf("After attach, status of board = 0x%x\n", sc->scb.status );
#endif
@@ -2735,25 +2735,25 @@ void uti596_init(void * arg){
}
- /*
+ /*
* Enable receiver
*/
- UTI_WAIT_COMMAND_ACCEPTED(4000, "init:Before RX_START");
+ UTI_WAIT_COMMAND_ACCEPTED(4000, "init:Before RX_START");
sc->scb.pRfd = sc -> pBeginRFA;
sc->scb.command = RX_START;
- outport_word(CHAN_ATTN,0 );
- UTI_WAIT_COMMAND_ACCEPTED(4000, "init:RX_START");
+ outport_word(CHAN_ATTN,0 );
+ UTI_WAIT_COMMAND_ACCEPTED(4000, "init:RX_START");
/*
* Tell the world that we're running.
*/
ifp->if_flags |= IFF_RUNNING;
-
+
}
void dump_scb(void){
printk("status 0x%x\n",uti596_softc.scb.status);
printk("command 0x%x\n",uti596_softc.scb.command);
printk("cmd 0x%x\n",(int)uti596_softc.scb.pCmd);
- printk("rfd 0x%x\n",(int)uti596_softc.scb.pRfd);
+ printk("rfd 0x%x\n",(int)uti596_softc.scb.pRfd);
printk("crc_err 0x%x\n",uti596_softc.scb.crc_err);
printk("align_err 0x%x\n",uti596_softc.scb.align_err);
printk("resource_err 0x%x\n",uti596_softc.scb.resource_err );
@@ -2768,5 +2768,5 @@ void printk_time(void){
rtems_time_of_day tm_struct;
rtems_clock_get(RTEMS_CLOCK_GET_TOD, &tm_struct);
- printk("Current time: %d:%d:%d \n", tm_struct.hour, tm_struct.minute, tm_struct.second);
+ printk("Current time: %d:%d:%d \n", tm_struct.hour, tm_struct.minute, tm_struct.second);
}
diff --git a/c/src/lib/libbsp/i386/i386ex/network/uti596.h b/c/src/lib/libbsp/i386/i386ex/network/uti596.h
index 5448362a22..8dc43cf86e 100644
--- a/c/src/lib/libbsp/i386/i386ex/network/uti596.h
+++ b/c/src/lib/libbsp/i386/i386ex/network/uti596.h
@@ -58,13 +58,13 @@ struct enet_statistics{
enum commands {
- CmdNOp = 0,
- CmdSASetup = 1,
- CmdConfigure = 2,
+ CmdNOp = 0,
+ CmdSASetup = 1,
+ CmdConfigure = 2,
CmdMulticastList = 3,
- CmdTx = 4,
- CmdTDR = 5,
- CmdDump = 6,
+ CmdTx = 4,
+ CmdTDR = 5,
+ CmdDump = 6,
CmdDiagnose = 7
};
@@ -142,7 +142,7 @@ struct i596_tbd {
unsigned short size;
unsigned short pad;
struct i596_tbd *next;
- char *data;
+ char *data;
};
/*
@@ -153,7 +153,7 @@ struct i596_rbd {
unsigned short count;
unsigned short offset;
struct i596_rbd *next;
- char *data;
+ char *data;
unsigned short size;
unsigned short pad;
};
@@ -176,10 +176,10 @@ struct i596_rfd {
volatile unsigned short stat;
volatile unsigned short cmd;
struct i596_rfd *next;
- struct i596_rbd *pRbd;
+ struct i596_rbd *pRbd;
unsigned short count;
unsigned short size;
- char data [1532 ];
+ char data [1532 ];
} ;
@@ -228,7 +228,7 @@ struct i596_scb {
};
-/*
+/*
* Intermediate System Control Block
*/
struct i596_iscp {
@@ -253,7 +253,7 @@ struct uti596_softc {
struct i596_set_add set_add;
struct i596_configure set_conf;
struct i596_tdr tdr;
- struct i596_nop nop;
+ struct i596_nop nop;
unsigned long stat;
struct tx_cmd *pTxCmd;
struct i596_tbd *pTbd;
diff --git a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h b/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
index 8c2c5caeff..a62f08f425 100644
--- a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
+++ b/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
@@ -8,7 +8,7 @@
* 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$
*/
diff --git a/c/src/lib/libbsp/i386/i386ex/start/start.S b/c/src/lib/libbsp/i386/i386ex/start/start.S
index 1e32e33718..999c161b9b 100644
--- a/c/src/lib/libbsp/i386/i386ex/start/start.S
+++ b/c/src/lib/libbsp/i386/i386ex/start/start.S
@@ -2,14 +2,14 @@
* This file is the main boot and configuration file for the i386ex. It is
* solely responsible for initializing the internal register set to reflect
* the proper board configuration. This version is the "generic" i386ex
- * startup:
+ * startup:
*
* 1) 512K flask ROM @3f80000
* 2) 1 Mb RAM @ 0x0
* 3) Timer0 used as RTEMS clock ticker, 1 msec tick rate.
* 4) READY# is generated by CPU
*
- * The file is a multi-section file, with sections as follows:
+ * The file is a multi-section file, with sections as follows:
* 1) interrupt gates, in section "ints"
* 2) interrupt descriptor table, in section "idt"
* 3) global descriptor table, in section "gdt"
@@ -28,11 +28,11 @@
*
* $Id$
-
-changes:
+
+changes:
SetExRegByte(ICW3S , 0x02 ) # MUST be 0x02 according to intel
SetExRegByte(ICW3M , 0x04 ) # IR2 is cascaded internally: was 0x02 => IR1 is cascaded
-
+
*/
@@ -43,56 +43,56 @@ changes:
/*
* NEW_GAS Needed for binutils 2.9.1.0.7 and higher
- */
+ */
- EXTERN (boot_card) /* exits to bspstart */
+ EXTERN (boot_card) /* exits to bspstart */
EXTERN (stack_start) /* defined in startup/linkcmds */
EXTERN (Clock_exit)
PUBLIC (Interrupt_descriptor_table)
PUBLIC ( SYM(IDTR) )
/* PUBLIC( SYM(_initInternalRegisters) ) */
-
-BEGIN_DATA
+
+BEGIN_DATA
SYM(IDTR): DESC3( SYM(Interrupt_descriptor_table), 0x07ff );
-
+
SYM(Interrupt_descriptor_table): /* Now in data section */
.rept 256
.word 0,0,0,0
.endr
-END_DATA
-
+END_DATA
+
BEGIN_DATA
PUBLIC (_Global_descriptor_table)
-
+
SYM(GDTR): DESC3( GDT_TABLE, 0x1f ); # one less than the size
-SYM (_Global_descriptor_table):
+SYM (_Global_descriptor_table):
SYM(GDT_TABLE): DESC2(0,0,0,0,0,0);
-SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
+SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
SYM(GDT_CODE): DESC2(0xffff,0,0x0,0x9B,0xDF,0x00);
SYM(GDT_DATA): DESC2(0xffff,0,0x0,0x92,0xDF,0x00); # was CF
SYM(GDT_END):
END_DATA
-
+
/* This section is the section that is used by the interrupt
descriptor table. It is used to provide the IDT with the
correct vector offsets. It is for symbol definition only.
*/
-
+
.code16
.section .reset, "ax"
- PUBLIC ( SYM(reset) )
+ PUBLIC ( SYM(reset) )
SYM(reset):
nop
cli
-#ifdef NEW_GAS
+#ifdef NEW_GAS
data32 addr32 jmp SYM(_initInternalRegisters) /* different section in this file */
#else
jmp SYM(_initInternalRegisters) /* different section in this file */
-#endif
+#endif
/* .code32 in case this section moves */
nop /* required by CHIP LAB to pad out size */
nop
@@ -105,27 +105,27 @@ SYM(reset):
nop
nop
nop
-
+
.section .initial, "ax"
/* nop */ /* required for linker -- initial jump is to "label - 2" */
- /* nop */ /* ie. _initInternalRegisters -2 ( which now == .initial ) */
+ /* nop */ /* ie. _initInternalRegisters -2 ( which now == .initial ) */
/*
* Enable access to peripheral register at expanded I/O addresses
*/
-SYM(_initInternalRegisters):
+SYM(_initInternalRegisters):
/* .code16 */
- movw $0x8000 , ax
+ movw $0x8000 , ax
outb al , $REMAPCFGH
xchg al , ah
outb al,$REMAPCFGL
outw ax, $REMAPCFG ;
/*
* Configure operation of the A20 Address Line
- */
+ */
SYM(A20):
movw $PORT92 , dx
-
+
inb dx , al # clear A20 port reset
andb $0xfe , al # b0 Fast Reset(0)=disabled,(1)=reset triggered
orb $0x02 , al # Bit 1 Fast A20 = 0 (always 0) else enabled.
@@ -135,11 +135,11 @@ SYM(A20):
SYM(Watchdog):
movw $WDTSTATUS , dx # address the WDT status port
inb dx , al # get the WDT status
- orb $0x01 , al # set the CLKDIS bit
+ orb $0x01 , al # set the CLKDIS bit
outb al , dx # disable the clock to the WDT
/*
- * Initialize Refresh Control Unit for:
+ * Initialize Refresh Control Unit for:
* Refresh Address = 0x0000
* Refresh gate between rows is 15.6 uSec
@@ -148,20 +148,20 @@ SYM(Watchdog):
* The refresh pin is not used.
*/
-SYM(InitRCU):
+SYM(InitRCU):
SetExRegWord( RFSCIR , 390) # refresh interval was 390, tried 312
SetExRegWord( RFSBAD , 0x0) # base address
SetExRegWord( RFSADD , 0x0) # address register
SetExRegWord( RFSCON , 0x8000) # enable bit
/*
- * Initialize clock and power mgmt unit for:
+ * Initialize clock and power mgmt unit for:
* Clock Frequency = 50 Mhz
* Prescaled clock output = 1 Mhz
* Normal halt instructions
*/
-
-SYM(InitClk):
+
+SYM(InitClk):
SetExRegByte( PWRCON, 0x0 )
SetExRegWord( CLKPRS, 0x17) # 0x13 for 1.19318 MHz. 0x17 for 1MHz.
@@ -170,7 +170,7 @@ SYM(InitClk):
*************************************************************/
/*
- * Initialize I/O port 1 for:
+ * Initialize I/O port 1 for:
* PIN 0 = 1, DCD0# to package pin
* PIN 1 = 1, RTS0# to package pin
* PIN 2 = 1, DTR0# to package pin
@@ -181,15 +181,15 @@ SYM(InitClk):
* PIN 7 = 0, Outport (P17_HOLD to 386ex option header JP7 pin 3)
*/
-SYM(InitPort1):
+SYM(InitPort1):
SetExRegByte( P1LTC , 0xff )
SetExRegByte( P1DIR , 0x0 )
SetExRegByte( P1CFG , 0x1f)
-
+
/*
- * Initialize I/O port 2 for:
- * PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
- * PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
+ * Initialize I/O port 2 for:
+ * PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
+ * PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
* PIN 2 = 1, CS2# (SMRAM) If not using CS2 can be configured as.?
* PIN 3 = 0, Outport ( no connect )
* PIN 4 = 1, CS#4 (DRAM)
@@ -197,34 +197,34 @@ SYM(InitPort1):
* PIN 6 = 1, TXD0 output.
* PIN 7 = 1, CTS0# input.
*/
-
-SYM(InitPort2):
+
+SYM(InitPort2):
SetExRegByte( P2LTC , 0xff )
SetExRegByte( P2DIR , 0x0 )
SetExRegByte( P2CFG , 0xfe)
-
+
/*
- * Initialize I/O port 3 P3CFG
+ * Initialize I/O port 3 P3CFG
* PIN 0 = 1, TMROUT0 to package pin
- * PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
- * PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
- * PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
- * PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
- * PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
+ * PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
+ * PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
+ * PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
+ * PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
+ * PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
* PIN 6 = 0, Inport (Debugger Break P3.6/PWRD to package pin )
* P3.6 selected
* PIN 7 = 0, COMCLK output disabled, 1.8432 Mhz OSC1 oscillator.
* ( Debbugger uses COMCLK as the clocking source )
* P3.7 connected to package pin.
*/
-
-SYM(InitPort3):
+
+SYM(InitPort3):
SetExRegByte( P3LTC , 0xff )
SetExRegByte( P3DIR , 0x41 )
SetExRegByte( P3CFG , 0x09 ) # can check TMROUT0
/*
- * Initialize Peripheral Pin Configurations:
- * PIN 0 = 1, RTS1# to package pin
+ * Initialize Peripheral Pin Configurations:
+ * PIN 0 = 1, RTS1# to package pin
* PIN 1 = 1, DTR1# to package pin
* PIN 2 = 1, TXD1 out to package pin
* PIN 3 = 0, EOP#/TC
@@ -233,20 +233,20 @@ SYM(InitPort3):
* PIN 6 = 0, 0 => CS6# connected to package pin
* PIN 7 = 0, Don't care
*/
-
-SYM(InitPeriph):
- SetExRegByte( PINCFG , 0x24)
-
+
+SYM(InitPeriph):
+ SetExRegByte( PINCFG , 0x24)
+
/*
- * Initialize the Asynchronous Serial Ports:
+ * Initialize the Asynchronous Serial Ports:
* BIT 7 = 1, Internal SIO1 modem signals
* BIT 6 = 1, Internal SIO0 modem signals
* BIT 2 = 0, PSCLK for SSIO clock
- * BIT 1 = 1, SERCLK for SIO1 clock
+ * BIT 1 = 1, SERCLK for SIO1 clock
* BIT 0 = 1, SERCLK for SIO0 clock
*/
-SYM(InitSIO):
+SYM(InitSIO):
SetExRegByte( SIOCFG, 0xC3 ) # SIOn clocked internally
SetExRegByte( LCR0, 0x80 ) # latch DLL0, DLH0
@@ -255,48 +255,48 @@ SYM(InitSIO):
SetExRegByte( LCR0, 0x03 ) # enable r/w buffers, IER0 accessible
# mode 8-n-1
SetExRegByte( IER0, 0x00 ) # was 0x0f All interrupts detected
-
- SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
+
+ SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
SetExRegByte( DLL1, 0x51 ) # 0x51 set to 9600 baud, 0x7 = 115200
SetExRegByte( DLH1, 0x00 ) # 0x145 is 2400 baud
SetExRegByte( LCR1, 0x03 ) # enable r/w buffers, IER1 accessible
# reg 8-n-1
SetExRegByte( IER1, 0x00 ) # was 0x0f - All interrupts detected
-SYM(InitMCR):
+SYM(InitMCR):
/*
- * Initialize Timer for:
+ * Initialize Timer for:
* BIT 7 = 1, Timer clocks disabled
* BIT 6 = 0, Reserved
* BIT 5 = 1, TMRCLK2 instead of Vcc to Gate2
* BIT 4 = 0, PSCLK to CLK2
* BIT 3 = 1, TMRCLK1 instead of Vcc to Gate1
* BIT 2 = 0, PSCLK to Gate1
- * BIT 1 = 0, Vcc to Gate0
+ * BIT 1 = 0, Vcc to Gate0
* BIT 0 = 0, PSCLK to Gate0
*/
-SYM(InitTimer):
- SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
+SYM(InitTimer):
+ SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
# and 2 are set to Vcc
SetExRegByte(TMRCON , 0x34 ) # prepare to write counter 0 LSB,MSB
SetExRegByte(TMR0 , 0x00 ) # sfa
- SetExRegByte(TMR0 , 0x00 ) # sfa
+ SetExRegByte(TMR0 , 0x00 ) # sfa
+
-
SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc
- SetExRegByte(TMR1 , 0x00 ) # sfa
SetExRegByte(TMR1 , 0x00 ) # sfa
-
+ SetExRegByte(TMR1 , 0x00 ) # sfa
+
SetExRegByte(TMRCON , 0xB0 ) # mode 0 disables on gate =Vcc
- SetExRegByte(TMR2 , 0x00 ) #
- SetExRegByte(TMR2 , 0x00 ) #
+ SetExRegByte(TMR2 , 0x00 ) #
+ SetExRegByte(TMR2 , 0x00 ) #
SetExRegByte(TMRCFG , 0x80 ) # Enable = 0x00
/*
- * Initialize the DMACFG register for:
+ * Initialize the DMACFG register for:
* BIT 7 = 1 , Disable DACK#1
* BITs 6:4 = 100, TMROUT2 connected to DRQ1
* BIT 3 = 1 , Disable DACK0#
@@ -316,17 +316,17 @@ SYM(InitTimer):
*/
SYM(InitInt):
-
+
cli # !
/* SetExRegByte(OCW3S, 0x20) # address the Slave status port
- movw $OCW3S , dx
+ movw $OCW3S , dx
inb dx , al # Read the IRR.
- SetExRegByte(OCW3M, 0x20) # address the Master status port
- movw $OCW3M , dx
+ SetExRegByte(OCW3M, 0x20) # address the Master status port
+ movw $OCW3M , dx
inb dx , al # Read the IRR.
-*/
-
+*/
+
SetExRegByte(ICW1S , 0x11 ) # EDGE TRIGGERED
SetExRegByte(ICW2S , 0x28 ) # Slave base vector after Master
SetExRegByte(ICW3S , 0x02 ) # slave cascaded to IR2 on master
@@ -336,65 +336,65 @@ SYM(InitInt):
SetExRegByte(ICW2M , 0x20 ) # base vector starts at byte 32
SetExRegByte(ICW3M , 0x04) # IR2 is cascaded internally
SetExRegByte(ICW4M , 0x01 ) # fully nested mode
-
- SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe.
+
+ SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe.
# for IR5 and IR0 active use 0xde
# for IR0 and IR2 use 0xfa
SetExRegByte(INTCFG , 0x00 )
-
-
-SYM(SetCS4):
+
+
+SYM(SetCS4):
SetExRegWord(CS4ADL , 0x702) #Configure chip select 4
SetExRegWord(CS4ADH , 0x00)
- SetExRegWord(CS4MSKH, 0x03F)
- SetExRegWord(CS4MSKL, 0xFC01)
+ SetExRegWord(CS4MSKH, 0x03F)
+ SetExRegWord(CS4MSKL, 0xFC01)
-SYM(SetUCS1):
+SYM(SetUCS1):
SetExRegWord(UCSADL , 0x0304) # 512K block starting at 0x80000 until 0x3f80000
SetExRegWord(UCSADH , 0x03F8)
- SetExRegWord(UCSMSKH, 0x03F7)
+ SetExRegWord(UCSMSKH, 0x03F7)
SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
/******************************************************
* The GDT must be in RAM since it must be writeable,
* So, move the whole data section down.
********************************************************/
-
+
movw $ _ram_data_offset , di
- movw $ _ram_data_segment, cx
+ movw $ _ram_data_segment, cx
mov cx , es
- movw $ _data_size , cx
- movw $ _rom_data_segment, ax
- movw $ _rom_data_offset , si
+ movw $ _data_size , cx
+ movw $ _rom_data_segment, ax
+ movw $ _rom_data_offset , si
mov ax , ds
-
+
repne
movsb
-
+
/*****************************
* Load the Global Descriptor
* Table Register
****************************/
-
-#ifdef NEW_GAS
+
+#ifdef NEW_GAS
data32 addr32 lgdt SYM(GDTR) # location of GDT
#else
lgdt SYM(GDTR) # location of GDT
-#endif
+#endif
+
-
-SYM(SetUCS):
- SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
+SYM(SetUCS):
+ SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
SetExRegWord(UCSADH, 0x03f8)
- SetExRegWord(UCSMSKH, 0x0007)
+ SetExRegWord(UCSMSKH, 0x0007)
SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
-
+
/*
* SRAM chip select: 16 bit bus size,starting 16Mb, size 512k,
* 4 waits
*/
-
+
#ifdef UT_I386EX
SYM(SetCS1):
@@ -411,7 +411,7 @@ SYM(SetCS2):
/*
* Real-time clock: 8 bit bus size, starting@16Mb+512K, size 32k
- * 4 waits
+ * 4 waits
*/
SYM(SetCS3):
SetExRegWord(CS3ADL, 0x0504)
@@ -427,25 +427,25 @@ SYM(SetCS3):
mov cr0, eax
orw $0x1, ax
mov eax, cr0
-
+
/**************************
* Flush prefetch queue,
* and load CS selector
*********************/
ljmpl $ GDT_CODE_PTR , $ SYM(_load_segment_registers) # sets the code selector
-
+
/*
* Load the segment registers
*/
-SYM(_load_segment_registers):
+SYM(_load_segment_registers):
.code32
pLOAD_SEGMENT( GDT_DATA_PTR, fs)
pLOAD_SEGMENT( GDT_DATA_PTR, gs)
pLOAD_SEGMENT( GDT_DATA_PTR, ss)
pLOAD_SEGMENT( GDT_DATA_PTR, ds)
pLOAD_SEGMENT( GDT_DATA_PTR, es)
-
+
/*
* Set up the stack
*/
@@ -481,7 +481,7 @@ SYM (zero_bss):
pushl $0 # argc
movw $0xFFFB, SYM(i8259s_cache) # ICU mask values reflect
- # initial ICU state
+ # initial ICU state
call SYM(boot_card)
addl $12,esp
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
index 088796bdc5..bfb7b9cf99 100644
--- a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
@@ -13,10 +13,10 @@
*
* Ported to the i386ex and submitted by:
*
- * Erik Ivanenko
+ * Erik Ivanenko
* University of Toronto
* erik.ivanenko@utoronto.ca
- *
+ *
* $Id$
*/
@@ -46,7 +46,7 @@ extern uint32_t rdb_start;
/*
* Use the shared implementations of the following routines
*/
-
+
void bsp_postdriver_hook(void);
void bsp_libc_init( void *, uint32_t, int );
@@ -63,7 +63,7 @@ void bsp_libc_init( void *, uint32_t, int );
* not yet initialized.
*
*/
-
+
void bsp_pretasking_hook(void)
{
extern int heap_bottom;
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timer.c b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
index 555676e5e1..cf6e87d144 100644
--- a/c/src/lib/libbsp/i386/i386ex/timer/timer.c
+++ b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
@@ -48,7 +48,7 @@ void TimerOn(const rtems_raw_irq_connect_data* used)
outport_byte ( TMRCON , 0xb0 ); /* select tmr2, stay in mode 0 */
outport_byte ( TMR1 , 0xfa ); /* set to 250 usec interval */
outport_byte ( TMR1 , 0x00 );
- outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
+ outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
/* interrupts ARE enabled */
/* outport_byte( IERA, 0x41 ); enable interrupt */
/*
@@ -116,7 +116,7 @@ int Read_timer()
/* outport_byte( TBCR, 0x00 ); stop the timer -- not needed on intel */
outport_byte ( TMRCON, 0x40 ); /* latch the count */
- inport_byte ( TMR1, clicks ); /* read the count */
+ inport_byte ( TMR1, clicks ); /* read the count */
total = Ttimer_val + 250 - clicks;
diff --git a/c/src/lib/libbsp/i386/pc386/3c509/3c509.c b/c/src/lib/libbsp/i386/pc386/3c509/3c509.c
index 07feea0255..cf06a85916 100644
--- a/c/src/lib/libbsp/i386/pc386/3c509/3c509.c
+++ b/c/src/lib/libbsp/i386/pc386/3c509/3c509.c
@@ -6,7 +6,7 @@
* e-mail: rdasilva@connecttel.com
*
* MODULE DESCRIPTION:
- * RTEMS driver for 3COM 3C509 Ethernet Card.
+ * RTEMS driver for 3COM 3C509 Ethernet Card.
* The driver has been tested on PC with a single network card.
*
*
@@ -54,10 +54,13 @@
* Saskatoon, Saskatchewan, CANADA
* eric@skatter.usask.ca
*******************************************************************************
- *
+ *
*
* MODIFICATION/HISTORY:
* $Log$
+ * Revision 1.2 1999/12/13 21:21:31 joel
+ * Warning removal patch from Philip A. Prindeville <philipp@zembu.com>.
+ *
* Revision 1.1 1999/05/14 16:23:42 joel
* Added 3COM 3C509 driver from Rosimildo DaSilva <rdasilva@connecttel.com>.
*
@@ -140,7 +143,7 @@
* more powerful mechanism for detecting and dealing with multiple types
* of non-fatal conflict. -jkh XXX
*/
-struct isa_device
+struct isa_device
{
int id_id; /* device id */
int id_unit; /* unit number */
@@ -149,7 +152,7 @@ struct isa_device
};
-struct ep_board
+struct ep_board
{
int epb_addr; /* address of this board */
char epb_used; /* was this entry already used for configuring ? */
@@ -163,7 +166,7 @@ struct ep_board
/*
* Ethernet software status per interface.
*/
-struct ep_softc
+struct ep_softc
{
struct arpcom arpcom; /* Ethernet common part */
int ep_io_addr; /* i/o bus address */
@@ -194,7 +197,7 @@ struct ep_softc
static volatile unsigned long overrun;
static volatile unsigned long resend;
static struct ep_softc ep_softc[ NWDDRIVER ];
-static struct isa_device isa_dev[ NWDDRIVER ] =
+static struct isa_device isa_dev[ NWDDRIVER ] =
{
{ 0, /* device id */
0, /* unit number */
@@ -230,7 +233,7 @@ extern void Wait_X_ms( unsigned int timeToWait ); /* timer.c ??? */
/**********************************************************************************
- *
+ *
* DESCRIPTION: Writes a buffer of data to the I/O port. The data is sent to the
* port as 32 bits units( 4 bytes ).
*
@@ -239,7 +242,7 @@ extern void Wait_X_ms( unsigned int timeToWait ); /* timer.c ??? */
**********************************************************************************/
static __inline void outsl( unsigned short io_addr, unsigned char *out_data, int len )
{
- u_long *pl = ( u_long *)out_data;
+ u_long *pl = ( u_long *)out_data;
while( len-- )
{
outport_long( io_addr, *pl );
@@ -248,7 +251,7 @@ static __inline void outsl( unsigned short io_addr, unsigned char *out_data, int
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Writes a buffer of data to the I/O port. The data is sent to the
* port as 16 bits units( 2 bytes ).
*
@@ -257,7 +260,7 @@ static __inline void outsl( unsigned short io_addr, unsigned char *out_data, int
**********************************************************************************/
static __inline void outsw( unsigned short io_addr, unsigned char *out_data, int len )
{
- u_short *ps = ( u_short *)out_data;
+ u_short *ps = ( u_short *)out_data;
while( len-- )
{
outport_word( io_addr, *ps );
@@ -266,7 +269,7 @@ static __inline void outsw( unsigned short io_addr, unsigned char *out_data, int
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Writes a buffer of data to the I/O port. The data is sent to the
* port as 8 bits units( 1 byte ).
*
@@ -284,7 +287,7 @@ static __inline void outsb( unsigned short io_addr, unsigned char *out_data, int
/**********************************************************************************
- *
+ *
* DESCRIPTION: Read a buffer of data from an I/O port. The data is read as 16 bits
* units or 2 bytes.
*
@@ -293,7 +296,7 @@ static __inline void outsb( unsigned short io_addr, unsigned char *out_data, int
**********************************************************************************/
static __inline void insw( unsigned short io_addr, unsigned char *in_data, int len )
{
- u_short *ps = ( u_short *)in_data;
+ u_short *ps = ( u_short *)in_data;
while( len-- )
{
inport_word( io_addr, *ps );
@@ -302,7 +305,7 @@ static __inline void insw( unsigned short io_addr, unsigned char *in_data, int l
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Read a buffer of data from an I/O port. The data is read as 32 bits
* units or 4 bytes.
*
@@ -311,7 +314,7 @@ static __inline void insw( unsigned short io_addr, unsigned char *in_data, int l
**********************************************************************************/
static __inline void insl( unsigned short io_addr, unsigned char *in_data, int len )
{
- u_long *pl = ( u_long *)in_data;
+ u_long *pl = ( u_long *)in_data;
while( len-- )
{
inport_long( io_addr, *pl );
@@ -320,7 +323,7 @@ static __inline void insl( unsigned short io_addr, unsigned char *in_data, int l
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Read a buffer of data from an I/O port. The data is read as 8 bits
* units or 1 bytes.
*
@@ -337,7 +340,7 @@ static __inline void insb( unsigned short io_addr, unsigned char *in_data, int l
/**********************************************************************************
- *
+ *
* DESCRIPTION: Writes a word to the I/O port.
*
* RETURNS: nothing.
@@ -353,7 +356,7 @@ static __inline void outw( unsigned short io_addr, unsigned short out_data )
/**********************************************************************************
- *
+ *
* DESCRIPTION: Routine to read a word as defined in FreeBSD.
*
* RETURNS: nothing
@@ -367,7 +370,7 @@ static __inline unsigned short inw( unsigned short io_addr )
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Routine to output a word as defined in FreeBSD.
*
* RETURNS: nothing.
@@ -379,7 +382,7 @@ void __inline outb( unsigned short io_addr, unsigned char out_data )
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Routine to read a word as defined in FreeBSD.
*
* RETURNS: byte read.
@@ -394,7 +397,7 @@ static __inline unsigned char inb( unsigned short io_addr )
/**********************************************************************************
- *
+ *
* DESCRIPTION:
* We get eeprom data from the id_port given an offset into the eeprom.
* Basically; after the ID_sequence is sent to all of the cards; they enter
@@ -422,7 +425,7 @@ static int get_eeprom_data( int id_port, int offset )
/**********************************************************************************
- *
+ *
* DESCRIPTION: Waits until the EEPROM of the card is ready to be accessed.
*
* RETURNS: 0 - not ready; 1 - ok
@@ -434,7 +437,7 @@ static int eeprom_rdy( struct ep_softc *sc )
for (i = 0; is_eeprom_busy(BASE) && i < MAX_EEPROMBUSY; i++)
continue;
- if (i >= MAX_EEPROMBUSY)
+ if (i >= MAX_EEPROMBUSY)
{
printf("ep%d: eeprom failed to come ready.\n", sc->unit);
return (0);
@@ -443,9 +446,9 @@ static int eeprom_rdy( struct ep_softc *sc )
}
/**********************************************************************************
- *
+ *
* DESCRIPTION:
- * get_e: gets a 16 bits word from the EEPROM.
+ * get_e: gets a 16 bits word from the EEPROM.
* We must have set the window before call this routine.
*
* RETURNS: data from EEPROM
@@ -463,7 +466,7 @@ u_short get_e( struct ep_softc *sc, int offset )
/**********************************************************************************
- *
+ *
* DESCRIPTION:
* Driver interrupt handler. This routine is called by the RTEMS kernel when this
* interrupt is raised.
@@ -477,14 +480,14 @@ static rtems_isr ap_interrupt_handler( rtems_vector_number v )
/* de-activate any pending interrrupt, and sent and event to interrupt task
* to process all events required by this interrupt.
- */
+ */
outw( BASE + EP_COMMAND, SET_INTR_MASK ); /* disable all Ints */
- rtems_event_send( sc->rxDaemonTid, INTERRUPT_EVENT );
+ rtems_event_send( sc->rxDaemonTid, INTERRUPT_EVENT );
}
/**********************************************************************************
- *
+ *
* DESCRIPTION:
*
* RETURNS:
@@ -496,7 +499,7 @@ static void nopOn(const rtems_irq_connect_data* notUsed)
}
/**********************************************************************************
- *
+ *
* DESCRIPTION:
*
* RETURNS:
@@ -509,7 +512,7 @@ static int _3c509_IsOn(const rtems_irq_connect_data* irq)
/**********************************************************************************
- *
+ *
* DESCRIPTION:
* Initializes the ethernet hardware.
*
@@ -521,15 +524,15 @@ static void _3c509_initialize_hardware (struct ep_softc *sc)
rtems_status_code st;
epinit( sc );
-
+
/*
- * Set up interrupts
+ * Set up interrupts
*/
sc->irqInfo.hdl = ( rtems_irq_hdl )ap_interrupt_handler;
sc->irqInfo.on = nopOn;
sc->irqInfo.off = nopOn;
sc->irqInfo.isOn = _3c509_IsOn;
-
+
printf ("3c509: IRQ with Kernel: %d\n", sc->irqInfo.name );
st = BSP_install_rtems_irq_handler( &sc->irqInfo );
if( !st )
@@ -539,7 +542,7 @@ static void _3c509_initialize_hardware (struct ep_softc *sc)
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Driver interrupt daemon.
*
* RETURNS: nothing.
@@ -561,13 +564,13 @@ static void _3c509_rxDaemon (void *arg)
/* printk( "R+" ); */
ep_intr( dp );
epstart( &dp->arpcom.ac_if );
- }
+ }
printf ("3C509: RX Daemon is finishing.\n");
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Driver transmit daemon
*
* RETURNS:
@@ -578,7 +581,7 @@ static void _3c509_txDaemon (void *arg)
struct ep_softc *sc = (struct ep_softc *)&ep_softc[0];
struct ifnet *ifp = &sc->arpcom.ac_if;
rtems_event_set events;
-
+
printf ("3C509: TX Daemon is starting.\n");
for( ;; )
{
@@ -586,9 +589,9 @@ static void _3c509_txDaemon (void *arg)
* Wait for packet
*/
/* printk( "T-\n" ); */
- rtems_bsdnet_event_receive( START_TRANSMIT_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- RTEMS_NO_TIMEOUT,
+ rtems_bsdnet_event_receive( START_TRANSMIT_EVENT,
+ RTEMS_EVENT_ANY | RTEMS_WAIT,
+ RTEMS_NO_TIMEOUT,
&events );
/* printk( "T+\n" ); */
epstart( ifp );
@@ -600,7 +603,7 @@ static void _3c509_txDaemon (void *arg)
/**********************************************************************************
- *
+ *
* DESCRIPTION: Activates the trabsmitter task...
*
* RETURNS: nothing.
@@ -615,7 +618,7 @@ static void _3c509_start (struct ifnet *ifp)
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Initialize and start the device
*
* RETURNS:
@@ -628,11 +631,11 @@ static void _3c509_init (void *arg)
printf ("3C509: Initialization called.\n");
if (sc->txDaemonTid == 0) {
-
+
/*
* Set up WD hardware
*/
- _3c509_initialize_hardware (sc);
+ _3c509_initialize_hardware (sc);
printf ("3C509: starting network driver tasks..\n");
/*
* Start driver tasks
@@ -648,7 +651,7 @@ static void _3c509_init (void *arg)
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Stop the device
*
* RETURNS:
@@ -679,7 +682,7 @@ static void _3c509_stop (struct ep_softc *sc)
/**********************************************************************************
- *
+ *
* DESCRIPTION: Show interface statistics
*
* RETURNS: nothing.
@@ -697,10 +700,10 @@ static void _3c509_stats (struct ep_softc *sc)
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Driver ioctl handler
*
- * RETURNS:
+ * RETURNS:
*
**********************************************************************************/
static int _3c509_ioctl (struct ifnet *ifp, int command, caddr_t data)
@@ -738,7 +741,7 @@ static int _3c509_ioctl (struct ifnet *ifp, int command, caddr_t data)
case SIO_RTEMS_SHOW_STATS:
_3c509_stats( sc );
break;
-
+
/*
* FIXME: All sorts of multicast commands need to be added here!
*/
@@ -750,7 +753,7 @@ static int _3c509_ioctl (struct ifnet *ifp, int command, caddr_t data)
}
/**********************************************************************************
- *
+ *
* DESCRIPTION:
* Attaches this network driver to the system. This function is called by the network
* interface during the initialization of the system.
@@ -784,7 +787,7 @@ int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *config )
if (ifp->if_softc == NULL)
break;
}
- if (i >= NWDDRIVER)
+ if (i >= NWDDRIVER)
{
printf ("Too many 3C509 drivers.\n");
return 0;
@@ -793,11 +796,11 @@ int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *config )
/*
* Process options
*/
- if( config->hardware_address )
+ if( config->hardware_address )
{
memcpy (sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
}
- else
+ else
{
/* set it to something ... */
memset (sc->arpcom.ac_enaddr, 0x08,ETHER_ADDR_LEN);
@@ -856,11 +859,11 @@ int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *config )
/**********************************************************************************
- *
+ *
* DESCRIPTION:
* This function looks for a 3COM card 3c5x9 in an isa bus. If a board is found, it
* returns a structure describing the caracteristics of the card. It returns zero when
- * card can not be found.
+ * card can not be found.
*
* RETURNS: 0 - fail - could not find a card...
* <> description of the card.
@@ -871,7 +874,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
int data, i, j, id_port = ELINK_ID_PORT;
int count = 0;
- if(ep_current_tag == (EP_LAST_TAG + 1) )
+ if(ep_current_tag == (EP_LAST_TAG + 1) )
{
/* Come here just one time */
ep_current_tag--;
@@ -883,7 +886,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
elink_idseq(0xCF);
elink_reset();
Wait_X_ms( 10 ); /* RPS: assuming delay in miliseconds */
- for (i = 0; i < EP_MAX_BOARDS; i++)
+ for (i = 0; i < EP_MAX_BOARDS; i++)
{
outb(id_port, 0);
outb(id_port, 0);
@@ -923,7 +926,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
ep_current_tag--;
}
ep_board[ep_boards].epb_addr = 0;
- if( count )
+ if( count )
{
printf("%d 3C5x9 board(s) on ISA found at", count);
for (j = 0; ep_board[j].epb_addr; j++)
@@ -943,7 +946,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
*
*/
- if (IS_BASE == -1)
+ if (IS_BASE == -1)
{ /* port? */
for (i = 0; ep_board[i].epb_addr && ep_board[i].epb_used; i++) ;
if (ep_board[i].epb_addr == 0)
@@ -952,15 +955,15 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
IS_BASE = ep_board[i].epb_addr;
ep_board[i].epb_used = 1;
return &ep_board[ i ];
- }
- else
+ }
+ else
{
for (i = 0; ep_board[i].epb_addr && ep_board[i].epb_addr != IS_BASE; i++ ) ;
if (ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE)
return 0;
- if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE)
+ if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE)
{
- printf("ep%d: 3c5x9 at 0x%x in PnP mode. Disable PnP mode!\n",
+ printf("ep%d: 3c5x9 at 0x%x in PnP mode. Disable PnP mode!\n",
is->id_unit, IS_BASE );
}
ep_board[i].epb_used = 1;
@@ -971,7 +974,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
/**********************************************************************************
- *
+ *
* DESCRIPTION:
* This routine checks if there card installed on the machine.
*
@@ -989,7 +992,7 @@ static int ep_isa_probe( struct isa_device *is )
if( (epb = ep_look_for_board_at(is)) == 0 )
return (0);
- sc = &ep_softc[ 0 ];
+ sc = &ep_softc[ 0 ];
sc->ep_io_addr = epb->epb_addr;
sc->epb = epb;
@@ -1001,10 +1004,10 @@ static int ep_isa_probe( struct isa_device *is )
GO_WINDOW(0);
k = sc->epb->prod_id;
#ifdef PC98
- if ((k & 0xf0f0) != (PROD_ID & 0xf0f0))
+ if ((k & 0xf0f0) != (PROD_ID & 0xf0f0))
{
#else
- if ((k & 0xf0ff) != (PROD_ID & 0xf0ff))
+ if ((k & 0xf0ff) != (PROD_ID & 0xf0ff))
{
#endif
printf("ep_isa_probe: ignoring model %04x\n", k );
@@ -1024,7 +1027,7 @@ static int ep_isa_probe( struct isa_device *is )
*
*/
- if (is->id_irq == 0)
+ if (is->id_irq == 0)
{ /* irq? */
is->id_irq = ( k == 2 ) ? 9 : k;
}
@@ -1039,9 +1042,9 @@ static int ep_isa_probe( struct isa_device *is )
/**********************************************************************************
- *
+ *
* DESCRIPTION:
- * This routine attaches this network driver and the network interface routines.
+ * This routine attaches this network driver and the network interface routines.
*
* RETURNS: 0 - failed to attach
* 1 - success
@@ -1055,15 +1058,15 @@ static int ep_isa_attach( struct isa_device *is )
sc->ep_connectors = 0;
config = inw( IS_BASE + EP_W0_CONFIG_CTRL );
- if (config & IS_AUI)
+ if (config & IS_AUI)
{
sc->ep_connectors |= AUI;
}
- if (config & IS_BNC)
+ if (config & IS_BNC)
{
sc->ep_connectors |= BNC;
}
- if (config & IS_UTP)
+ if (config & IS_UTP)
{
sc->ep_connectors |= UTP;
}
@@ -1082,7 +1085,7 @@ static int ep_isa_attach( struct isa_device *is )
GO_WINDOW( 0 );
SET_IRQ( BASE, irq );
- printf( "3C509: I/O=0x%x, IRQ=%d, CONNECTOR=%s, ",
+ printf( "3C509: I/O=0x%x, IRQ=%d, CONNECTOR=%s, ",
sc->ep_io_addr, sc->irqInfo.name,ep_conn_type[ sc->ep_connector ] );
ep_attach( sc );
@@ -1090,7 +1093,7 @@ static int ep_isa_attach( struct isa_device *is )
}
/**********************************************************************************
- *
+ *
* DESCRIPTION: Completes the initialization/attachement of the driver.
*
* RETURNS: 0 - ok.
@@ -1100,21 +1103,21 @@ static int ep_attach( struct ep_softc *sc )
{
u_short *p;
int i;
-
+
/*
* Setup the station address
*/
p = (u_short *) &sc->arpcom.ac_enaddr;
GO_WINDOW(2);
printf("ADDRESS=" );
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++)
{
p[i] = htons( sc->epb->eth_addr[i] );
outw( BASE + EP_W2_ADDR_0 + (i * 2), ntohs( p[i] ) );
printf("%04x ", (u_short)ntohs( p[i] ) );
}
printf("\n" );
-
+
sc->rx_no_first = sc->rx_no_mbuf =
sc->rx_bpf_disc = sc->rx_overrunf = sc->rx_overrunl =
sc->tx_underrun = 0;
@@ -1126,7 +1129,7 @@ static int ep_attach( struct ep_softc *sc )
/**********************************************************************************
- *
+ *
* DESCRIPTION:
* Initializes the card.
* The order in here seems important. Otherwise we may not receive interrupts. ?!
@@ -1199,19 +1202,19 @@ static void epinit( struct ep_softc *sc )
*/
/* Set the xcvr. */
- if (ifp->if_flags & IFF_LINK0 && sc->ep_connectors & AUI)
+ if (ifp->if_flags & IFF_LINK0 && sc->ep_connectors & AUI)
{
i = ACF_CONNECTOR_AUI;
- }
- else if (ifp->if_flags & IFF_LINK1 && sc->ep_connectors & BNC)
+ }
+ else if (ifp->if_flags & IFF_LINK1 && sc->ep_connectors & BNC)
{
i = ACF_CONNECTOR_BNC;
- }
- else if (ifp->if_flags & IFF_LINK2 && sc->ep_connectors & UTP)
+ }
+ else if (ifp->if_flags & IFF_LINK2 && sc->ep_connectors & UTP)
{
i = ACF_CONNECTOR_UTP;
- }
- else
+ }
+ else
{
i = sc->ep_connector;
}
@@ -1219,10 +1222,10 @@ static void epinit( struct ep_softc *sc )
j = inw(BASE + EP_W0_ADDRESS_CFG) & 0x3fff;
outw(BASE + EP_W0_ADDRESS_CFG, j | (i << ACF_CONNECTOR_BITS));
- switch(i)
+ switch(i)
{
case ACF_CONNECTOR_UTP:
- if (sc->ep_connectors & UTP)
+ if (sc->ep_connectors & UTP)
{
GO_WINDOW(4);
outw(BASE + EP_W4_MEDIA_TYPE, ENABLE_UTP);
@@ -1230,7 +1233,7 @@ static void epinit( struct ep_softc *sc )
break;
case ACF_CONNECTOR_BNC:
- if (sc->ep_connectors & BNC)
+ if (sc->ep_connectors & BNC)
{
outw(BASE + EP_COMMAND, START_TRANSCEIVER);
Wait_X_ms( 1 );
@@ -1258,7 +1261,7 @@ static void epinit( struct ep_softc *sc )
sc->tx_underrun = 0;
ep_fset(F_RX_FIRST);
- if( sc->top )
+ if( sc->top )
{
m_freem( sc->top );
sc->top = sc->mcur = 0;
@@ -1279,7 +1282,7 @@ static void epinit( struct ep_softc *sc )
static const char padmap[] = {0, 3, 2, 1};
/**********************************************************************************
- *
+ *
* DESCRIPTION: Routine to transmit frames to the card.
*
* RETURNS: nothing.
@@ -1293,14 +1296,14 @@ static void epstart( struct ifnet *ifp )
struct mbuf *top;
int pad;
- while( inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS )
+ while( inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS )
;
startagain:
/* printk( "S-" ); */
/* Sneak a peek at the next packet */
m = ifp->if_snd.ifq_head;
- if (m == 0)
+ if (m == 0)
{
ifp->if_flags &= ~IFF_OACTIVE;
return;
@@ -1316,7 +1319,7 @@ startagain:
* but we drop packets that are too large. Perhaps we should truncate
* them instead?
*/
- if( len + pad > ETHER_MAX_LEN )
+ if( len + pad > ETHER_MAX_LEN )
{
/* packet is obviously too large: toss it */
++ifp->if_oerrors;
@@ -1324,30 +1327,30 @@ startagain:
m_freem( m );
goto readcheck;
}
- if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
+ if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
{
/* no room in FIFO */
outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | (len + pad + 4));
/* make sure */
- if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
+ if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
{
ifp->if_flags |= IFF_OACTIVE;
return;
}
}
IF_DEQUEUE( &ifp->if_snd, m );
- outw(BASE + EP_W1_TX_PIO_WR_1, len);
+ outw(BASE + EP_W1_TX_PIO_WR_1, len);
outw(BASE + EP_W1_TX_PIO_WR_1, 0x0); /* Second dword meaningless */
for (top = m; m != 0; m = m->m_next)
{
- if( ep_ftst(F_ACCESS_32_BITS ) )
+ if( ep_ftst(F_ACCESS_32_BITS ) )
{
outsl( BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 4 );
if( m->m_len & 3 )
outsb(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t) + (m->m_len & (~3)), m->m_len & 3 );
- }
- else
+ }
+ else
{
outsw( BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 2 );
if( m->m_len & 1 )
@@ -1368,13 +1371,13 @@ startagain:
* fifo.
*/
readcheck:
- if( inw(BASE + EP_W1_RX_STATUS) & RX_BYTES_MASK )
+ if( inw(BASE + EP_W1_RX_STATUS) & RX_BYTES_MASK )
{
/*
* we check if we have packets left, in that case we prepare to come
* back later
*/
- if( ifp->if_snd.ifq_head )
+ if( ifp->if_snd.ifq_head )
{
outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | 8);
}
@@ -1386,7 +1389,7 @@ readcheck:
/**********************************************************************************
- *
+ *
* DESCRIPTION: Routine to read frames from the card.
*
* RETURNS: nothing.
@@ -1407,10 +1410,10 @@ static void epread( register struct ep_softc *sc )
read_again:
- if (status & ERR_RX)
+ if (status & ERR_RX)
{
++ifp->if_ierrors;
- if( status & ERR_RX_OVERRUN )
+ if( status & ERR_RX_OVERRUN )
{
/*
* we can think the rx latency is actually greather than we
@@ -1426,7 +1429,7 @@ read_again:
}
rx_fifo = rx_fifo2 = status & RX_BYTES_MASK;
- if( ep_ftst( F_RX_FIRST ) )
+ if( ep_ftst( F_RX_FIRST ) )
{
MGETHDR( m, M_DONTWAIT, MT_DATA );
if( !m )
@@ -1443,8 +1446,8 @@ read_again:
top->m_len = sizeof(struct ether_header);
rx_fifo -= sizeof(struct ether_header);
sc->cur_len = rx_fifo2;
- }
- else
+ }
+ else
{
/* come here if we didn't have a complete packet last time */
top = sc->top;
@@ -1453,10 +1456,10 @@ read_again:
}
/* Reads what is left in the RX FIFO */
- while (rx_fifo > 0)
+ while (rx_fifo > 0)
{
lenthisone = min( rx_fifo, M_TRAILINGSPACE(m) );
- if( lenthisone == 0 )
+ if( lenthisone == 0 )
{ /* no room in this one */
mcur = m;
MGET(m, M_WAIT, MT_DATA);
@@ -1468,15 +1471,15 @@ read_again:
mcur->m_next = m;
lenthisone = min(rx_fifo, M_TRAILINGSPACE(m));
}
- if( ep_ftst( F_ACCESS_32_BITS ) )
+ if( ep_ftst( F_ACCESS_32_BITS ) )
{ /* default for EISA configured cards*/
insl( BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len, lenthisone / 4);
m->m_len += (lenthisone & ~3);
if (lenthisone & 3)
insb(BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len, lenthisone & 3);
m->m_len += (lenthisone & 3);
- }
- else
+ }
+ else
{
insw(BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len, lenthisone / 2);
m->m_len += lenthisone;
@@ -1486,12 +1489,12 @@ read_again:
rx_fifo -= lenthisone;
}
- if( status & ERR_RX_INCOMPLETE)
+ if( status & ERR_RX_INCOMPLETE)
{ /* we haven't received the complete packet */
sc->mcur = m;
sc->rx_no_first++; /* to know how often we come here */
ep_frst( F_RX_FIRST );
- if( !((status = inw(BASE + EP_W1_RX_STATUS)) & ERR_RX_INCOMPLETE) )
+ if( !((status = inw(BASE + EP_W1_RX_STATUS)) & ERR_RX_INCOMPLETE) )
{
/* we see if by now, the packet has completly arrived */
goto read_again;
@@ -1516,7 +1519,7 @@ read_again:
out:
outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK);
- if (sc->top)
+ if (sc->top)
{
m_freem(sc->top);
sc->top = 0;
@@ -1530,10 +1533,10 @@ out:
/**********************************************************************************
- *
- * DESCRIPTION:
- * This routine handles interrupts. It is called from the "RX" task whenever
- * the ISR post an event to the task.
+ *
+ * DESCRIPTION:
+ * This routine handles interrupts. It is called from the "RX" task whenever
+ * the ISR post an event to the task.
* This is basically the "isr" from the FreeBSD driver.
*
* RETURNS: nothing.
@@ -1548,17 +1551,17 @@ static void ep_intr( struct ep_softc *sc )
rescan:
/* printk( "I-" ); */
- while( ( status = inw(BASE + EP_STATUS)) & S_5_INTS )
+ while( ( status = inw(BASE + EP_STATUS)) & S_5_INTS )
{
/* first acknowledge all interrupt sources */
outw( BASE + EP_COMMAND, ACK_INTR | ( status & S_MASK ) );
- if( status & ( S_RX_COMPLETE | S_RX_EARLY ) )
+ if( status & ( S_RX_COMPLETE | S_RX_EARLY ) )
{
epread( sc );
continue;
}
- if (status & S_TX_AVAIL)
+ if (status & S_TX_AVAIL)
{
/* we need ACK */
ifp->if_timer = 0;
@@ -1567,7 +1570,7 @@ rescan:
inw(BASE + EP_W1_FREE_TX);
epstart(ifp);
}
- if (status & S_CARD_FAILURE)
+ if (status & S_CARD_FAILURE)
{
ifp->if_timer = 0;
printf("\nep%d:\n\tStatus: %x\n", sc->unit, status);
@@ -1584,7 +1587,7 @@ rescan:
epinit(sc);
return;
}
- if (status & S_TX_COMPLETE)
+ if (status & S_TX_COMPLETE)
{
ifp->if_timer = 0;
/* we need ACK. we do it at the end */
@@ -1592,18 +1595,18 @@ rescan:
* We need to read TX_STATUS until we get a 0 status in order to
* turn off the interrupt flag.
*/
- while ((status = inb(BASE + EP_W1_TX_STATUS)) & TXS_COMPLETE)
+ while ((status = inb(BASE + EP_W1_TX_STATUS)) & TXS_COMPLETE)
{
if (status & TXS_SUCCES_INTR_REQ)
;
- else if( status & (TXS_UNDERRUN | TXS_JABBER | TXS_MAX_COLLISION ) )
+ else if( status & (TXS_UNDERRUN | TXS_JABBER | TXS_MAX_COLLISION ) )
{
outw(BASE + EP_COMMAND, TX_RESET);
- if (status & TXS_UNDERRUN)
+ if (status & TXS_UNDERRUN)
{
sc->tx_underrun++;
- }
- else
+ }
+ else
{
if( status & TXS_JABBER )
;
@@ -1616,7 +1619,7 @@ rescan:
* To have a tx_avail_int but giving the chance to the
* Reception
*/
- if( ifp->if_snd.ifq_head )
+ if( ifp->if_snd.ifq_head )
{
outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | 8);
}
@@ -1632,7 +1635,7 @@ rescan:
outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */
if( (status = inw(BASE + EP_STATUS) ) & S_5_INTS )
goto rescan;
-
+
/* re-enable Ints */
outw( BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS );
/* printk( "I+" ); */
diff --git a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
index 9fa7acbd33..a1b1899dc9 100644
--- a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
+++ b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
@@ -64,7 +64,7 @@ rtems_device_minor_number rtems_clock_minor;
| Description: Interrupt Service Routine for clock (0h) interruption.
| Global Variables: Clock_driver_ticks, Clock_isrs.
| Arguments: vector - standard RTEMS argument - see documentation.
-| Returns: standard return value - see documentation.
+| Returns: standard return value - see documentation.
+--------------------------------------------------------------------------*/
static void clockIsr()
{
@@ -99,7 +99,7 @@ static void clockIsr()
| not really necessary, since there will be a reset at exit.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void clockOff(const rtems_irq_connect_data* unused)
{
@@ -115,7 +115,7 @@ void clockOff(const rtems_irq_connect_data* unused)
| Description: Initialize and install clock interrupt handler.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
static void clockOn(const rtems_irq_connect_data* unused)
{
@@ -162,9 +162,9 @@ static void clockOn(const rtems_irq_connect_data* unused)
outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
outport_byte(TIMER_CNTR0, count >> 0 & 0xff);
outport_byte(TIMER_CNTR0, count >> 8 & 0xff);
- }
+ }
-}
+}
int clockIsOn(const rtems_irq_connect_data* unused)
{
@@ -176,8 +176,8 @@ static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
clockOn,
clockOff,
clockIsOn};
-
-
+
+
/*-------------------------------------------------------------------------+
| Clock device driver INITIALIZE entry point.
@@ -195,14 +195,14 @@ Clock_initialize(rtems_device_major_number major,
rtems_fatal_error_occurred(1);
}
/* make major/minor avail to others such as shared memory driver */
-
+
rtems_clock_major = major;
rtems_clock_minor = minor;
-
+
return RTEMS_SUCCESSFUL;
} /* Clock_initialize */
-
+
/*-------------------------------------------------------------------------+
| Console device driver CONTROL entry point
+--------------------------------------------------------------------------*/
@@ -214,12 +214,12 @@ Clock_control(rtems_device_major_number major,
if (pargp != NULL)
{
rtems_libio_ioctl_args_t *args = pargp;
-
+
/*-------------------------------------------------------------------------+
| This is hokey, but until we get a defined interface to do this, it will
| just be this simple...
+-------------------------------------------------------------------------*/
-
+
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
clockIsr();
else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
diff --git a/c/src/lib/libbsp/i386/pc386/clock/rtc.c b/c/src/lib/libbsp/i386/pc386/clock/rtc.c
index 401220bf6d..26c4c2056d 100644
--- a/c/src/lib/libbsp/i386/pc386/clock/rtc.c
+++ b/c/src/lib/libbsp/i386/pc386/clock/rtc.c
@@ -79,9 +79,9 @@
| Description: Convert 2 digit number to its BCD representation.
| Global Variables: None.
| Arguments: i - Number to convert.
-| Returns: BCD representation of number.
+| Returns: BCD representation of number.
+--------------------------------------------------------------------------*/
-static inline uint8_t
+static inline uint8_t
bcd(uint8_t i)
{
return ((i / 16) * 10 + (i % 16));
@@ -99,9 +99,9 @@ bcd(uint8_t i)
| Description: Convert years to seconds (since 1970).
| Global Variables: None.
| Arguments: y - year to convert (1970 <= y <= 2100).
-| Returns: number of seconds since 1970.
+| Returns: number of seconds since 1970.
+--------------------------------------------------------------------------*/
-static inline uint32_t
+static inline uint32_t
ytos(uint16_t y)
{ /* v NUM LEAP YEARS v */
return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY);
@@ -113,9 +113,9 @@ ytos(uint16_t y)
| Description: Convert months to seconds since January.
| Global Variables: None.
| Arguments: m - month to convert, leap - is this a month of a leap year.
-| Returns: number of seconds since January.
+| Returns: number of seconds since January.
+--------------------------------------------------------------------------*/
-static inline uint32_t
+static inline uint32_t
mtos(uint8_t m, rtems_boolean leap)
{
static uint16_t daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181,
@@ -132,9 +132,9 @@ mtos(uint8_t m, rtems_boolean leap)
| Description: Perform action on RTC and return its result.
| Global Variables: None.
| Arguments: what - what to write to RTC port (what to do).
-| Returns: result received from RTC port after action performed.
+| Returns: result received from RTC port after action performed.
+--------------------------------------------------------------------------*/
-static inline uint8_t
+static inline uint8_t
rtcin(uint8_t what)
{
uint8_t r;
@@ -153,7 +153,7 @@ rtcin(uint8_t what)
| Description: Initialize real-time clock (RTC).
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
init_rtc(void)
@@ -181,7 +181,7 @@ init_rtc(void)
| Description: Read present time from RTC and return it.
| Global Variables: None.
| Arguments: tod - to return present time in 'rtems_time_of_day' format.
-| Returns: number of seconds from 1970/01/01 corresponding to 'tod'.
+| Returns: number of seconds from 1970/01/01 corresponding to 'tod'.
+--------------------------------------------------------------------------*/
long int
rtc_read(rtems_time_of_day *tod)
@@ -201,7 +201,7 @@ rtc_read(rtems_time_of_day *tod)
sa = rtcin(RTC_STATUSA);
tod->year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
- if (tod->year < 1970) tod->year += 100;
+ if (tod->year < 1970) tod->year += 100;
tod->month = bcd(rtcin(RTC_MONTH)); /* month */
tod->day = bcd(rtcin(RTC_DAY)); /* day */
(void) bcd(rtcin(RTC_WDAY)); /* weekday */
diff --git a/c/src/lib/libbsp/i386/pc386/console/console.c b/c/src/lib/libbsp/i386/pc386/console/console.c
index 7a1ad2dbd6..a0b468e52b 100644
--- a/c/src/lib/libbsp/i386/pc386/console/console.c
+++ b/c/src/lib/libbsp/i386/pc386/console/console.c
@@ -96,7 +96,7 @@ isr_on(const rtems_irq_connect_data *unused)
{
return;
}
-
+
static void
isr_off(const rtems_irq_connect_data *unused)
{
@@ -151,9 +151,9 @@ void __assert (const char *file, int line, const char *msg)
{
static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
unsigned char ch;
-
+
/*
- * Note we cannot call exit or printf from here,
+ * Note we cannot call exit or printf from here,
* assert can fail inside ISR too
*/
@@ -218,13 +218,13 @@ console_initialize(rtems_device_major_number major,
{
/* Install keyboard interrupt handler */
status = BSP_install_rtems_irq_handler(&console_isr_data);
-
+
if (!status)
{
printk("Error installing keyboard interrupt handler!\n");
rtems_fatal_error_occurred(status);
}
-
+
status = rtems_io_register_name("/dev/console", major, 0);
if (status != RTEMS_SUCCESSFUL)
{
@@ -240,14 +240,14 @@ console_initialize(rtems_device_major_number major,
*/
/* 9600-8-N-1 */
BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
-
-
+
+
/* Set interrupt handler */
if(BSPConsolePort == BSP_UART_COM1)
{
console_isr_data.name = BSP_UART_COM1_IRQ;
console_isr_data.hdl = BSP_uart_termios_isr_com1;
-
+
}
else
{
@@ -322,7 +322,7 @@ console_open(rtems_device_major_number major,
void *arg)
{
rtems_status_code status;
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
console_last_close, /* lastClose */
@@ -338,7 +338,7 @@ console_open(rtems_device_major_number major,
{
/* Let's set the routines for termios to poll the
- * Kbd queue for data
+ * Kbd queue for data
*/
cb.pollRead = kbd_poll_read;
cb.outputUsesInterrupts = 0;
@@ -371,9 +371,9 @@ console_open(rtems_device_major_number major,
/*
* Pass data area info down to driver
*/
- BSP_uart_termios_set(BSPConsolePort,
+ BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
-
+
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
@@ -391,7 +391,7 @@ console_close(rtems_device_major_number major,
return rtems_termios_close (arg);
} /* console_close */
-
+
/*-------------------------------------------------------------------------+
| Console device driver READ entry point.
+--------------------------------------------------------------------------+
@@ -404,7 +404,7 @@ console_read(rtems_device_major_number major,
{
return rtems_termios_read( arg );
} /* console_read */
-
+
/*-------------------------------------------------------------------------+
| Console device driver WRITE entry point.
@@ -424,7 +424,7 @@ console_write(rtems_device_major_number major,
{
return rtems_termios_write (arg);
}
-
+
/* write data to VGA */
ibmpc_console_write( minor, buffer, maximum );
rw_args->bytes_moved = maximum;
@@ -433,18 +433,18 @@ console_write(rtems_device_major_number major,
extern int vt_ioctl( unsigned int cmd, unsigned long arg);
-
+
/*
* Handle ioctl request.
*/
-rtems_device_driver
+rtems_device_driver
console_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
rtems_libio_ioctl_args_t *args = arg;
- switch (args->command)
+ switch (args->command)
{
default:
if( vt_ioctl( args->command, (unsigned long)args->buffer ) != 0 )
@@ -469,45 +469,45 @@ conSetAttr(int minor, const struct termios *t)
{
unsigned long baud, databits, parity, stopbits;
- switch (t->c_cflag & CBAUD)
+ switch (t->c_cflag & CBAUD)
{
- case B50:
+ case B50:
baud = 50;
break;
- case B75:
- baud = 75;
+ case B75:
+ baud = 75;
break;
- case B110:
- baud = 110;
+ case B110:
+ baud = 110;
break;
- case B134:
- baud = 134;
+ case B134:
+ baud = 134;
break;
- case B150:
- baud = 150;
+ case B150:
+ baud = 150;
break;
case B200:
- baud = 200;
+ baud = 200;
break;
- case B300:
+ case B300:
baud = 300;
break;
- case B600:
- baud = 600;
+ case B600:
+ baud = 600;
break;
- case B1200:
+ case B1200:
baud = 1200;
break;
- case B1800:
- baud = 1800;
+ case B1800:
+ baud = 1800;
break;
- case B2400:
+ case B2400:
baud = 2400;
break;
- case B4800:
+ case B4800:
baud = 4800;
break;
- case B9600:
+ case B9600:
baud = 9600;
break;
case B19200:
@@ -516,7 +516,7 @@ conSetAttr(int minor, const struct termios *t)
case B38400:
baud = 38400;
break;
- case B57600:
+ case B57600:
baud = 57600;
break;
case B115200:
@@ -542,7 +542,7 @@ conSetAttr(int minor, const struct termios *t)
/* No parity */
parity = 0;
}
-
+
switch (t->c_cflag & CSIZE) {
case CS5: databits = CHR_5_BITS; break;
case CS6: databits = CHR_6_BITS; break;
@@ -569,7 +569,7 @@ conSetAttr(int minor, const struct termios *t)
* BSP initialization
*/
-BSP_output_char_function_type BSP_output_char =
+BSP_output_char_function_type BSP_output_char =
(BSP_output_char_function_type) _IBMPC_outch;
BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
diff --git a/c/src/lib/libbsp/i386/pc386/console/defkeymap.c b/c/src/lib/libbsp/i386/pc386/console/defkeymap.c
index ce5e918fb5..a6bf5103a1 100644
--- a/c/src/lib/libbsp/i386/pc386/console/defkeymap.c
+++ b/c/src/lib/libbsp/i386/pc386/console/defkeymap.c
@@ -154,34 +154,34 @@ unsigned int keymap_count = 7;
*/
char func_buf[] = {
- '\033', '[', '[', 'A', 0,
- '\033', '[', '[', 'B', 0,
- '\033', '[', '[', 'C', 0,
- '\033', '[', '[', 'D', 0,
- '\033', '[', '[', 'E', 0,
- '\033', '[', '1', '7', '~', 0,
- '\033', '[', '1', '8', '~', 0,
- '\033', '[', '1', '9', '~', 0,
- '\033', '[', '2', '0', '~', 0,
- '\033', '[', '2', '1', '~', 0,
- '\033', '[', '2', '3', '~', 0,
- '\033', '[', '2', '4', '~', 0,
- '\033', '[', '2', '5', '~', 0,
- '\033', '[', '2', '6', '~', 0,
- '\033', '[', '2', '8', '~', 0,
- '\033', '[', '2', '9', '~', 0,
- '\033', '[', '3', '1', '~', 0,
- '\033', '[', '3', '2', '~', 0,
- '\033', '[', '3', '3', '~', 0,
- '\033', '[', '3', '4', '~', 0,
- '\033', '[', '1', '~', 0,
- '\033', '[', '2', '~', 0,
- '\033', '[', '3', '~', 0,
- '\033', '[', '4', '~', 0,
- '\033', '[', '5', '~', 0,
- '\033', '[', '6', '~', 0,
- '\033', '[', 'M', 0,
- '\033', '[', 'P', 0,
+ '\033', '[', '[', 'A', 0,
+ '\033', '[', '[', 'B', 0,
+ '\033', '[', '[', 'C', 0,
+ '\033', '[', '[', 'D', 0,
+ '\033', '[', '[', 'E', 0,
+ '\033', '[', '1', '7', '~', 0,
+ '\033', '[', '1', '8', '~', 0,
+ '\033', '[', '1', '9', '~', 0,
+ '\033', '[', '2', '0', '~', 0,
+ '\033', '[', '2', '1', '~', 0,
+ '\033', '[', '2', '3', '~', 0,
+ '\033', '[', '2', '4', '~', 0,
+ '\033', '[', '2', '5', '~', 0,
+ '\033', '[', '2', '6', '~', 0,
+ '\033', '[', '2', '8', '~', 0,
+ '\033', '[', '2', '9', '~', 0,
+ '\033', '[', '3', '1', '~', 0,
+ '\033', '[', '3', '2', '~', 0,
+ '\033', '[', '3', '3', '~', 0,
+ '\033', '[', '3', '4', '~', 0,
+ '\033', '[', '1', '~', 0,
+ '\033', '[', '2', '~', 0,
+ '\033', '[', '3', '~', 0,
+ '\033', '[', '4', '~', 0,
+ '\033', '[', '5', '~', 0,
+ '\033', '[', '6', '~', 0,
+ '\033', '[', 'M', 0,
+ '\033', '[', 'P', 0,
};
char *funcbufptr = func_buf;
diff --git a/c/src/lib/libbsp/i386/pc386/console/fb_vga.c b/c/src/lib/libbsp/i386/pc386/console/fb_vga.c
index 29b840f728..8c678b8081 100644
--- a/c/src/lib/libbsp/i386/pc386/console/fb_vga.c
+++ b/c/src/lib/libbsp/i386/pc386/console/fb_vga.c
@@ -3,14 +3,47 @@
// $Header$
//
// Copyright (c) 2000 - Rosimildo da Silva ( rdasilva@connecttel.com )
-//
+//
// MODULE DESCRIPTION:
-// This module implements the micro FB driver for "Bare VGA". It uses the
+// This module implements the micro FB driver for "Bare VGA". It uses the
// routines for "bare hardware" that comes with MicroWindows.
//
// MODIFICATION/HISTORY:
//
// $Log$
+// Revision 1.1 2000/08/30 08:15:30 joel
+// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
+//
+// * Major rework of the "/dev/console" driver.
+// * Added termios support for stdin ( keyboard ).
+// * Added ioctls() to support modes similar to Linux( XLATE,
+// RAW, MEDIUMRAW ).
+// * Added Keyboard mapping and handling of the keyboard's leds.
+// * Added Micro FrameBuffer driver ( "/dev/fb0" ) for bare VGA
+// controller ( 16 colors ).
+// * Added PS/2 and Serial mouse support for PC386 BSP.
+// * console/defkeymap.c: New file.
+// * console/fb_vga.c: New file.
+// * console/fb_vga.h: New file.
+// * console/i386kbd.h: New file.
+// * console/kd.h: New file.
+// * console/keyboard.c: New file.
+// * console/keyboard.h: New file.
+// * console/mouse_parser.c: New file.
+// * console/mouse_parser.h: New file.
+// * console/pc_keyb.c: New file.
+// * console/ps2_drv.h: New file.
+// * console/ps2_mouse.c: New file.
+// * console/ps2_mouse.h: New file.
+// * console/serial_mouse.c: New file.
+// * console/serial_mouse.h: New file.
+// * console/vgainit.c: New file.
+// * console/vt.c: New file.
+// * console/Makefile.am: Reflect new files.
+// * console/console.c, console/inch.c, console/outch.c: Console
+// functionality modifications.
+// * startup/Makefile.am: Pick up tty_drv.c and gdb_glue.c
+//
//
/////////////////////////////////////////////////////////////////////////////
*/
@@ -28,14 +61,14 @@
/* these routines are defined in the microwindows code. This
driver is here more as an example of how to implement and
- use the micro FB interface
+ use the micro FB interface
*/
extern void ega_hwinit( void );
extern void ega_hwterm( void );
/* screen information for the VGA driver */
-static struct fb_screeninfo fb_info =
+static struct fb_screeninfo fb_info =
{
640, 480, /* screen size x, y */
4, /* bits per pixel */
@@ -109,7 +142,7 @@ fbvga_close(rtems_device_major_number major,
return RTEMS_SUCCESSFUL;
}
-
+
/*
* fbvga device driver READ entry point.
* Read characters from the PS/2 mouse.
@@ -124,7 +157,7 @@ fbvga_read( rtems_device_major_number major,
rw_args->bytes_moved = 0;
return RTEMS_SUCCESSFUL;
}
-
+
/*
* fbvga device driver WRITE entry point.
@@ -187,15 +220,15 @@ static int set_palette( struct fb_cmap *cmap )
* IOCTL entry point -- This method is called to carry
* all services of this interface.
*/
-rtems_device_driver
+rtems_device_driver
fbvga_control( rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
rtems_libio_ioctl_args_t *args = arg;
printk( "FBVGA ioctl called, cmd=%x\n", args->command );
- switch( args->command )
+ switch( args->command )
{
case FB_SCREENINFO:
args->ioctl_return = get_screen_info( args->buffer );
@@ -208,7 +241,7 @@ fbvga_control( rtems_device_major_number major,
break;
/* this function would execute one of the routines of the
- * interface based on the operation requested
+ * interface based on the operation requested
*/
case FB_EXEC_FUNCTION:
{
diff --git a/c/src/lib/libbsp/i386/pc386/console/fb_vga.h b/c/src/lib/libbsp/i386/pc386/console/fb_vga.h
index 6587e7474d..643c892949 100644
--- a/c/src/lib/libbsp/i386/pc386/console/fb_vga.h
+++ b/c/src/lib/libbsp/i386/pc386/console/fb_vga.h
@@ -5,8 +5,8 @@
* $Header$
*
* Copyright (c) 2000 -- Rosimildo da Silva.
- *
- * MODULE DESCRIPTION:
+ *
+ * MODULE DESCRIPTION:
* Prototype routines for the fbvga driver.
*
* by: Rosimildo da Silva:
@@ -16,6 +16,9 @@
* MODIFICATION/HISTORY:
*
* $Log$
+ * Revision 1.2 2004/04/15 13:26:12 ralf
+ * Remove stray white spaces.
+ *
* Revision 1.1 2000/08/30 08:15:30 joel
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
*
diff --git a/c/src/lib/libbsp/i386/pc386/console/i386kbd.h b/c/src/lib/libbsp/i386/pc386/console/i386kbd.h
index 5bd0365ae4..c3fe9463a6 100644
--- a/c/src/lib/libbsp/i386/pc386/console/i386kbd.h
+++ b/c/src/lib/libbsp/i386/pc386/console/i386kbd.h
@@ -183,6 +183,6 @@ extern unsigned char aux_device_present;
but then the read function would need
a lock etc - ick */
-#define mark_bh(x)
+#define mark_bh(x)
#endif /* _I386_KEYBOARD_H */
diff --git a/c/src/lib/libbsp/i386/pc386/console/inch.c b/c/src/lib/libbsp/i386/pc386/console/inch.c
index 7997a6b246..264b0ae0a4 100644
--- a/c/src/lib/libbsp/i386/pc386/console/inch.c
+++ b/c/src/lib/libbsp/i386/pc386/console/inch.c
@@ -64,7 +64,7 @@ static char shift_map[] =
'*',0x80,' ',0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,'7','8','9',0x80,'4','5','6',0x80,
'1','2','3','0',177
-}; /* Keyboard scancode -> character map with SHIFT key modifier. */
+}; /* Keyboard scancode -> character map with SHIFT key modifier. */
static unsigned short kbd_buffer[KBD_BUF_SIZE];
@@ -175,7 +175,7 @@ _IBMPC_scankey(char *outChar)
break;
case 0x53:
- if (ctrl_pressed && alt_pressed)
+ if (ctrl_pressed && alt_pressed)
rtemsReboot(); /* ctrl+alt+del -> reboot */
break;
@@ -256,11 +256,11 @@ _IBMPC_inch(void)
return c;
} /* _IBMPC_inch */
-
+
/*
* Routine that can be used before interrupt management is initialized.
*/
-
+
char
BSP_wait_polled_input(void)
{
diff --git a/c/src/lib/libbsp/i386/pc386/console/kd.h b/c/src/lib/libbsp/i386/pc386/console/kd.h
index 7833abfa9d..963c8cc935 100644
--- a/c/src/lib/libbsp/i386/pc386/console/kd.h
+++ b/c/src/lib/libbsp/i386/pc386/console/kd.h
@@ -5,11 +5,44 @@
// MODULE DESCRIPTION:
//
// This module was based on the Linux version kd.h
-//
+//
// by: Rosimildo da Silva: rdasilva@connecttel.com
//
// MODIFICATION/HISTORY:
// $Log$
+// Revision 1.1 2000/08/30 08:15:30 joel
+// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
+//
+// * Major rework of the "/dev/console" driver.
+// * Added termios support for stdin ( keyboard ).
+// * Added ioctls() to support modes similar to Linux( XLATE,
+// RAW, MEDIUMRAW ).
+// * Added Keyboard mapping and handling of the keyboard's leds.
+// * Added Micro FrameBuffer driver ( "/dev/fb0" ) for bare VGA
+// controller ( 16 colors ).
+// * Added PS/2 and Serial mouse support for PC386 BSP.
+// * console/defkeymap.c: New file.
+// * console/fb_vga.c: New file.
+// * console/fb_vga.h: New file.
+// * console/i386kbd.h: New file.
+// * console/kd.h: New file.
+// * console/keyboard.c: New file.
+// * console/keyboard.h: New file.
+// * console/mouse_parser.c: New file.
+// * console/mouse_parser.h: New file.
+// * console/pc_keyb.c: New file.
+// * console/ps2_drv.h: New file.
+// * console/ps2_mouse.c: New file.
+// * console/ps2_mouse.h: New file.
+// * console/serial_mouse.c: New file.
+// * console/serial_mouse.h: New file.
+// * console/vgainit.c: New file.
+// * console/vt.c: New file.
+// * console/Makefile.am: Reflect new files.
+// * console/console.c, console/inch.c, console/outch.c: Console
+// functionality modifications.
+// * startup/Makefile.am: Pick up tty_drv.c and gdb_glue.c
+//
//
/////////////////////////////////////////////////////////////////////////////
*/
diff --git a/c/src/lib/libbsp/i386/pc386/console/keyboard.c b/c/src/lib/libbsp/i386/pc386/console/keyboard.c
index bcae056b97..0be2ef4e15 100644
--- a/c/src/lib/libbsp/i386/pc386/console/keyboard.c
+++ b/c/src/lib/libbsp/i386/pc386/console/keyboard.c
@@ -14,7 +14,7 @@
* `Sticky' modifier keys, 951006.
*
* 11-11-96: SAK should now work in the raw mode (Martin Mares)
- *
+ *
* Modified to provide 'generic' keyboard support by Hamish Macdonald
* Merge with the m68k keyboard driver and split-off of the PC low-level
* parts by Geert Uytterhoeven, May 1997
@@ -24,7 +24,7 @@
* -------------------------------------------------------------------
* End of Linux - Copyright notes...
*
- * Ported to RTEMS to provide the basic fuctionality to the console driver.
+ * Ported to RTEMS to provide the basic fuctionality to the console driver.
* by: Rosimildo da Silva: rdasilva@connecttel.com
*
*/
@@ -110,9 +110,9 @@ static unsigned char k_down[NR_SHIFT] = {0, };
static unsigned long key_down[256/BITS_PER_LONG] = { 0, };
static int dead_key_next = 0;
-/*
+/*
* In order to retrieve the shift_state (for the mouse server), either
- * the variable must be global, or a new procedure must be created to
+ * the variable must be global, or a new procedure must be created to
* return the value. I chose the former way.
*/
int shift_state = 0;
diff --git a/c/src/lib/libbsp/i386/pc386/console/keyboard.h b/c/src/lib/libbsp/i386/pc386/console/keyboard.h
index ab4c669b15..2946235039 100644
--- a/c/src/lib/libbsp/i386/pc386/console/keyboard.h
+++ b/c/src/lib/libbsp/i386/pc386/console/keyboard.h
@@ -5,11 +5,17 @@
// MODULE DESCRIPTION:
//
// This module was based on the Linux version keyboard.h + kbd_kern.h
-//
+//
// by: Rosimildo da Silva: rdasilva@connecttel.com
//
// MODIFICATION/HISTORY:
// $Log$
+// Revision 1.2 2000/08/30 17:06:23 joel
+// 2000-08-30 Joel Sherrill <joel@OARcorp.com>
+//
+// * console/keyboard.h: Changed numerous routines from extern inline
+// to static inline.
+//
// Revision 1.1 2000/08/30 08:15:30 joel
// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
//
diff --git a/c/src/lib/libbsp/i386/pc386/console/mouse_parser.c b/c/src/lib/libbsp/i386/pc386/console/mouse_parser.c
index bb49a3906a..308ace335f 100644
--- a/c/src/lib/libbsp/i386/pc386/console/mouse_parser.c
+++ b/c/src/lib/libbsp/i386/pc386/console/mouse_parser.c
@@ -5,7 +5,7 @@
* provided that this copyright notice remains intact.
*
* UNIX Serial Port Mouse Driver
- *
+ *
* This driver opens a serial port directly, and interprets serial data.
* Microsoft, PC, Logitech and PS/2 mice are supported.
* The PS/2 mouse is only supported if the OS runs the mouse
@@ -148,7 +148,7 @@ int MOU_Data( int ch, COORD *dx, COORD *dy, COORD *dz, BUTTON *bptr)
* When a complete state has been read, return the results,
* leaving further bytes in the buffer for later calls.
*/
- if( (*parse)( ch ) )
+ if( (*parse)( ch ) )
{
*dx = xd;
*dy = yd;
@@ -268,7 +268,7 @@ static int ParsePS2(int byte)
switch (state) {
case IDLE:
if (byte & PS2_CTRL_BYTE) {
- buttons = byte &
+ buttons = byte &
(PS2_LEFT_BUTTON|PS2_RIGHT_BUTTON);
state = XSET;
}
@@ -372,7 +372,7 @@ static void kbd_parser( void *ptr, unsigned short keycode, unsigned long mods )
m.m.kbd.modifiers = kbd->ledflagstate;
m.m.kbd.mode = kbd->kbdmode;
/* printk( "kbd: msg: keycode=%X, mod=%X\n", keycode, mods ); */
- rtems_message_queue_send( queue_id, ( void * )&m,
+ rtems_message_queue_send( queue_id, ( void * )&m,
sizeof( struct MW_UID_MESSAGE ) );
}
diff --git a/c/src/lib/libbsp/i386/pc386/console/mouse_parser.h b/c/src/lib/libbsp/i386/pc386/console/mouse_parser.h
index 0adc9be55a..40d491f2c4 100644
--- a/c/src/lib/libbsp/i386/pc386/console/mouse_parser.h
+++ b/c/src/lib/libbsp/i386/pc386/console/mouse_parser.h
@@ -8,9 +8,9 @@ extern "C" {
#endif
/* Use the same definitions as the user interface */
-#define RBUTTON MV_BUTTON_RIGHT
-#define MBUTTON MV_BUTTON_CENTER
-#define LBUTTON MV_BUTTON_LEFT
+#define RBUTTON MV_BUTTON_RIGHT
+#define MBUTTON MV_BUTTON_CENTER
+#define LBUTTON MV_BUTTON_LEFT
typedef int COORD; /* device coordinates*/
typedef unsigned int BUTTON; /* mouse button mask*/
diff --git a/c/src/lib/libbsp/i386/pc386/console/outch.c b/c/src/lib/libbsp/i386/pc386/console/outch.c
index e32f361476..ae6cb6d288 100644
--- a/c/src/lib/libbsp/i386/pc386/console/outch.c
+++ b/c/src/lib/libbsp/i386/pc386/console/outch.c
@@ -37,12 +37,12 @@ static unsigned char column;
static unsigned short attribute;
static unsigned int nLines;
-static void
+static void
scroll(void)
{
int i, j; /* Counters */
unsigned short *pt_scroll, *pt_bitmap; /* Pointers on the bit-map */
-
+
pt_bitmap = bitMapBaseAddr;
j = 0;
pt_bitmap = pt_bitmap + j;
@@ -50,11 +50,11 @@ scroll(void)
for (i = j; i < (maxRow - 1) * maxCol; i++) {
*pt_bitmap++ = *pt_scroll++;
}
-
+
/*
* Blank characters are displayed on the last line.
- */
- for (i = 0; i < maxCol; i++) {
+ */
+ for (i = 0; i < maxCol; i++) {
*pt_bitmap++ = (short) (' ' | attribute);
}
}
@@ -63,9 +63,9 @@ static void
doCRNL(int cr, int nl)
{
if (nl) {
- if (++row == maxRow) {
+ if (++row == maxRow) {
scroll(); /* Scroll the screen now */
- row = maxRow - 1;
+ row = maxRow - 1;
}
nLines++;
}
@@ -102,7 +102,7 @@ gotorc(int r, int c)
#define BLANK ((char)0x7f)
-static void
+static void
videoPutChar(char car)
{
unsigned short *pt_bitmap = bitMapBaseAddr + row * maxCol + column;
@@ -123,7 +123,7 @@ videoPutChar(char car)
doCRNL(1,1);
return;
}
- while (i--) *pt_bitmap++ = ' ' | attribute;
+ while (i--) *pt_bitmap++ = ' ' | attribute;
wr_cursor(row * maxCol + column, ioCrtBaseAddr);
return;
}
@@ -134,7 +134,7 @@ videoPutChar(char car)
case 7: { /* Bell code must be inserted here */
return;
}
- case '\r' : {
+ case '\r' : {
doCRNL(1,0);
return;
}
@@ -149,7 +149,7 @@ videoPutChar(char car)
return;
}
}
-}
+}
/* trivial state machine to handle escape sequences:
*
@@ -161,9 +161,9 @@ videoPutChar(char car)
* ^\ \ \ \
* KEY: | \other \ other \ other \ other
* <-------------------------------------
- *
+ *
* in state '-1', the DCABHKJ cases are handled
- *
+ *
* (cursor motion and screen clearing)
*/
@@ -262,7 +262,7 @@ clear_screen(void)
| Description: Higher level (console) interface to consPutc.
| Global Variables: None.
| Arguments: c - character to write to console.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
_IBMPC_outch(char c)
@@ -280,7 +280,7 @@ static int escaped = 0;
| Global Variables: bitMapBaseAddr, ioCrtBaseAddr, maxCol, maxRow, row
| column, attribute, nLines;
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
_IBMPC_initVideo(void)
@@ -301,7 +301,7 @@ _IBMPC_initVideo(void)
attribute = ((BLACK << 4) | WHITE)<<8;
nLines = 0;
clear_screen();
-#ifdef DEBUG_EARLY_STAGE
+#ifdef DEBUG_EARLY_STAGE
printk("bitMapBaseAddr = %X, display controller base IO = %X\n",
(unsigned) bitMapBaseAddr,
(unsigned) ioCrtBaseAddr);
diff --git a/c/src/lib/libbsp/i386/pc386/console/pc_keyb.c b/c/src/lib/libbsp/i386/pc386/console/pc_keyb.c
index d9feaca1b4..074d84e38a 100644
--- a/c/src/lib/libbsp/i386/pc386/console/pc_keyb.c
+++ b/c/src/lib/libbsp/i386/pc386/console/pc_keyb.c
@@ -369,7 +369,7 @@ static unsigned char handle_kbd_event(void)
}
status = kbd_read_status();
-
+
if(!work--)
{
printk( "pc_keyb: controller jammed (0x%02X).\n", status);
@@ -378,10 +378,10 @@ static unsigned char handle_kbd_event(void)
return status;
}
- /*
- * the commands to set the leds for some reason, returns 0x14, 0x16
+ /*
+ * the commands to set the leds for some reason, returns 0x14, 0x16
* and I am intepreting as an ACK, because the original code from
- * Linux was timeing out here...
+ * Linux was timeing out here...
*/
acknowledge = 1;
reply_expected = 0;
@@ -595,7 +595,7 @@ static char * initialize_kbd(void)
kbd_wait_for_input();
}
-
+
kbd_write_output_w(KBD_CMD_ENABLE);
if (kbd_wait_for_input() != KBD_REPLY_ACK)
return "Enable keyboard: no ACK";
diff --git a/c/src/lib/libbsp/i386/pc386/console/ps2_drv.h b/c/src/lib/libbsp/i386/pc386/console/ps2_drv.h
index 0a035c1a67..bfa9c2a32a 100644
--- a/c/src/lib/libbsp/i386/pc386/console/ps2_drv.h
+++ b/c/src/lib/libbsp/i386/pc386/console/ps2_drv.h
@@ -5,7 +5,7 @@
* $Header$
*
* Copyright (c) 1999 ConnectTel, Inc. All Rights Reserved.
- *
+ *
* MODULE DESCRIPTION: Prototype routines for the paux driver.
*
* by: Rosimildo da Silva:
@@ -15,6 +15,9 @@
* MODIFICATION/HISTORY:
*
* $Log$
+ * Revision 1.2 2004/04/15 13:26:12 ralf
+ * Remove stray white spaces.
+ *
* Revision 1.1 2000/08/30 08:15:30 joel
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
*
diff --git a/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c b/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c
index 8f24e1a706..5149822229 100644
--- a/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c
+++ b/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c
@@ -82,7 +82,7 @@ isr_on(const rtems_irq_connect_data *unused)
{
return;
}
-
+
static void
isr_off(const rtems_irq_connect_data *unused)
{
@@ -126,7 +126,7 @@ static void kb_wait(void)
if (! (status & KBD_STAT_IBF))
return;
- mdelay(1);
+ mdelay(1);
timeout--;
} while (timeout);
@@ -463,11 +463,11 @@ size_t read_aux(char * buffer, size_t count )
size_t i = count;
unsigned char c;
- if (queue_empty())
+ if (queue_empty())
{
return 0;
}
- while (i > 0 && !queue_empty())
+ while (i > 0 && !queue_empty())
{
c = get_from_queue();
*buffer++ = c;
@@ -591,7 +591,7 @@ static int paux_last_close(int major, int minor, void *arg)
* It does nothing write now.
*/
static int write_aux_echo( int minor, const char * buffer, int count )
-{
+{
return 0;
}
@@ -617,7 +617,7 @@ paux_open(rtems_device_major_number major,
void *arg)
{
rtems_status_code status;
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
paux_last_close, /* lastClose */
@@ -645,7 +645,7 @@ paux_close(rtems_device_major_number major,
return (rtems_termios_close (arg));
}
-
+
/*
* paux device driver READ entry point.
* Read characters from the PS/2 mouse.
@@ -657,7 +657,7 @@ paux_read(rtems_device_major_number major,
{
return rtems_termios_read (arg);
} /* tty_read */
-
+
/*
* paux device driver WRITE entry point.
@@ -675,18 +675,18 @@ paux_write(rtems_device_major_number major,
return RTEMS_SUCCESSFUL;
} /* tty_write */
-
+
/*
* Handle ioctl request.
*/
-rtems_device_driver
+rtems_device_driver
paux_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
rtems_libio_ioctl_args_t *args = arg;
- switch( args->command )
+ switch( args->command )
{
default:
return rtems_termios_ioctl (arg);
diff --git a/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.h b/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.h
index 1236e8cff2..4a3d083f1c 100644
--- a/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.h
+++ b/c/src/lib/libbsp/i386/pc386/console/ps2_mouse.h
@@ -6,7 +6,7 @@
* RTEMS port: by Rosimildo da Silva.
*
* This module was ported from Linux.
- *
+ *
*/
/*
diff --git a/c/src/lib/libbsp/i386/pc386/console/serial_mouse.c b/c/src/lib/libbsp/i386/pc386/console/serial_mouse.c
index 184911c58f..b34d13b41c 100644
--- a/c/src/lib/libbsp/i386/pc386/console/serial_mouse.c
+++ b/c/src/lib/libbsp/i386/pc386/console/serial_mouse.c
@@ -7,7 +7,7 @@
* as /dev/ttyS1 for COM1 and /dev/ttyS2 as COM2. If one of the ports
* is used as the console, this driver would fail to initialize.
*
- * This code was based on the console driver. It is based on the
+ * This code was based on the console driver. It is based on the
* current termios framework. This is just a shell around the
* termios support.
*
@@ -18,6 +18,12 @@
* MODIFICATION/HISTORY:
*
* $Log$
+ * Revision 1.5 2000/12/05 16:37:38 joel
+ * 2000-12-01 Joel Sherrill <joel@OARcorp.com>
+ *
+ * * pc386/console/console.c, pc386/console/serial_mouse.c,
+ * pc386/console/vgainit.c, shared/comm/tty_drv.c: Remove warnings.
+ *
* Revision 1.4 2000/10/23 14:10:25 joel
* 2000-10-23 Joel Sherrill <joel@OARcorp.com>
*
@@ -80,8 +86,8 @@ extern int BSPConsolePort;
/*
* Interrupt structure for serial_mouse
*/
-static rtems_irq_connect_data serial_mouse_isr_data =
-{
+static rtems_irq_connect_data serial_mouse_isr_data =
+{
BSP_UART_IRQ,
BSP_ISR_FUNC,
isr_on,
@@ -92,7 +98,7 @@ static void isr_on(const rtems_irq_connect_data *unused)
{
return;
}
-
+
static void isr_off(const rtems_irq_connect_data *unused)
{
return;
@@ -131,7 +137,7 @@ serial_mouse_initialize(rtems_device_major_number major,
* Set up TERMIOS
*/
rtems_termios_initialize();
-
+
/*
* Do device-specific initialization
*/
@@ -172,7 +178,7 @@ serial_mouse_open(rtems_device_major_number major,
void *arg)
{
rtems_status_code status;
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
serial_mouse_last_close, /* lastClose */
@@ -194,7 +200,7 @@ serial_mouse_open(rtems_device_major_number major,
/*
* Pass data area info down to driver
*/
- BSP_uart_termios_set( BSP_UART_PORT,
+ BSP_uart_termios_set( BSP_UART_PORT,
((rtems_libio_open_close_args_t *)arg)->iop->data1 );
/* Enable interrupts on channel */
BSP_uart_intr_ctrl( BSP_UART_PORT, BSP_UART_INTR_CTRL_TERMIOS);
@@ -211,10 +217,10 @@ serial_mouse_close(rtems_device_major_number major,
{
return (rtems_termios_close (arg));
-
+
} /* tty_close */
-
+
/*
* TTY device driver READ entry point.
* Read characters from the tty device.
@@ -226,7 +232,7 @@ serial_mouse_read(rtems_device_major_number major,
{
return rtems_termios_read (arg);
} /* tty_read */
-
+
/*
* TTY device driver WRITE entry point.
@@ -238,7 +244,7 @@ serial_mouse_write(rtems_device_major_number major,
void * arg)
{
return rtems_termios_write (arg);
-
+
} /* tty_write */
/*
@@ -246,9 +252,9 @@ serial_mouse_write(rtems_device_major_number major,
* routine to handle both devices.
*/
static rtems_device_driver serial_mouse_control_internal( int port, void *arg )
-{
+{
rtems_libio_ioctl_args_t *args = arg;
- switch( args->command )
+ switch( args->command )
{
default:
return rtems_termios_ioctl (arg);
@@ -271,12 +277,12 @@ static rtems_device_driver serial_mouse_control_internal( int port, void *arg )
/*
* Handle ioctl request for ttyS1.
*/
-rtems_device_driver
+rtems_device_driver
serial_mouse_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
return serial_mouse_control_internal( BSP_UART_PORT, arg );
}
@@ -287,45 +293,45 @@ conSetAttr(int port, int minor, const struct termios *t)
{
unsigned long baud, databits, parity, stopbits;
- switch (t->c_cflag & CBAUD)
+ switch (t->c_cflag & CBAUD)
{
- case B50:
+ case B50:
baud = 50;
break;
- case B75:
- baud = 75;
+ case B75:
+ baud = 75;
break;
- case B110:
- baud = 110;
+ case B110:
+ baud = 110;
break;
- case B134:
- baud = 134;
+ case B134:
+ baud = 134;
break;
- case B150:
- baud = 150;
+ case B150:
+ baud = 150;
break;
case B200:
- baud = 200;
+ baud = 200;
break;
- case B300:
+ case B300:
baud = 300;
break;
- case B600:
- baud = 600;
+ case B600:
+ baud = 600;
break;
- case B1200:
+ case B1200:
baud = 1200;
break;
- case B1800:
- baud = 1800;
+ case B1800:
+ baud = 1800;
break;
- case B2400:
+ case B2400:
baud = 2400;
break;
- case B4800:
+ case B4800:
baud = 4800;
break;
- case B9600:
+ case B9600:
baud = 9600;
break;
case B19200:
@@ -334,7 +340,7 @@ conSetAttr(int port, int minor, const struct termios *t)
case B38400:
baud = 38400;
break;
- case B57600:
+ case B57600:
baud = 57600;
break;
case B115200:
@@ -360,7 +366,7 @@ conSetAttr(int port, int minor, const struct termios *t)
/* No parity */
parity = 0;
}
-
+
switch (t->c_cflag & CSIZE) {
case CS5: databits = CHR_5_BITS; break;
case CS6: databits = CHR_6_BITS; break;
diff --git a/c/src/lib/libbsp/i386/pc386/console/serial_mouse.h b/c/src/lib/libbsp/i386/pc386/console/serial_mouse.h
index ded9b469f5..2a7385d453 100644
--- a/c/src/lib/libbsp/i386/pc386/console/serial_mouse.h
+++ b/c/src/lib/libbsp/i386/pc386/console/serial_mouse.h
@@ -5,7 +5,7 @@
* $Header$
*
* Copyright (c) 1999 ConnectTel, Inc. All Rights Reserved.
- *
+ *
* MODULE DESCRIPTION: Prototype routines for the /dev/mouse driver.
*
* by: Rosimildo da Silva:
@@ -15,6 +15,9 @@
* MODIFICATION/HISTORY:
*
* $Log$
+ * Revision 1.2 2004/04/15 13:26:12 ralf
+ * Remove stray white spaces.
+ *
* Revision 1.1 2000/08/30 08:15:30 joel
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
*
@@ -98,7 +101,7 @@ rtems_device_driver serial_mouse_write(
/* Select the mouse type: "ms","pc","ps2" */
-#define MOUSE_TYPE "ms"
+#define MOUSE_TYPE "ms"
/* Select the serial port for the serial mouse driver */
#define SERIAL_MOUSE_COM1 1
diff --git a/c/src/lib/libbsp/i386/pc386/console/videoAsm.S b/c/src/lib/libbsp/i386/pc386/console/videoAsm.S
index 6c9b56e4af..e78b100c1c 100644
--- a/c/src/lib/libbsp/i386/pc386/console/videoAsm.S
+++ b/c/src/lib/libbsp/i386/pc386/console/videoAsm.S
@@ -1,7 +1,7 @@
/*
* videoAsm.S - This file contains code for displaying cursor on the console
*
- * Copyright (C) 1998 valette@crf.canon.fr
+ * Copyright (C) 1998 valette@crf.canon.fr
*
* This code is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
diff --git a/c/src/lib/libbsp/i386/pc386/console/vt.c b/c/src/lib/libbsp/i386/pc386/console/vt.c
index 0f38106332..631a7d532f 100644
--- a/c/src/lib/libbsp/i386/pc386/console/vt.c
+++ b/c/src/lib/libbsp/i386/pc386/console/vt.c
@@ -73,7 +73,7 @@ _kd_mksound(unsigned int hz, unsigned int ticks)
if (hz > 20 && hz < 32767)
count = 1193180 / hz;
-
+
_CPU_ISR_Disable(level);
/* del_timer(&sound_timer); */
if (count) {
@@ -121,7 +121,7 @@ do_kdsk_ioctl(int cmd, struct kbentry *user_kbe, int perm, struct kbd_struct *kb
tmp = *user_kbe;
if (i >= NR_KEYS || s >= MAX_NR_KEYMAPS)
- return -EINVAL;
+ return -EINVAL;
switch (cmd) {
case KDGKBENT:
@@ -147,7 +147,7 @@ do_kdsk_ioctl(int cmd, struct kbentry *user_kbe, int perm, struct kbd_struct *kb
#define HZ 100
-static inline int
+static inline int
do_kbkeycode_ioctl(int cmd, struct kbkeycode *user_kbkc, int perm)
{
struct kbkeycode tmp;
@@ -177,7 +177,7 @@ do_kdgkb_ioctl(int cmd, struct kbsentry *user_kdgkb, int perm)
/*
* We handle the console-specific ioctl's here. We allow the
- * capability to modify any console, not just the fg_console.
+ * capability to modify any console, not just the fg_console.
*/
int vt_ioctl( unsigned int cmd, unsigned long arg)
{
@@ -207,7 +207,7 @@ int vt_ioctl( unsigned int cmd, unsigned long arg)
return -EPERM;
{
unsigned int ticks, count;
-
+
/*
* Generate the tone for the appropriate number of ticks.
* If the time is zero, turn off sound ourselves.
diff --git a/c/src/lib/libbsp/i386/pc386/ide/ide.c b/c/src/lib/libbsp/i386/pc386/ide/ide.c
index 29f1f8a349..482fabd0eb 100644
--- a/c/src/lib/libbsp/i386/pc386/ide/ide.c
+++ b/c/src/lib/libbsp/i386/pc386/ide/ide.c
@@ -30,8 +30,8 @@
#include <libchip/ide_ctrl_io.h>
/* #define DEBUG_OUT */
-/*
- * support functions for IDE harddisk IF
+/*
+ * support functions for IDE harddisk IF
*/
/*=========================================================================*\
| Function: |
@@ -52,7 +52,7 @@ boolean pc386_ide_probe
\*=========================================================================*/
{
boolean ide_card_plugged = TRUE; /* assume: we have a disk here */
-
+
return ide_card_plugged;
}
@@ -160,9 +160,9 @@ void pc386_ide_read_block
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
- int minor,
- uint16_t block_size,
- blkdev_sg_buffer *bufs,
+ int minor,
+ uint16_t block_size,
+ blkdev_sg_buffer *bufs,
uint32_t *cbuf,
uint32_t *pos
)
@@ -179,7 +179,7 @@ void pc386_ide_read_block
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
inport_byte(port+IDE_REGISTER_STATUS,status_val);
- while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
+ while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
(cnt < block_size)) {
inport_word(port+IDE_REGISTER_DATA,*lbuf);
@@ -187,7 +187,7 @@ void pc386_ide_read_block
printk("0x%x ",*lbuf);
#endif
lbuf++;
- cnt += sizeof(*lbuf);
+ cnt += sizeof(*lbuf);
(*pos) += sizeof(*lbuf);
if ((*pos) == llength) {
(*pos) = 0;
@@ -196,7 +196,7 @@ void pc386_ide_read_block
llength = bufs[(*cbuf)].length;
}
inport_byte(port+IDE_REGISTER_STATUS,status_val);
- }
+ }
#ifdef DEBUG_OUT
printk("pc386_ide_read_block()\r\n");
#endif
@@ -213,9 +213,9 @@ void pc386_ide_write_block
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
- int minor,
- uint16_t block_size,
- blkdev_sg_buffer *bufs,
+ int minor,
+ uint16_t block_size,
+ blkdev_sg_buffer *bufs,
uint32_t *cbuf,
uint32_t *pos
)
@@ -230,19 +230,19 @@ void pc386_ide_write_block
uint8_t status_val;
uint16_t *lbuf = (uint16_t*)
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
-
+
#ifdef DEBUG_OUT
printk("pc386_ide_write_block()\r\n");
#endif
inport_byte(port+IDE_REGISTER_STATUS,status_val);
- while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
+ while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
(cnt < block_size)) {
#ifdef DEBUG_OUT
printk("0x%x ",*lbuf);
#endif
outport_word(port+IDE_REGISTER_DATA,*lbuf);
lbuf++;
- cnt += sizeof(*lbuf);
+ cnt += sizeof(*lbuf);
(*pos) += sizeof(*lbuf);
if ((*pos) == llength) {
(*pos) = 0;
@@ -300,7 +300,7 @@ rtems_status_code pc386_ide_config_io_speed
}
/*
- * The following table configures the functions used for IDE drivers
+ * The following table configures the functions used for IDE drivers
* in this BSP.
*/
diff --git a/c/src/lib/libbsp/i386/pc386/ide/idecfg.c b/c/src/lib/libbsp/i386/pc386/ide/idecfg.c
index d254bb5827..b84855a7b8 100644
--- a/c/src/lib/libbsp/i386/pc386/ide/idecfg.c
+++ b/c/src/lib/libbsp/i386/pc386/ide/idecfg.c
@@ -25,7 +25,7 @@
/*
- * The following table configures the functions used for IDE drivers
+ * The following table configures the functions used for IDE drivers
* in this BSP.
*/
@@ -48,5 +48,5 @@ ide_controller_bsp_table_t IDE_Controller_Table[] = {
};
/* Number of rows in IDE_Controller_Table */
-unsigned long IDE_Controller_Count =
+unsigned long IDE_Controller_Count =
sizeof(IDE_Controller_Table)/sizeof(IDE_Controller_Table[0]);
diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h
index e9edef177a..ef5d43ea84 100644
--- a/c/src/lib/libbsp/i386/pc386/include/bsp.h
+++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h
@@ -54,7 +54,7 @@ extern "C" {
#include <rtems/clockdrv.h>
#include <libcpu/cpu.h>
#include <rtems/bspIo.h>
-
+
/*
* confdefs.h overrides for this BSP:
* - number of termios serial ports
@@ -104,8 +104,8 @@ extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int);
| Video (console) related constants.
+--------------------------------------------------------------------------*/
-#include <crt.h>
-
+#include <crt.h>
+
/*-------------------------------------------------------------------------+
| Constants relating to the 8254 (or 8253) programmable interval timers.
+--------------------------------------------------------------------------*/
@@ -192,7 +192,7 @@ extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int);
extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
extern segment_descriptors Global_descriptor_table [GDT_SIZE];
-
+
extern rtems_configuration_table BSP_Configuration;
/* User provided BSP configuration table. */
extern uint32_t rtemsFreeMemStart;
@@ -204,8 +204,8 @@ extern uint32_t rtemsFreeMemStart;
+--------------------------------------------------------------------------*/
void _IBMPC_initVideo(void); /* from 'outch.c' */
void _IBMPC_outch (char); /* from 'outch.c' */
-char _IBMPC_inch (void); /* from 'inch.c' */
-char _IBMPC_inch_sleep (void); /* from 'inch.c' */
+char _IBMPC_inch (void); /* from 'inch.c' */
+char _IBMPC_inch_sleep (void); /* from 'inch.c' */
void rtemsReboot(void); /* from 'exit.c' */
diff --git a/c/src/lib/libbsp/i386/pc386/include/crt.h b/c/src/lib/libbsp/i386/pc386/include/crt.h
index 526fcbe62a..c750777cfb 100644
--- a/c/src/lib/libbsp/i386/pc386/include/crt.h
+++ b/c/src/lib/libbsp/i386/pc386/include/crt.h
@@ -21,7 +21,7 @@
*/
/* In monochrome */
-#define V_MONO 0xb0000
+#define V_MONO 0xb0000
/* In color */
#define V_COLOR 0xb8000
@@ -73,7 +73,7 @@
#define ON 1
-/*
+/*
* CRT Controller register offset definitions
*/
diff --git a/c/src/lib/libbsp/i386/pc386/include/wd80x3.h b/c/src/lib/libbsp/i386/pc386/include/wd80x3.h
index 282faabdd1..5f7a1fa970 100644
--- a/c/src/lib/libbsp/i386/pc386/include/wd80x3.h
+++ b/c/src/lib/libbsp/i386/pc386/include/wd80x3.h
@@ -17,7 +17,7 @@
/* page 0 read or read/write registers */
-#define CMDR 0x00+RO
+#define CMDR 0x00+RO
#define CLDA0 0x01+RO /* current local dma addr 0 for read */
#define CLDA1 0x02+RO /* current local dma addr 1 for read */
#define BNRY 0x03+RO /* boundary reg for rd and wr */
@@ -63,7 +63,7 @@
/*-----CMDR command bits-----*/
#define MSK_STP 0x01 /* stop the chip */
-#define MSK_STA 0x02 /* start the chip */
+#define MSK_STA 0x02 /* start the chip */
#define MSK_TXP 0x04 /* initial txing of a frm */
#define MSK_RRE 0x08 /* remote read */
#define MSK_RWR 0x10 /* remote write */
diff --git a/c/src/lib/libbsp/i386/pc386/start/start.S b/c/src/lib/libbsp/i386/pc386/start/start.S
index 135ae90496..bef9448bc8 100644
--- a/c/src/lib/libbsp/i386/pc386/start/start.S
+++ b/c/src/lib/libbsp/i386/pc386/start/start.S
@@ -25,7 +25,7 @@
|
| **************************************************************************
| * COPYRIGHT (c) 1989-1999.
-| * On-Line Applications Research Corporation (OAR).
+| * On-Line Applications Research Corporation (OAR).
| *
| * The license and distribution terms for this file may be
| * found in the file LICENSE in this distribution or at
@@ -44,7 +44,7 @@
#include <rtems/asm.h>
/*----------------------------------------------------------------------------+
-| Size of heap and stack:
+| Size of heap and stack:
+----------------------------------------------------------------------------*/
.set STACK_SIZE, 0x1000
@@ -63,7 +63,7 @@ BEGIN_CODE
EXTERN (_IBMPC_initVideo)
EXTERN (debugPollingGetChar)
EXTERN (checkCPUtypeSetCr0)
-
+
/*
* In case this crashes on your machine and this is not due
@@ -75,7 +75,7 @@ BEGIN_CODE
SYM (start):
/*
* When things are really, REALLY!, bad -- turn on the speaker and
- * lock up. This shows whether or not we make it to a certain
+ * lock up. This shows whether or not we make it to a certain
* location.
*/
#if 0
@@ -91,7 +91,7 @@ speakl: jmp speakl # and SPIN!!!
#ifdef DEBUG_EARLY_START
/*
* Must get video attribute to have a working printk.
- * Note that the following code assume we already have
+ * Note that the following code assume we already have
* valid segments and a stack. It should be true for
* any loader starting RTEMS in protected mode (or
* at least I hope so : -)).
@@ -105,13 +105,13 @@ speakl: jmp speakl # and SPIN!!!
addl $4, esp
/* call debugPollingGetChar */
-
-#endif
+
+#endif
/*----------------------------------------------------------------------------+
| Load the segment registers (this is done by the board's BSP) and perform any
| other board specific initialization procedures, this piece of code
-| does not know anything about
+| does not know anything about
|
| NOTE: Upon return, gs will contain the segment descriptor for a segment which
| maps directly to all of physical memory.
@@ -153,12 +153,12 @@ SYM (zero_bss):
| So from now we can use printk
+-------------------------------------------------------------------*/
call _IBMPC_initVideo
-
+
/*---------------------------------------------------------------------+
| Check CPU type. Enable Cache and init coprocessor if needed.
+---------------------------------------------------------------------*/
call checkCPUtypeSetCr0
-
+
/*---------------------------------------------------------------------+
| Transfer control to User's Board Support Package
+---------------------------------------------------------------------*/
diff --git a/c/src/lib/libbsp/i386/pc386/start/start16.S b/c/src/lib/libbsp/i386/pc386/start/start16.S
index 6b53b6e19d..cfc2b92771 100644
--- a/c/src/lib/libbsp/i386/pc386/start/start16.S
+++ b/c/src/lib/libbsp/i386/pc386/start/start16.S
@@ -53,10 +53,10 @@ _start16:
movw %ax, %ss #
#if defined(RTEMS_VIDEO_80x50)
-
+
movl $0x0040,%eax # use 32 bit constant to ensure 16 MSB=0
mov %ax,%es
- movw %es:0x4a, %ax # get 16 bit number of columns
+ movw %es:0x4a, %ax # get 16 bit number of columns
cmpw $0, %ax # or 0 if no video adapter
je 1f # if no video, skip touching it
/*---------------------------------------------------------------------+
@@ -87,12 +87,12 @@ _start16:
movl %cr0, %eax
orl $CR0_PE, %eax
movl %eax, %cr0 # turn on protected mode
-
+
#ifdef NEW_GAS
ljmpl $PROT_CODE_SEG, $1f # flush prefetch queue, and reload %cs
#else
ljmp $PROT_CODE_SEG, $1f # flush prefetch queue, and reload %cs
-#endif
+#endif
.code32
1:
/*---------------------------------------------------------------------+
@@ -127,10 +127,10 @@ _start16:
/*----------------------------------------------------------------------------+
| pc386_delay
+------------------------------------------------------------------------------
-| Delay is needed after doing I/O.
+| Delay is needed after doing I/O.
|
| The outb version is OK on most machines BUT the loop version ...
-|
+|
| will delay for 1us on 1Gz machine, it will take a little bit
| longer on slower machines, however, it does not matter because we
| are going to call this function only a few times
@@ -180,7 +180,7 @@ no_output:
test $0x02, %al # is input buffer full?
jnz empty_8042 # yes - loop
ret
-
+
/*----------------------------------------------------------------------------+
| DATA section
+----------------------------------------------------------------------------*/
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
index 3535f2b735..56a4e3ad60 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
@@ -1,7 +1,7 @@
/*-------------------------------------------------------------------------+
| This file contains the PC386 BSP startup package. It includes application,
| board, and monitor specific initialization and configuration. The generic CPU
-| dependent initialization has been performed before this routine is invoked.
+| dependent initialization has been performed before this routine is invoked.
+--------------------------------------------------------------------------+
| (C) Copyright 1997 -
| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
@@ -40,11 +40,11 @@
| Global Variables
+--------------------------------------------------------------------------*/
extern uint32_t _end; /* End of BSS. Defined in 'linkcmds'. */
-/*
- * Size of heap if it is 0 it will be dynamically defined by memory size,
- * otherwise the value should be changed by binary patch
+/*
+ * Size of heap if it is 0 it will be dynamically defined by memory size,
+ * otherwise the value should be changed by binary patch
*/
-uint32_t _heap_size = 0;
+uint32_t _heap_size = 0;
/* Size of stack used during initialization. Defined in 'start.s'. */
extern uint32_t _stack_size;
@@ -77,20 +77,20 @@ void bsp_postdriver_hook(void);
| since drivers are not yet initialized.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void bsp_pretasking_hook(void)
{
uint32_t topAddr, val;
int i;
-
-
+
+
if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1)) /* not aligned => align it */
rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
if(_heap_size == 0)
{
- /*
+ /*
* We have to dynamically size memory. Memory size can be anything
* between 2M and 2048M.
* let us first write
@@ -110,12 +110,12 @@ void bsp_pretasking_hook(void)
break;
}
}
-
+
topAddr = (i-1)*1024*1024 - 4;
_heap_size = topAddr - rtemsFreeMemStart;
}
-
+
bsp_libc_init((void *)rtemsFreeMemStart, _heap_size, 0);
rtemsFreeMemStart += _heap_size; /* HEAP_SIZE in KBytes */
@@ -126,19 +126,19 @@ void bsp_pretasking_hook(void)
#endif /* RTEMS_DEBUG */
} /* bsp_pretasking_hook */
-
+
/*-------------------------------------------------------------------------+
| Function: bsp_start
| Description: Called before main is invoked.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void bsp_start_default( void )
{
void Calibrate_loop_1ms(void);
-
+
/*
* Calibrate variable for 1ms-loop (see timer.c)
*/
diff --git a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
index 1ca9b1b415..f9279c292b 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
+++ b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
@@ -41,7 +41,7 @@
| CODE section
+----------------------------------------------------------------------------*/
EXTERN (rtems_i8259_masks)
-
+
BEGIN_CODE
EXTERN (_establish_stack)
@@ -51,17 +51,17 @@ BEGIN_CODE
/*----------------------------------------------------------------------------+
| pc386_delay
+------------------------------------------------------------------------------
-| Delay is needed after doing I/O.
+| Delay is needed after doing I/O.
|
| The outb version is OK on most machines BUT the loop version ...
-|
+|
| will delay for 1us on 1Gz machine, it will take a little bit
| longer on slower machines, however, it does not matter because we
| are going to call this function only a few times
+----------------------------------------------------------------------------*/
#define DELAY_USE_OUTB
-
+
.p2align 4
.globl _pc386_delay
.globl pc386_delay
@@ -88,10 +88,10 @@ pc386_delay1:
| with apropriate values + reprogram PIC.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
.p2align 4
-
+
PUBLIC (_load_segments)
SYM (_load_segments):
@@ -101,7 +101,7 @@ SYM (_load_segments):
/* Load CS, flush prefetched queue */
ljmp $0x8, $next_step
-next_step:
+next_step:
/* Load segment registers */
movw $0x10, ax
movw ax, ss
@@ -125,27 +125,27 @@ next_step:
call SYM(pc386_delay)
outb al, $0xA0 /* and to 8259A-2 */
call SYM(pc386_delay)
-
+
movb $0x20, al /* start of hardware int's (0x20) */
outb al, $0x21
call SYM(pc386_delay)
movb $0x28, al /* start of hardware int's 2 (0x28) */
outb al, $0xA1
call SYM(pc386_delay)
-
+
movb $0x04, al /* 8259-1 is master */
outb al, $0x21
call SYM(pc386_delay)
movb $0x02, al /* 8259-2 is slave */
outb al, $0xA1
call SYM(pc386_delay)
-
+
movb $0x01, al /* 8086 mode for both */
outb al, $0x21
call SYM(pc386_delay)
outb al, $0xA1
call SYM(pc386_delay)
-
+
movb $0xFF, al /* mask off all interrupts for now */
outb al, $0xA1
call SYM(pc386_delay)
@@ -154,7 +154,7 @@ next_step:
call SYM(pc386_delay)
movw $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */
-
+
jmp SYM (_establish_stack) # return to the bsp entry code
/*-------------------------------------------------------------------------+
@@ -162,11 +162,11 @@ next_step:
| Description: Return to board's monitor (we have none so simply restart).
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
.p2align 4
-
+
PUBLIC (_return_to_monitor)
SYM (_return_to_monitor):
@@ -179,21 +179,21 @@ SYM (_return_to_monitor):
| Description: default interrupt handler
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
.p2align 4
-
+
/*---------------------------------------------------------------------------+
| GDT itself
+--------------------------------------------------------------------------*/
.p2align 4
-
+
PUBLIC (_Global_descriptor_table)
SYM (_Global_descriptor_table):
/* NULL segment */
- .word 0, 0
+ .word 0, 0
.byte 0, 0, 0, 0
/* code segment */
@@ -203,13 +203,13 @@ SYM (_Global_descriptor_table):
/* data segment */
.word 0xffff, 0
.byte 0, 0x92, 0xcf, 0
-
+
/*---------------------------------------------------------------------------+
| Descriptor of GDT
+--------------------------------------------------------------------------*/
SYM (gdtdesc):
- .word (3*8 - 1)
+ .word (3*8 - 1)
.long SYM (_Global_descriptor_table)
@@ -218,23 +218,23 @@ SYM (gdtdesc):
+---------------------------------------------------------------------------*/
BEGIN_DATA
.p2align 4
-
+
PUBLIC(Interrupt_descriptor_table)
SYM(Interrupt_descriptor_table):
.rept 256
.word 0,0,0,0
.endr
END_DATA
-
+
/*---------------------------------------------------------------------------+
| Descriptor of IDT
+--------------------------------------------------------------------------*/
BEGIN_CODE
.p2align 4
-SYM(idtdesc):
+SYM(idtdesc):
.word (256*8 - 1)
.long SYM (Interrupt_descriptor_table)
-
+
END_CODE
.section .m_hdr
diff --git a/c/src/lib/libbsp/i386/pc386/timer/timer.c b/c/src/lib/libbsp/i386/pc386/timer/timer.c
index db152cffac..3024ac70c7 100644
--- a/c/src/lib/libbsp/i386/pc386/timer/timer.c
+++ b/c/src/lib/libbsp/i386/pc386/timer/timer.c
@@ -79,7 +79,7 @@ extern void timerisr(void);
| Description: Read the value of PENTIUM on-chip cycle counter.
| Global Variables: None.
| Arguments: None.
-| Returns: Value of PENTIUM on-chip cycle counter.
+| Returns: Value of PENTIUM on-chip cycle counter.
+--------------------------------------------------------------------------*/
static inline unsigned long long
rdtsc(void)
@@ -97,7 +97,7 @@ rdtsc(void)
| not really necessary, since there will be a reset at exit.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
Timer_exit(void)
@@ -110,7 +110,7 @@ Timer_exit(void)
| Description: Timer initialization routine.
| Global Variables: Ttimer_val.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
Timer_initialize(void)
@@ -132,9 +132,9 @@ Timer_initialize(void)
| Description: Read hardware timer value.
| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
-uint32_t
+uint32_t
Read_timer(void)
{
register uint32_t total;
@@ -163,7 +163,7 @@ Read_timer(void)
| not really necessary, since there will be a reset at exit.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
static void
timerOff(const rtems_raw_irq_connect_data* used)
@@ -179,7 +179,7 @@ timerOff(const rtems_raw_irq_connect_data* used)
} /* Timer_exit */
-static void
+static void
timerOn(const rtems_raw_irq_connect_data* used)
{
/* load timer for US_PER_ISR microsecond period */
@@ -192,7 +192,7 @@ timerOn(const rtems_raw_irq_connect_data* used)
BSP_irq_enable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
}
-static int
+static int
timerIsOn(const rtems_raw_irq_connect_data *used)
{
return BSP_irq_enabled_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);}
@@ -211,7 +211,7 @@ static rtems_raw_irq_connect_data timer_raw_irq_data = {
| not really necessary, since there will be a reset at exit.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
Timer_exit(void)
@@ -224,7 +224,7 @@ Timer_exit(void)
| Description: Timer initialization routine.
| Global Variables: Ttimer_val.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
Timer_initialize(void)
@@ -254,9 +254,9 @@ Timer_initialize(void)
| Description: Read hardware timer value.
| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
-uint32_t
+uint32_t
Read_timer(void)
{
register uint32_t total, clicks;
@@ -284,20 +284,20 @@ Read_timer(void)
| Description: Empty function used in time tests.
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
rtems_status_code Empty_function(void)
{
return RTEMS_SUCCESSFUL;
} /* Empty function */
-
+
/*-------------------------------------------------------------------------+
| Function: Set_find_average_overhead
| Description: Set internal Timer_driver_Find_average_overhead flag value.
| Global Variables: Timer_driver_Find_average_overhead.
| Arguments: find_flag - new value of the flag.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
Set_find_average_overhead(rtems_boolean find_flag)
@@ -321,9 +321,9 @@ void loadTimerValue( unsigned short loadedValue )
/*-------------------------------------------------------------------------+
-| Description: Reads the current value of the timer, and converts the
-| number of ticks to micro-seconds.
-| Returns: number of clock bits elapsed since last load.
+| Description: Reads the current value of the timer, and converts the
+| number of ticks to micro-seconds.
+| Returns: number of clock bits elapsed since last load.
+--------------------------------------------------------------------------*/
unsigned int readTimer0()
{
@@ -338,7 +338,7 @@ unsigned int readTimer0()
count = ( msb << 8 ) | lsb ;
if (status & RB_OUTPUT )
count += lastLoadedValue;
-
+
return (2*lastLoadedValue - count);
}
@@ -372,19 +372,19 @@ Calibrate_loop_1ms(void)
unsigned int targetClockBits, currentClockBits;
unsigned int slowLoopGranularity, fastLoopGranularity;
rtems_interrupt_level level;
-
+
#ifdef DEBUG_CALIBRATE
printk( "Calibrate_loop_1ms is starting, please wait ( but not too loooong. )\n" );
-#endif
+#endif
targetClockBits = US_TO_TICK(1000);
-
+
rtems_interrupt_disable(level);
/*
* Fill up the cache to get a correct offset
*/
Timer0Reset();
readTimer0();
- /*
+ /*
* Compute the minimal offset to apply due to read counter register.
*/
offset = 0xffffffff;
@@ -437,24 +437,24 @@ Calibrate_loop_1ms(void)
while (1);
}
slowLoopGranularity = (res - offset - emptyCall)/ 10;
-
+
if (slowLoopGranularity == 0) {
printk("Problem #3 in Calibrate_loop_1ms in file libbsp/i386/pc386/timer/timer.c\n");
while (1);
}
targetClockBits += offset;
-#ifdef DEBUG_CALIBRATE
+#ifdef DEBUG_CALIBRATE
printk("offset = %u, emptyCall = %u, targetClockBits = %u\n",
offset, emptyCall, targetClockBits);
printk("slowLoopGranularity = %u fastLoopGranularity = %u\n",
slowLoopGranularity, fastLoopGranularity);
-#endif
+#endif
slowLoop1ms = (targetClockBits - emptyCall) / slowLoopGranularity;
if (slowLoop1ms != 0) {
fastLoop1ms = targetClockBits % slowLoopGranularity;
if (fastLoop1ms > emptyCall) fastLoop1ms -= emptyCall;
- }
+ }
else
fastLoop1ms = targetClockBits - emptyCall / fastLoopGranularity;
@@ -462,7 +462,7 @@ Calibrate_loop_1ms(void)
/*
* calibrate slow loop
*/
-
+
while(1)
{
int previousSign = 0; /* 0 = unset, 1 = incrementing, 2 = decrementing */
@@ -497,7 +497,7 @@ Calibrate_loop_1ms(void)
/*
* calibrate fast loop
*/
-
+
if (fastLoopGranularity != 0 ) {
while(1) {
int previousSign = 0; /* 0 = unset, 1 = incrementing, 2 = decrementing */
@@ -525,11 +525,11 @@ Calibrate_loop_1ms(void)
}
}
}
-#ifdef DEBUG_CALIBRATE
+#ifdef DEBUG_CALIBRATE
printk("slowLoop1ms = %u, fastLoop1ms = %u\n", slowLoop1ms, fastLoop1ms);
-#endif
+#endif
rtems_interrupt_enable(level);
-
+
}
/*-------------------------------------------------------------------------+
@@ -537,7 +537,7 @@ Calibrate_loop_1ms(void)
| Description: loop which waits at least timeToWait ms
| Global Variables: loop1ms
| Arguments: timeToWait
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
Wait_X_ms( unsigned int timeToWait){
diff --git a/c/src/lib/libbsp/i386/pc386/timer/timerisr.S b/c/src/lib/libbsp/i386/pc386/timer/timerisr.S
index ce5fd95239..b7afdfefee 100644
--- a/c/src/lib/libbsp/i386/pc386/timer/timerisr.S
+++ b/c/src/lib/libbsp/i386/pc386/timer/timerisr.S
@@ -43,10 +43,10 @@ BEGIN_CODE
| interrupt at maximum intervals.
| Global Variables: None.
| Arguments: standard - see RTEMS documentation.
-| Returns: standard return value - see RTEMS documentation.
+| Returns: standard return value - see RTEMS documentation.
+--------------------------------------------------------------------------*/
PUBLIC(timerisr)
-SYM (timerisr):
+SYM (timerisr):
incl Ttimer_val # another tick
pushl eax
movb $0x20, al
diff --git a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c b/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c
index d60d4d99f0..fed169eac8 100644
--- a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c
+++ b/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c
@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
unsigned long headerAddr, addr1, addr2;
int size1, size2, len1, len2, len, imageCnt, cnt;
char *ofile, *ifile, *end;
-
+
verbose = 0;
/* parse command line options */
@@ -60,13 +60,13 @@ int main(int argc, char* argv[])
return 1;
}
}
-
+
if((argc - optind) != 8 && (argc - optind) != 5)
{
usage();
return 1;
}
-
+
ofile = argv[optind];
ofp = fopen(ofile, "wb");
if(ofp == NULL)
@@ -74,15 +74,15 @@ int main(int argc, char* argv[])
fprintf(stderr, "unable to open file %s\n", ofile);
return 1;
}
-
- /*
- * Layout is very simple first 512 is header shared by all
+
+ /*
+ * Layout is very simple first 512 is header shared by all
* images, then images at 512 bytes border
*/
-
+
/* Fill buffer with 0's */
memset(buf, 0, sizeof(buf));
-
+
fwrite(buf, 1, sizeof(buf), ofp);
optind++;
@@ -100,7 +100,7 @@ int main(int argc, char* argv[])
fclose(ofp);
return 1;
}
-
+
/* Copy the first image */
optind++;
ifile = argv[optind];
@@ -183,7 +183,7 @@ int main(int argc, char* argv[])
{
/* Areas overlapped */
printf("area overlapping: \n");
- printf("header address 0x%08lx, its memory size 0x%08x\n",
+ printf("header address 0x%08lx, its memory size 0x%08x\n",
headerAddr, sizeof(buf));
printf("first image address 0x%08lx, its memory size 0x%08x\n",
addr1, size1);
@@ -198,7 +198,7 @@ int main(int argc, char* argv[])
fclose(ofp);
return 1;
}
-
+
if(optind == (argc - 1))
{
@@ -242,12 +242,12 @@ int main(int argc, char* argv[])
for(;;)
{
len = fread(buf, 1, sizeof(buf), ifp);
-
+
if(len != 0)
{
fwrite(buf, len, 1, ofp);
cnt += sizeof(buf);
-
+
if(len != sizeof(buf))
{
memset(buf, 0, sizeof(buf) - len);
@@ -287,13 +287,13 @@ int main(int argc, char* argv[])
(addr2 < addr1 && addr2 < headerAddr) ||
(addr1 > headerAddr && addr2 > (headerAddr + sizeof(buf)) &&
(addr2 + size2) <= addr1) ||
- (addr1 < headerAddr && addr2 > (addr1 + size1) &&
+ (addr1 < headerAddr && addr2 > (addr1 + size1) &&
(addr2 + size2) <= headerAddr)))
-
+
{
/* Areas overlapped */
printf("area overlapping: \n");
- printf("header address 0x%08lx, its memory size 0x%08x\n",
+ printf("header address 0x%08lx, its memory size 0x%08x\n",
headerAddr, sizeof(buf));
printf("first image address 0x%08lx, its memory size 0x%08x\n",
addr1, size1);
@@ -322,8 +322,8 @@ writeHeader:
buf[0xa] = (headerAddr >> 4) & 0xff;
buf[0xb] = (headerAddr >> 12) & 0xff;
- /*
- * Execute address in cs:ip format, which addr1
+ /*
+ * Execute address in cs:ip format, which addr1
*/
buf[0xc] = addr1 & 0xf;
buf[0xd] = 0;
@@ -361,7 +361,7 @@ writeHeader:
/* Flags, tags and lengths */
buf[0x20] = 4;
-
+
buf[0x23] = 4;
@@ -370,13 +370,13 @@ writeHeader:
buf[0x25] = (addr2 >> 8) & 0xff;
buf[0x26] = (addr2 >> 16) & 0xff;
buf[0x27] = (addr2 >> 24) & 0xff;
-
+
/* Image Length */
buf[0x28] = len2 & 0xff;
buf[0x29] = (len2 >> 8) & 0xff;
buf[0x2a] = (len2 >> 16) & 0xff;
buf[0x2b] = (len2 >> 24) & 0xff;
-
+
/* Memory Size */
buf[0x2c] = size2 & 0xff;
buf[0x2d] = (size2 >> 8) & 0xff;
@@ -392,7 +392,7 @@ writeHeader:
if(verbose)
{
- printf("header address 0x%08lx, its memory size 0x%08x\n",
+ printf("header address 0x%08lx, its memory size 0x%08x\n",
headerAddr, sizeof(buf));
printf("first image address 0x%08lx, its memory size 0x%08x\n",
addr1, size1);
diff --git a/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c b/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c
index ad0f0d7672..1e336f6f4f 100644
--- a/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c
+++ b/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c
@@ -89,7 +89,7 @@ struct wd_softc {
unsigned int port;
unsigned char *base;
unsigned long bpar;
-
+
/*
* Statistics
*/
@@ -102,7 +102,7 @@ struct wd_softc {
unsigned long rxBadCRC;
unsigned long rxOverrun;
unsigned long rxCollision;
-
+
unsigned long txInterrupts;
unsigned long txDeferred;
unsigned long txHeartbeat;
@@ -165,7 +165,7 @@ wd8003Enet_interrupt_handler (void)
if (status & (MSK_PRX+MSK_RXE)) {
outport_byte(tport+ISR, status & (MSK_PRX+MSK_RXE));
wd_softc[0].rxInterrupts++;
- rtems_event_send (wd_softc[0].rxDaemonTid, INTERRUPT_EVENT);
+ rtems_event_send (wd_softc[0].rxDaemonTid, INTERRUPT_EVENT);
}
}
@@ -209,8 +209,8 @@ wd8003Enet_initialize_hardware (struct wd_softc *sc)
if (i1 < 6)
hwaddr[i1] = cc1;
}
-
- inport_byte(tport+0x04, temp);
+
+ inport_byte(tport+0x04, temp);
outport_byte(tport+0x04, temp | 0x80); /* alternate registers */
outport_byte(tport+W83CREG, MSK_RESET); /* reset board, set buffer */
outport_byte(tport+W83CREG, 0);
@@ -219,7 +219,7 @@ wd8003Enet_initialize_hardware (struct wd_softc *sc)
outport_byte(tport+CMDR, MSK_PG0 + MSK_RD2);
cc1 = MSK_BMS + MSK_FT10; /* configure 8 or 16 bits */
- inport_byte(tport+0x07, temp) ;
+ inport_byte(tport+0x07, temp) ;
ultra = ((temp & 0xf0) == 0x20 || (temp & 0xf0) == 0x40);
if (ultra)
@@ -247,14 +247,14 @@ wd8003Enet_initialize_hardware (struct wd_softc *sc)
outport_byte(tport+CMDR, MSK_PG0 + MSK_RD2);
outport_byte(tport+CMDR, MSK_STA + MSK_RD2); /* put 8390 on line */
outport_byte(tport+RCR, MSK_AB); /* MSK_AB accept broadcast */
-
+
if (ultra) {
inport_byte(tport+0x0c, temp);
outport_byte(tport+0x0c, temp | 0x80);
outport_byte(tport+0x05, 0x80);
outport_byte(tport+0x06, 0x01);
}
-
+
/*
* Set up interrupts
*/
@@ -262,7 +262,7 @@ wd8003Enet_initialize_hardware (struct wd_softc *sc)
sc->irqInfo.on = nopOn;
sc->irqInfo.off = nopOn;
sc->irqInfo.isOn = wdIsOn;
-
+
st = BSP_install_rtems_irq_handler (&sc->irqInfo);
if (!st)
rtems_panic ("Can't attach WD interrupt handler for irq %d\n",
@@ -298,7 +298,7 @@ wd_rxDaemon (void *arg)
outport_byte(tport+CMDR, MSK_PG1 + MSK_RD2);
inport_byte(tport+CURR, current);
- outport_byte(tport+CMDR, MSK_PG0 + MSK_RD2);
+ outport_byte(tport+CMDR, MSK_PG0 + MSK_RD2);
start += 1;
if (start >= OUTPAGE){
@@ -307,7 +307,7 @@ wd_rxDaemon (void *arg)
if (current == start)
break;
-
+
shp = dp->base + 1 + (SHAPAGE * start);
next = *shp++;
len = *((short *)shp)++ - 4;
@@ -315,14 +315,14 @@ wd_rxDaemon (void *arg)
if (next >= OUTPAGE){
next = 0;
}
-
+
MGETHDR (m, M_WAIT, MT_DATA);
MCLGET (m, M_WAIT);
m->m_pkthdr.rcvif = ifp;
-
+
temp = m->m_data;
m->m_len = m->m_pkthdr.len = len - sizeof(struct ether_header);
-
+
if ((i2 = (OUTPAGE - start) * SHAPAGE - 4) < len){
memcpy(temp, shp, i2);
len -= i2;
@@ -330,18 +330,18 @@ wd_rxDaemon (void *arg)
shp = dp->base;
}
memcpy(temp, shp, len);
-
+
eh = mtod (m, struct ether_header *);
m->m_data += sizeof(struct ether_header);
ether_input (ifp, eh, m);
-
+
outport_byte(tport+BNRY, next-1);
}
-
+
/*
* Ring overwrite
*/
- if (overrun){
+ if (overrun){
outport_byte(tport+ISR, MSK_OVW); /* reset IR */
outport_byte(tport+TCR, 0); /* out of loopback */
if (resend == 1)
@@ -349,9 +349,9 @@ wd_rxDaemon (void *arg)
resend = 0;
overrun = 0;
}
-
+
outport_byte(tport+IMR, 0x15); /* re-enable IT rx */
- }
+ }
}
static void
@@ -366,16 +366,16 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
/*
* Waiting for Transmitter ready
- */
- inport_byte(tport+CMDR, txReady);
+ */
+ inport_byte(tport+CMDR, txReady);
while(txReady & MSK_TXP)
- inport_byte(tport+CMDR, txReady);
+ inport_byte(tport+CMDR, txReady);
len = 0;
shp = dp->base + (SHAPAGE * OUTPAGE);
n = m;
-
+
for (;;){
len += m->m_len;
memcpy(shp, (char *)m->m_data, m->m_len);
@@ -385,7 +385,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
}
m_freem(n);
-
+
if (len < ET_MINLEN) len = ET_MINLEN;
outport_byte(tport+TBCR0, len);
outport_byte(tport+TBCR1, (len >> 8) );
@@ -448,12 +448,12 @@ wd_init (void *arg)
struct ifnet *ifp = &sc->arpcom.ac_if;
if (sc->txDaemonTid == 0) {
-
+
/*
* Set up WD hardware
*/
wd8003Enet_initialize_hardware (sc);
-
+
/*
* Start driver tasks
*/
@@ -555,7 +555,7 @@ wd_ioctl (struct ifnet *ifp, int command, caddr_t data)
case SIO_RTEMS_SHOW_STATS:
wd_stats (sc);
break;
-
+
/*
* FIXME: All sorts of multicast commands need to be added here!
*/
@@ -625,7 +625,7 @@ rtems_wd_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
sc->bpar = 0xD0000;
sc->base = (unsigned char*) 0xD0000;
}
-
+
sc->acceptBroadcast = !config->ignore_broadcast;
/*
diff --git a/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c b/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c
index 407544a388..e36f5e2ea4 100644
--- a/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c
+++ b/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c
@@ -19,7 +19,7 @@ int putDebugChar(int ch); /* write a single character */
int getDebugChar(void); /* read and return a single char */
/* assign an exception handler */
-void exceptionHandler(int, void (*handler)(void));
+void exceptionHandler(int, void (*handler)(void));
void BSP_loop(int uart);
@@ -37,7 +37,7 @@ i386_stub_glue_init(int uart)
uart_current = uart;
- BSP_uart_init(uart, 38400, CHR_8_BITS, 0, 0, 0);
+ BSP_uart_init(uart, 38400, CHR_8_BITS, 0, 0, 0);
}
void BSP_uart_on(const rtems_raw_irq_connect_data* used)
@@ -57,7 +57,7 @@ int BSP_uart_isOn(const rtems_raw_irq_connect_data* used)
/*
- * In order to have a possibility to break into
+ * In order to have a possibility to break into
* running program, one has to call this function
*/
void i386_stub_glue_init_breakin(void)
@@ -75,13 +75,13 @@ void i386_stub_glue_init_breakin(void)
uart_raw_irq_data.idtIndex = BSP_UART_COM2_IRQ + BSP_IRQ_VECTOR_BASE;
}
- if(!i386_get_current_idt_entry(&uart_raw_irq_data))
+ if(!i386_get_current_idt_entry(&uart_raw_irq_data))
{
printk("cannot get idt entry\n");
rtems_fatal_error_occurred(1);
}
- if(!i386_delete_idt_entry(&uart_raw_irq_data))
+ if(!i386_delete_idt_entry(&uart_raw_irq_data))
{
printk("cannot delete idt entry\n");
rtems_fatal_error_occurred(1);
@@ -103,12 +103,12 @@ void i386_stub_glue_init_breakin(void)
uart_raw_irq_data.hdl = BSP_uart_dbgisr_com2;
}
- if (!i386_set_idt_entry (&uart_raw_irq_data))
+ if (!i386_set_idt_entry (&uart_raw_irq_data))
{
printk("raw exception handler connection failed\n");
rtems_fatal_error_occurred(1);
}
-
+
/* Enable interrupts */
BSP_uart_intr_ctrl(uart_current, BSP_UART_INTR_CTRL_GDB);
@@ -146,13 +146,13 @@ void exceptionHandler(int vector, void (*handler)(void))
excep_raw_irq_data.idtIndex = vector;
- if(!i386_get_current_idt_entry(&excep_raw_irq_data))
+ if(!i386_get_current_idt_entry(&excep_raw_irq_data))
{
printk("cannot get idt entry\n");
rtems_fatal_error_occurred(1);
}
- if(!i386_delete_idt_entry(&excep_raw_irq_data))
+ if(!i386_delete_idt_entry(&excep_raw_irq_data))
{
printk("cannot delete idt entry\n");
rtems_fatal_error_occurred(1);
diff --git a/c/src/lib/libbsp/i386/shared/comm/i386-stub.c b/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
index f35f16d2b7..b55d5302fb 100644
--- a/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
+++ b/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
@@ -5,17 +5,17 @@
*/
/****************************************************************************
-
+
THIS SOFTWARE IS NOT COPYRIGHTED
-
+
HP offers the following for use in the public domain. HP makes no
warranty with regard to the software or it's performance and the
user accepts the software "AS IS" with all faults.
-
+
HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
+
****************************************************************************/
/****************************************************************************
@@ -446,13 +446,13 @@ asm (" movl stackPtr, %esp"); /* move to remcom stack area */
asm (" pushl %eax"); /* push exception onto stack */
asm (" call handle_exception"); /* this never returns */
-void
+void
_returnFromException (void)
{
return_to_prog ();
}
-int
+int
hex (char ch)
{
if ((ch >= 'a') && (ch <= 'f'))
@@ -466,7 +466,7 @@ hex (char ch)
/* scan for the sequence $<data>#<checksum> */
-void
+void
getpacket (char *buffer)
{
unsigned char checksum;
@@ -531,7 +531,7 @@ getpacket (char *buffer)
/* send the packet in buffer. */
-void
+void
putpacket (char *buffer)
{
unsigned char checksum;
@@ -566,7 +566,7 @@ char remcomInBuffer[BUFMAX];
char remcomOutBuffer[BUFMAX];
static short error;
-void
+void
debug_error (
char *format,
char *parm
@@ -656,7 +656,7 @@ hex2mem (char *buf, char *mem, int count, int may_fault)
/* this function takes the 386 exception vector and attempts to
translate this number into a unix compatible signal value */
-int
+int
computeSignal (int exceptionVector)
{
int sigval;
@@ -717,7 +717,7 @@ computeSignal (int exceptionVector)
/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
/* RETURN NUMBER OF CHARS PROCESSED */
/**********************************************/
-int
+int
hexToInt (char **ptr, int *intValue)
{
int numChars = 0;
@@ -745,7 +745,7 @@ hexToInt (char **ptr, int *intValue)
/*
* This function does all command procesing for interfacing to gdb.
*/
-void
+void
handle_exception (int exceptionVector)
{
int sigval;
@@ -929,7 +929,7 @@ handle_exception (int exceptionVector)
/* this function is used to set up exception handlers for tracing and
breakpoints */
-void
+void
set_debug_traps (void)
{
extern void remcomHandler ();
@@ -965,7 +965,7 @@ set_debug_traps (void)
otherwise as a quick means to stop program execution and "break" into
the debugger. */
-void
+void
breakpoint (void)
{
if (initialized)
diff --git a/c/src/lib/libbsp/i386/shared/comm/i386_io.h b/c/src/lib/libbsp/i386/shared/comm/i386_io.h
index 7d2612ec11..8823750306 100644
--- a/c/src/lib/libbsp/i386/shared/comm/i386_io.h
+++ b/c/src/lib/libbsp/i386/shared/comm/i386_io.h
@@ -3,16 +3,19 @@
// $Header$
//
// Copyright (c) 2000 - Rosimildo da Silva. All Rights Reserved.
-//
+//
// MODULE DESCRIPTION:
-//
+//
// IO Functions for the PC platform equivalent to DOS/Linux. They make
-// eaiser the porting of code from these platforms.
+// eaiser the porting of code from these platforms.
//
// by: Rosimildo da Silva: rdasilva@connecttel.com
//
// MODIFICATION/HISTORY:
// $Log$
+// Revision 1.2 2004/04/15 13:26:12 ralf
+// Remove stray white spaces.
+//
// Revision 1.1 2000/08/30 08:18:56 joel
// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
//
diff --git a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c
index fd096fe9a6..cb219d5f87 100644
--- a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c
+++ b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c
@@ -7,7 +7,7 @@
* as /dev/ttyS1 for COM1 and /dev/ttyS2 as COM2. If one of the ports
* is used as the console, this driver would fail to initialize.
*
- * This code was based on the console driver. It is based on the
+ * This code was based on the console driver. It is based on the
* current termios framework. This is just a shell around the
* termios support.
*
@@ -18,6 +18,11 @@
* MODIFICATION/HISTORY:
*
* $Log$
+ * Revision 1.5 2001/08/16 20:52:05 joel
+ * 2001-08-16 Mike Siers <mikes@poliac.com>
+ *
+ * * comm/tty_drv.c, comm/uart.c: Correct some minor cut and paste bugs.
+ *
* Revision 1.4 2001/07/03 17:56:32 joel
* 2001-07-03 Mike Seirs <mike@poliac.com>
*
@@ -88,8 +93,8 @@ extern void rtems_set_waiting_id_comx( int port, rtems_id id, rtems_event_set e
/*
* Interrupt structure for tty1
*/
-static rtems_irq_connect_data tty1_isr_data =
-{
+static rtems_irq_connect_data tty1_isr_data =
+{
BSP_UART_COM1_IRQ,
BSP_uart_termios_isr_com1,
isr_on,
@@ -99,8 +104,8 @@ static rtems_irq_connect_data tty1_isr_data =
/*
* Interrupt structure for tty2
*/
-static rtems_irq_connect_data tty2_isr_data =
-{
+static rtems_irq_connect_data tty2_isr_data =
+{
BSP_UART_COM2_IRQ,
BSP_uart_termios_isr_com2,
isr_on,
@@ -112,7 +117,7 @@ isr_on(const rtems_irq_connect_data *unused)
{
return;
}
-
+
static void
isr_off(const rtems_irq_connect_data *unused)
{
@@ -153,7 +158,7 @@ tty1_initialize(rtems_device_major_number major,
* Set up TERMIOS
*/
rtems_termios_initialize();
-
+
/*
* Do device-specific initialization
*/
@@ -195,7 +200,7 @@ tty1_open(rtems_device_major_number major,
{
rtems_status_code status;
#ifndef USE_TASK_DRIVEN
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
tty1_last_close, /* lastClose */
@@ -207,7 +212,7 @@ tty1_open(rtems_device_major_number major,
TERMIOS_IRQ_DRIVEN /* outputUsesInterrupts */
};
#else
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
NULL, /* lastClose */
@@ -230,7 +235,7 @@ tty1_open(rtems_device_major_number major,
/*
* Pass data area info down to driver
*/
- BSP_uart_termios_set( BSP_UART_COM1,
+ BSP_uart_termios_set( BSP_UART_COM1,
((rtems_libio_open_close_args_t *)arg)->iop->data1 );
/* Enable interrupts on channel */
BSP_uart_intr_ctrl( BSP_UART_COM1, BSP_UART_INTR_CTRL_TERMIOS);
@@ -247,10 +252,10 @@ tty_close(rtems_device_major_number major,
{
return (rtems_termios_close (arg));
-
+
} /* tty_close */
-
+
/*
* TTY device driver READ entry point.
* Read characters from the tty device.
@@ -262,7 +267,7 @@ tty_read(rtems_device_major_number major,
{
return rtems_termios_read (arg);
} /* tty_read */
-
+
/*
* TTY device driver WRITE entry point.
@@ -274,7 +279,7 @@ tty_write(rtems_device_major_number major,
void * arg)
{
return rtems_termios_write (arg);
-
+
} /* tty_write */
/*
@@ -282,9 +287,9 @@ tty_write(rtems_device_major_number major,
* routine to handle both devices.
*/
static rtems_device_driver tty_control( int port, void *arg )
-{
+{
rtems_libio_ioctl_args_t *args = arg;
- switch( args->command )
+ switch( args->command )
{
default:
return rtems_termios_ioctl (arg);
@@ -299,12 +304,12 @@ static rtems_device_driver tty_control( int port, void *arg )
/*
* Handle ioctl request for ttyS1.
*/
-rtems_device_driver
+rtems_device_driver
tty1_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
return tty_control( BSP_UART_COM1, arg );
}
@@ -314,45 +319,45 @@ conSetAttr(int port, int minor, const struct termios *t)
{
unsigned long baud, databits, parity, stopbits;
- switch (t->c_cflag & CBAUD)
+ switch (t->c_cflag & CBAUD)
{
- case B50:
+ case B50:
baud = 50;
break;
- case B75:
- baud = 75;
+ case B75:
+ baud = 75;
break;
- case B110:
- baud = 110;
+ case B110:
+ baud = 110;
break;
- case B134:
- baud = 134;
+ case B134:
+ baud = 134;
break;
- case B150:
- baud = 150;
+ case B150:
+ baud = 150;
break;
case B200:
- baud = 200;
+ baud = 200;
break;
- case B300:
+ case B300:
baud = 300;
break;
- case B600:
- baud = 600;
+ case B600:
+ baud = 600;
break;
- case B1200:
+ case B1200:
baud = 1200;
break;
- case B1800:
- baud = 1800;
+ case B1800:
+ baud = 1800;
break;
- case B2400:
+ case B2400:
baud = 2400;
break;
- case B4800:
+ case B4800:
baud = 4800;
break;
- case B9600:
+ case B9600:
baud = 9600;
break;
case B19200:
@@ -361,7 +366,7 @@ conSetAttr(int port, int minor, const struct termios *t)
case B38400:
baud = 38400;
break;
- case B57600:
+ case B57600:
baud = 57600;
break;
case B115200:
@@ -387,7 +392,7 @@ conSetAttr(int port, int minor, const struct termios *t)
/* No parity */
parity = 0;
}
-
+
switch (t->c_cflag & CSIZE) {
case CS5: databits = CHR_5_BITS; break;
case CS6: databits = CHR_6_BITS; break;
@@ -443,7 +448,7 @@ tty2_initialize(rtems_device_major_number major,
* Set up TERMIOS
*/
rtems_termios_initialize();
-
+
/*
* Do device-specific initialization
*/
@@ -485,7 +490,7 @@ tty2_open(rtems_device_major_number major,
{
rtems_status_code status;
#ifndef USE_TASK_DRIVEN
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
tty2_last_close, /* lastClose */
@@ -497,7 +502,7 @@ tty2_open(rtems_device_major_number major,
TERMIOS_IRQ_DRIVEN /* outputUsesInterrupts */
};
#else
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
NULL, /* lastClose */
@@ -520,7 +525,7 @@ tty2_open(rtems_device_major_number major,
/*
* Pass data area info down to driver
*/
- BSP_uart_termios_set( BSP_UART_COM2,
+ BSP_uart_termios_set( BSP_UART_COM2,
((rtems_libio_open_close_args_t *)arg)->iop->data1 );
/* Enable interrupts on channel */
BSP_uart_intr_ctrl( BSP_UART_COM2, BSP_UART_INTR_CTRL_TERMIOS);
@@ -530,12 +535,12 @@ tty2_open(rtems_device_major_number major,
/*
* Handle ioctl request for TTY2
*/
-rtems_device_driver
+rtems_device_driver
tty2_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
return tty_control( BSP_UART_COM2, arg );
}
diff --git a/c/src/lib/libbsp/i386/shared/comm/tty_drv.h b/c/src/lib/libbsp/i386/shared/comm/tty_drv.h
index c4f017c8c6..d84dd4d3a1 100644
--- a/c/src/lib/libbsp/i386/shared/comm/tty_drv.h
+++ b/c/src/lib/libbsp/i386/shared/comm/tty_drv.h
@@ -5,7 +5,7 @@
* $Header$
*
* Copyright (c) 1999 ConnectTel, Inc. All Rights Reserved.
- *
+ *
* MODULE DESCRIPTION: Prototype routines for the ttySx driver.
*
* by: Rosimildo da Silva:
@@ -15,6 +15,9 @@
* MODIFICATION/HISTORY:
*
* $Log$
+ * Revision 1.2 2004/04/15 13:26:12 ralf
+ * Remove stray white spaces.
+ *
* Revision 1.1 2000/08/30 08:18:56 joel
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
*
diff --git a/c/src/lib/libbsp/i386/shared/comm/uart.c b/c/src/lib/libbsp/i386/shared/comm/uart.c
index d8d0a1b29b..bc5e805c4e 100644
--- a/c/src/lib/libbsp/i386/shared/comm/uart.c
+++ b/c/src/lib/libbsp/i386/shared/comm/uart.c
@@ -33,10 +33,10 @@ struct uart_data
static struct uart_data uart_data[2];
-/*
+/*
* Macros to read/write register of uart, if configuration is
* different just rewrite these macros
- */
+ */
static inline unsigned char
uread(int uart, unsigned int reg)
@@ -52,7 +52,7 @@ uread(int uart, unsigned int reg)
return val;
}
-static inline void
+static inline void
uwrite(int uart, int reg, unsigned int val)
{
if (uart == 0) {
@@ -87,13 +87,13 @@ uartError(int uart)
inline void uartError(int uart)
{
unsigned char uartStatus;
-
+
uartStatus = uread(uart, LSR);
uartStatus = uread(uart, RBR);
}
#endif
-/*
+/*
* Uart initialization, it is hardcoded to 8 bit, no parity,
* one stop bit, FIFO, things to be changed
* are baud rate and nad hw flow control,
@@ -111,10 +111,10 @@ BSP_uart_init
)
{
unsigned char tmp;
-
+
/* Sanity check */
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
+
switch(baud)
{
case 50:
@@ -135,23 +135,23 @@ BSP_uart_init
assert(0);
return;
}
-
+
/* Set DLAB bit to 1 */
uwrite(uart, LCR, DLAB);
-
+
/* Set baud rate */
- uwrite(uart, DLL, (BSPBaseBaud/baud) & 0xff);
- uwrite(uart, DLM, ((BSPBaseBaud/baud) >> 8) & 0xff);
+ uwrite(uart, DLL, (BSPBaseBaud/baud) & 0xff);
+ uwrite(uart, DLM, ((BSPBaseBaud/baud) >> 8) & 0xff);
/* 8-bit, no parity , 1 stop */
uwrite(uart, LCR, databits | parity | stopbits);
-
+
/* Set DTR, RTS and OUT2 high */
uwrite(uart, MCR, DTR | RTS | OUT_2);
/* Enable FIFO */
- uwrite(uart, FCR, FIFO_EN | XMIT_RESET | RCV_RESET | RECEIVE_FIFO_TRIGGER12);
+ uwrite(uart, FCR, FIFO_EN | XMIT_RESET | RCV_RESET | RECEIVE_FIFO_TRIGGER12);
/* Disable Interrupts */
uwrite(uart, IER, 0);
@@ -170,12 +170,12 @@ BSP_uart_init
return;
}
-/*
+/*
* Set baud
*/
void
-BSP_uart_set_baud(
+BSP_uart_set_baud(
int uart,
unsigned long baud
)
@@ -183,7 +183,7 @@ BSP_uart_set_baud(
/* Sanity check */
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
- BSP_uart_set_attributes( uart, baud, uart_data[uart].databits,
+ BSP_uart_set_attributes( uart, baud, uart_data[uart].databits,
uart_data[uart].parity, uart_data[uart].stopbits );
}
@@ -205,10 +205,10 @@ BSP_uart_set_attributes
/* Sanity check */
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- /*
+
+ /*
* This function may be called whenever TERMIOS parameters
- * are changed, so we have to make sure that baud change is
+ * are changed, so we have to make sure that baud change is
* indeed required
*/
@@ -227,14 +227,14 @@ BSP_uart_set_attributes
uwrite(uart, MCR, mcr);
uwrite(uart, IER, ier);
-
+
return;
}
/*
- * Enable/disable interrupts
+ * Enable/disable interrupts
*/
-void
+void
BSP_uart_intr_ctrl(int uart, int cmd)
{
int iStatus = (int)INTERRUPT_DISABLE;
@@ -262,7 +262,7 @@ BSP_uart_intr_ctrl(int uart, int cmd)
uart_data[uart].ier = iStatus;
uwrite(uart, IER, iStatus);
-
+
return;
}
@@ -270,7 +270,7 @@ void
BSP_uart_throttle(int uart)
{
unsigned int mcr;
-
+
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
if(!uart_data[uart].hwFlow)
@@ -312,12 +312,12 @@ BSP_uart_unthrottle(int uart)
* Status function, -1 if error
* detected, 0 if no received chars available,
* 1 if received char available, 2 if break
- * is detected, it will eat break and error
- * chars. It ignores overruns - we cannot do
+ * is detected, it will eat break and error
+ * chars. It ignores overruns - we cannot do
* anything about - it execpt count statistics
* and we are not counting it.
*/
-int
+int
BSP_uart_polled_status(int uart)
{
unsigned char val;
@@ -335,7 +335,7 @@ BSP_uart_polled_status(int uart)
if((val & (DR | OE | FE)) == 1)
{
- /* No error, character present */
+ /* No error, character present */
return BSP_UART_STATUS_CHAR;
}
@@ -345,12 +345,12 @@ BSP_uart_polled_status(int uart)
return BSP_UART_STATUS_NOCHAR;
}
- /*
+ /*
* Framing or parity error
* eat character
*/
uread(uart, RBR);
-
+
return BSP_UART_STATUS_ERROR;
}
@@ -358,14 +358,14 @@ BSP_uart_polled_status(int uart)
/*
* Polled mode write function
*/
-void
+void
BSP_uart_polled_write(int uart, int val)
{
unsigned char val1;
-
+
/* Sanity check */
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
+
for(;;)
{
if((val1=uread(uart, LSR)) & THRE)
@@ -386,7 +386,7 @@ BSP_uart_polled_write(int uart, int val)
}
uwrite(uart, THR, val & 0xff);
-
+
/*
* Wait for character to be transmitted.
* This ensures that printk and printf play nicely together
@@ -413,16 +413,16 @@ BSP_output_char_via_serial(int val)
if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
}
-/*
+/*
* Polled mode read function
*/
-int
+int
BSP_uart_polled_read(int uart)
{
unsigned char val;
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
+
for(;;)
{
if(uread(uart, LSR) & DR)
@@ -430,13 +430,13 @@ BSP_uart_polled_read(int uart)
break;
}
}
-
+
val = uread(uart, RBR);
return (int)(val & 0xff);
}
-unsigned
+unsigned
BSP_poll_char_via_serial()
{
return BSP_uart_polled_read(BSPConsolePort);
@@ -480,7 +480,7 @@ void uart_set_driver_handler( int port, void ( *handler )( void *, char *, int
/*
- * Set channel parameters
+ * Set channel parameters
*/
void
BSP_uart_termios_set(int uart, void *ttyp)
@@ -488,7 +488,7 @@ BSP_uart_termios_set(int uart, void *ttyp)
struct rtems_termios_tty *p = (struct rtems_termios_tty *)ttyp;
unsigned char val;
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
+
if(uart == BSP_UART_COM1)
{
uart_data[uart].ioMode = p->device.outputUsesInterrupts;
@@ -504,7 +504,7 @@ BSP_uart_termios_set(int uart, void *ttyp)
}
termios_tx_active_com1 = 0;
termios_ttyp_com1 = ttyp;
- termios_tx_hold_com1 = 0;
+ termios_tx_hold_com1 = 0;
termios_tx_hold_valid_com1 = 0;
}
else
@@ -522,7 +522,7 @@ BSP_uart_termios_set(int uart, void *ttyp)
}
termios_tx_active_com2 = 0;
termios_ttyp_com2 = ttyp;
- termios_tx_hold_com2 = 0;
+ termios_tx_hold_com2 = 0;
termios_tx_hold_valid_com2 = 0;
}
@@ -657,7 +657,7 @@ BSP_uart_termios_isr_com1(void)
for(;;)
{
vect = uread(BSP_UART_COM1, IIR) & 0xf;
-
+
switch(vect)
{
case MODEM_STATUS :
@@ -690,7 +690,7 @@ BSP_uart_termios_isr_com1(void)
if( driver_input_handler_com1 )
{
driver_input_handler_com1( termios_ttyp_com1, (char *)buf, off );
- }
+ }
else
{
/* Update rx buffer */
@@ -699,9 +699,9 @@ BSP_uart_termios_isr_com1(void)
}
return;
case TRANSMITTER_HODING_REGISTER_EMPTY :
- /*
- * TX holding empty: we have to disable these interrupts
- * if there is nothing more to send.
+ /*
+ * TX holding empty: we have to disable these interrupts
+ * if there is nothing more to send.
*/
/* If nothing else to send disable interrupts */
@@ -740,7 +740,7 @@ BSP_uart_termios_isr_com1(void)
}
}
}
-
+
void
BSP_uart_termios_isr_com2()
{
@@ -753,7 +753,7 @@ BSP_uart_termios_isr_com2()
for(;;)
{
vect = uread(BSP_UART_COM2, IIR) & 0xf;
-
+
switch(vect)
{
case MODEM_STATUS :
@@ -786,7 +786,7 @@ BSP_uart_termios_isr_com2()
if( driver_input_handler_com2 )
{
driver_input_handler_com2( termios_ttyp_com2, (char *)buf, off );
- }
+ }
else
{
rtems_termios_enqueue_raw_characters(termios_ttyp_com2, (char *)buf, off);
@@ -794,8 +794,8 @@ BSP_uart_termios_isr_com2()
}
return;
case TRANSMITTER_HODING_REGISTER_EMPTY :
- /*
- * TX holding empty: we have to disable these interrupts
+ /*
+ * TX holding empty: we have to disable these interrupts
* if there is nothing more to send.
*/
@@ -835,13 +835,13 @@ BSP_uart_termios_isr_com2()
}
}
}
-
-
-/* ================= GDB support ===================*/
+
+
+/* ================= GDB support ===================*/
static int sav[4] __attribute__ ((unused));
/*
- * Interrupt service routine for COM1 - all,
+ * Interrupt service routine for COM1 - all,
* it does it check whether ^C is received
* if yes it will flip TF bit before returning
* Note: it should be installed as raw interrupt
@@ -858,7 +858,7 @@ asm (" movl %edx, sav + 8"); /* Save edx */
asm (" movl $0, %ebx"); /* Clear flag */
-/*
+/*
* We know that only receive related interrupts
* are available, eat chars
*/
@@ -873,7 +873,7 @@ asm (" inb %dx, %al"); /* Get input character */
asm (" cmpb $3, %al");
asm (" jne uart_dbgisr_com1_1");
-/* ^C received, set flag */
+/* ^C received, set flag */
asm (" movl $1, %ebx");
asm (" jmp uart_dbgisr_com1_1");
@@ -920,10 +920,10 @@ asm (" iret"); /* Done */
/*
- * Interrupt service routine for COM2 - all,
+ * Interrupt service routine for COM2 - all,
* it does it check whether ^C is received
* if yes it will flip TF bit before returning
- * Note: it has to be installed as raw interrupt
+ * Note: it has to be installed as raw interrupt
* handler
*/
asm (".p2align 4");
@@ -936,7 +936,7 @@ asm (" movl %edx, sav + 8"); /* Save edx */
asm (" movl $0, %ebx"); /* Clear flag */
-/*
+/*
* We know that only receive related interrupts
* are available, eat chars
*/
@@ -951,7 +951,7 @@ asm (" inb %dx, %al"); /* Get input character */
asm (" cmpb $3, %al");
asm (" jne uart_dbgisr_com2_1");
-/* ^C received, set flag */
+/* ^C received, set flag */
asm (" movl $1, %ebx");
asm (" jmp uart_dbgisr_com2_1");
diff --git a/c/src/lib/libbsp/i386/shared/comm/uart.h b/c/src/lib/libbsp/i386/shared/comm/uart.h
index 5f7ceb70a7..05370c56dd 100644
--- a/c/src/lib/libbsp/i386/shared/comm/uart.h
+++ b/c/src/lib/libbsp/i386/shared/comm/uart.h
@@ -38,7 +38,7 @@ extern int BSPConsolePort;
extern int BSPBaseBaud;
/*
* Command values for BSP_uart_intr_ctrl(),
- * values are strange in order to catch errors
+ * values are strange in order to catch errors
* with assert
*/
#define BSP_UART_INTR_CTRL_DISABLE (0)
diff --git a/c/src/lib/libbsp/i386/shared/irq/idt.c b/c/src/lib/libbsp/i386/shared/irq/idt.c
index ea6490f157..a81c6358c6 100644
--- a/c/src/lib/libbsp/i386/shared/irq/idt.c
+++ b/c/src/lib/libbsp/i386/shared/irq/idt.c
@@ -30,9 +30,9 @@ void create_interrupt_gate_descriptor (interrupt_gate_descriptor* idtEntry,
rtems_raw_irq_hdl hdl)
{
idtEntry->low_offsets_bits = (((unsigned) hdl) & 0xffff);
- idtEntry->segment_selector = i386_get_cs();
+ idtEntry->segment_selector = i386_get_cs();
idtEntry->fixed_value_bits = 0;
- idtEntry->gate_type = 0xe;
+ idtEntry->gate_type = 0xe;
idtEntry->privilege = 0;
idtEntry->present = 1;
idtEntry->high_offsets_bits = ((((unsigned) hdl) >> 16) & 0xffff);
@@ -45,15 +45,15 @@ rtems_raw_irq_hdl get_hdl_from_vector(rtems_vector_offset index)
unsigned limit;
i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
+
/* Convert limit into number of entries */
limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
+
if(index >= limit) {
return 0;
}
- * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits |
+ * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits |
(idt_entry_tbl[index].high_offsets_bits << 16));
return hdl;
}
@@ -64,7 +64,7 @@ int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq)
unsigned limit;
unsigned int level;
-
+
i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
/* Convert limit into number of entries */
@@ -85,11 +85,11 @@ int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq)
}
_CPU_ISR_Disable(level);
-
+
raw_irq_table [irq->idtIndex] = *irq;
create_interrupt_gate_descriptor (&idt_entry_tbl[irq->idtIndex], irq->hdl);
irq->on(irq);
-
+
_CPU_ISR_Enable(level);
return 1;
}
@@ -102,7 +102,7 @@ void _CPU_ISR_install_vector (unsigned vector,
unsigned limit;
interrupt_gate_descriptor new;
unsigned int level;
-
+
i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
/* Convert limit into number of entries */
@@ -120,7 +120,7 @@ void _CPU_ISR_install_vector (unsigned vector,
_CPU_ISR_Enable(level);
}
-
+
int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq)
{
interrupt_gate_descriptor* idt_entry_tbl;
@@ -135,9 +135,9 @@ int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq)
return 0;
}
raw_irq_table [irq->idtIndex].hdl = get_hdl_from_vector(irq->idtIndex);
-
+
*irq = raw_irq_table [irq->idtIndex];
-
+
return 1;
}
@@ -146,7 +146,7 @@ int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq)
interrupt_gate_descriptor* idt_entry_tbl;
unsigned limit;
unsigned int level;
-
+
i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
/* Convert limit into number of entries */
@@ -170,12 +170,12 @@ int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq)
idt_entry_tbl[irq->idtIndex] = default_idt_entry;
irq->off(irq);
-
+
raw_irq_table[irq->idtIndex] = default_raw_irq_entry;
raw_irq_table[irq->idtIndex].idtIndex = irq->idtIndex;
_CPU_ISR_Enable(level);
-
+
return 1;
}
@@ -188,12 +188,12 @@ int i386_init_idt (rtems_raw_irq_global_settings* config)
unsigned i;
unsigned level;
interrupt_gate_descriptor* idt_entry_tbl;
-
+
i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
/* Convert limit into number of entries */
limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
+
if (config->idtSize != limit) {
return 0;
}
@@ -241,7 +241,7 @@ int i386_set_gdt_entry (unsigned short segment_selector, unsigned base,
unsigned int limit_adjusted;
segment_descriptors* gdt_entry_tbl;
-
+
i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit);
if (segment_selector > limit) {
@@ -283,6 +283,6 @@ int i386_set_gdt_entry (unsigned short segment_selector, unsigned base,
: "=r" (tmp_segment)
: "0" (tmp_segment)
);
-
+
return 1;
}
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.c b/c/src/lib/libbsp/i386/shared/irq/irq.c
index ad04ac314e..1fae59f777 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.c
@@ -60,7 +60,7 @@ rtems_i8259_masks i8259s_cache = 0xFFFB;
| Description: Mask IRQ line in appropriate PIC chip.
| Global Variables: i8259s_cache
| Arguments: vector_offset - number of IRQ line to mask.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine)
{
@@ -71,12 +71,12 @@ int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine)
((int)irqLine > BSP_MAX_OFFSET )
)
return 1;
-
+
_CPU_ISR_Disable(level);
-
+
mask = 1 << irqLine;
i8259s_cache |= mask;
-
+
if (irqLine < 8)
{
outport_byte(PIC_MASTER_IMR_IO_PORT, i8259s_cache & 0xff);
@@ -88,14 +88,14 @@ int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine)
_CPU_ISR_Enable (level);
return 0;
-}
+}
/*-------------------------------------------------------------------------+
| Function: BSP_irq_enable_at_i8259s
| Description: Unmask IRQ line in appropriate PIC chip.
| Global Variables: i8259s_cache
| Arguments: irqLine - number of IRQ line to mask.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine)
{
@@ -108,10 +108,10 @@ int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine)
return 1;
_CPU_ISR_Disable(level);
-
+
mask = ~(1 << irqLine);
i8259s_cache &= mask;
-
+
if (irqLine < 8)
{
outport_byte(PIC_MASTER_IMR_IO_PORT, i8259s_cache & 0xff);
@@ -137,14 +137,14 @@ int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine)
mask = (1 << irqLine);
return (~(i8259s_cache & mask));
}
-
+
/*-------------------------------------------------------------------------+
| Function: BSP_irq_ack_at_i8259s
| Description: Signal generic End Of Interrupt (EOI) to appropriate PIC.
| Global Variables: None.
| Arguments: irqLine - number of IRQ line to acknowledge.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine)
{
@@ -165,7 +165,7 @@ int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine)
/*
* ------------------------ RTEMS Irq helper functions ----------------
*/
-
+
/*
* Caution : this function assumes the variable "internal_config"
* is already set and that the tables it contains are still valid
@@ -224,7 +224,7 @@ static int isValidInterrupt(int irq)
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
unsigned int level;
-
+
if (!isValidInterrupt(irq->name)) {
return 0;
}
@@ -257,7 +257,7 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
* Enable interrupt on device
*/
irq->on(irq);
-
+
_CPU_ISR_Enable(level);
return 1;
@@ -280,7 +280,7 @@ int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
unsigned int level;
-
+
if (!isValidInterrupt(irq->name)) {
return 0;
}
@@ -313,7 +313,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
rtems_hdl_tbl[irq->name] = default_rtems_entry;
current_irq[irq->name] = default_rtems_entry.hdl;
-
+
_CPU_ISR_Enable(level);
return 1;
@@ -363,7 +363,7 @@ int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
{
*config = internal_config;
return 0;
-}
+}
void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx)
{
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.h b/c/src/lib/libbsp/i386/shared/irq/irq.h
index fa82c0233d..3a1add8355 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.h
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.h
@@ -28,7 +28,7 @@ extern "C" {
/*
* Include some preprocessor value also used by assember code
*/
-
+
#include <irq_asm.h>
#include <rtems.h>
/*-------------------------------------------------------------------------+
@@ -37,7 +37,7 @@ extern "C" {
typedef enum {
/* Base vector for our IRQ handlers. */
- BSP_IRQ_VECTOR_BASE = BSP_ASM_IRQ_VECTOR_BASE,
+ BSP_IRQ_VECTOR_BASE = BSP_ASM_IRQ_VECTOR_BASE,
BSP_IRQ_LINES_NUMBER = 16,
BSP_LOWEST_OFFSET = 0,
BSP_MAX_OFFSET = BSP_IRQ_LINES_NUMBER - 1,
@@ -46,7 +46,7 @@ typedef enum {
* NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE
* 2) The same name should be defined on all architecture
* so that handler connexion can be unchanged.
- */
+ */
BSP_PERIODIC_TIMER = 0,
BSP_KEYBOARD = 1,
@@ -56,11 +56,11 @@ typedef enum {
BSP_UART_COM1_IRQ = 4,
BSP_RT_TIMER1 = 8,
-
+
BSP_RT_TIMER3 = 10
} rtems_irq_symbolic_name;
-
+
/*
@@ -94,9 +94,9 @@ typedef struct __rtems_irq_connect_data__ {
* It is usually called immediately AFTER connecting the interrupt handler.
* RTEMS may well need such a function when restoring normal interrupt
* processing after a debug session.
- *
+ *
*/
- rtems_irq_enable on;
+ rtems_irq_enable on;
/*
* function for disabling interrupts at device level (ONLY!).
* The code will disable it at i8259s level. RATIONALE : anyway
@@ -132,7 +132,7 @@ typedef struct {
rtems_irq_symbolic_name irqBase;
/*
* software priorities associated with interrupts.
- * if irqPrio [i] > intrPrio [j] it means that
+ * if irqPrio [i] > intrPrio [j] it means that
* interrupt handler hdl connected for interrupt name i
* will not be interrupted by the handler connected for interrupt j
* The interrupt source will be physically masked at i8259 level.
@@ -209,7 +209,7 @@ int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine);
* 4) perform rescheduling when necessary,
* 5) restore the C scratch registers...
* 6) restore initial execution flow
- *
+ *
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
@@ -252,7 +252,7 @@ int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config);
* (Re) get info on current RTEMS interrupt management.
*/
int BSP_rtems_irq_mngt_get(rtems_irq_global_settings**);
-
+
#ifdef __cplusplus
}
#endif
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
index a4bc1a2299..9c5e327379 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
@@ -15,8 +15,8 @@
#include <irq_asm.h>
BEGIN_CODE
-
-SYM (_ISR_Handler):
+
+SYM (_ISR_Handler):
/*
* Before this was point is reached the vectors unique
* entry point did the following:
@@ -77,7 +77,7 @@ SYM (_ISR_Handler):
outb $PIC_SLAVE_COMMAND_IO_PORT
.master:
outb $PIC_MASTER_COMMAND_IO_PORT
-
+
.check_stack_switch:
pushl ebp
movl esp, ebp /* ebp = previous stack pointer */
@@ -100,12 +100,12 @@ nested:
* interrupt source is now masked via i8259
*/
sti
-
+
/*
* ECX is preloaded with the vector number but it is a scratch register
* so we must save it again.
*/
-
+
pushl ecx /* push vector number */
mov SYM (current_irq) (,ecx,4),eax
/* eax = Users handler */
@@ -129,8 +129,8 @@ nested:
outb $PIC_MASTER_IMR_IO_PORT
movb ah, al
outb $PIC_SLAVE_IMR_IO_PORT
-
-
+
+
decl SYM (_ISR_Nest_level) /* one less ISR nest level */
/* If interrupts are nested, */
/* then dispatching is disabled */
@@ -149,13 +149,13 @@ nested:
/* while in interrupt handler? */
je .exit /* No, exit */
-
+
.bframe:
movl $0, SYM (_ISR_Signals_to_thread_executing)
/*
* This code is the less critical path. In order to have a single
- * Thread Context, we take the same frame than the one pushed on
- * exceptions. This makes sense because Signal is a software
+ * Thread Context, we take the same frame than the one pushed on
+ * exceptions. This makes sense because Signal is a software
* exception.
*/
popl edx
@@ -172,11 +172,11 @@ nested:
popa
addl $8, esp
iret
-
+
.schedule:
/*
* the scratch registers have already been saved and we are already
- * back on the thread system stack. So we can call _Thread_Displatch
+ * back on the thread system stack. So we can call _Thread_Displatch
* directly
*/
call _Thread_Dispatch
@@ -203,7 +203,7 @@ nested:
popl eax
iret
-
+
#define DISTINCT_INTERRUPT_ENTRY(_vector) \
.p2align 4 ; \
PUBLIC (rtems_irq_prologue_ ## _vector ) ; \
@@ -230,21 +230,21 @@ DISTINCT_INTERRUPT_ENTRY(12)
DISTINCT_INTERRUPT_ENTRY(13)
DISTINCT_INTERRUPT_ENTRY(14)
DISTINCT_INTERRUPT_ENTRY(15)
-
+
/*
* routine used to initialize the IDT by default
*/
-
+
PUBLIC (default_raw_idt_handler)
PUBLIC (raw_idt_notify)
-
+
SYM (default_raw_idt_handler):
pusha
cld
call raw_idt_notify
popa
iret
-
+
END_CODE
END
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_init.c b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
index 128a474462..7a54329082 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
@@ -99,9 +99,9 @@ static rtems_irq_prio irqPrioTable[BSP_IRQ_LINES_NUMBER]={
255,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-
-
+
+
static interrupt_gate_descriptor idtEntry;
static rtems_irq_global_settings initial_config;
@@ -128,7 +128,7 @@ void rtems_irq_mngt_init()
printk("IDT table size mismatch !!! System locked\n");
while(1);
}
-
+
_CPU_ISR_Disable(level);
@@ -143,7 +143,7 @@ void rtems_irq_mngt_init()
raw_initial_config.idtSize = IDT_SIZE;
raw_initial_config.defaultRawEntry = defaultRawIrq;
raw_initial_config.rawIrqHdlTbl = idtHdl;
-
+
if (!i386_init_idt (&raw_initial_config)) {
/*
* put something here that will show the failure...
@@ -189,7 +189,7 @@ void rtems_irq_mngt_init()
}
/*
- * #define DEBUG
+ * #define DEBUG
*/
#ifdef DEBUG
{
@@ -206,5 +206,5 @@ void rtems_irq_mngt_init()
}
printk("i8259s_cache = %x\n", * (unsigned short*) &i8259s_cache);
BSP_wait_polled_input();
-#endif
+#endif
}
diff --git a/c/src/lib/libbsp/i386/shared/pci/pcibios.c b/c/src/lib/libbsp/i386/shared/pci/pcibios.c
index 354f6d9e71..1cece0fb86 100644
--- a/c/src/lib/libbsp/i386/shared/pci/pcibios.c
+++ b/c/src/lib/libbsp/i386/shared/pci/pcibios.c
@@ -15,28 +15,28 @@
/*
* This is simpliest possible PCI BIOS, it assumes that addressing
- * is flat and that stack is big enough
- */
+ * is flat and that stack is big enough
+ */
static int pcibInitialized = 0;
static unsigned int pcibEntry;
/*
- * Array to pass data between c and asm parts, at the time of
- * writing I am not yet that familiar with extended asm feature
- * of gcc. This code is not on performance path, so we can care
- * relatively little about performance here
+ * Array to pass data between c and asm parts, at the time of
+ * writing I am not yet that familiar with extended asm feature
+ * of gcc. This code is not on performance path, so we can care
+ * relatively little about performance here
*/
static volatile unsigned int pcibExchg[5];
static int pcib_convert_err(int err);
/*
- * Detects presense of PCI BIOS, returns
+ * Detects presense of PCI BIOS, returns
* error code
*/
-int
+int
pcib_init(void)
{
unsigned char *ucp;
@@ -84,7 +84,7 @@ pcib_init(void)
pcibExchg[0] = *(unsigned int *)ucp;
- asm (" pusha"); /* Push all registers */
+ asm (" pusha"); /* Push all registers */
asm (" movl pcibExchg, %edi"); /* Move entry point to esi */
asm (" movl $0x49435024, %eax"); /* Move signature to eax */
asm (" xorl %ebx, %ebx"); /* Zero ebx */
@@ -107,7 +107,7 @@ pcib_init(void)
/* Let us check whether PCI bios is present */
pcibExchg[0] = pcibEntry;
-
+
asm(" pusha");
asm(" movl pcibExchg, %edi");
asm(" movb $0xb1, %ah");
@@ -133,13 +133,13 @@ pcib_init(void)
}
/* Success */
-
+
pcibInitialized = 1;
return PCIB_ERR_SUCCESS;
}
-/*
- * Find specified device and return its signature: combination
+/*
+ * Find specified device and return its signature: combination
* of bus number, device number and function number
*/
int
@@ -173,8 +173,8 @@ pcib_find_by_devid(int vendorId, int devId, int idx, int *sig)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-/*
- * Find specified class code return device signature: combination
+/*
+ * Find specified class code return device signature: combination
* of bus number, device number and function number
*/
int
@@ -210,8 +210,8 @@ pcib_find_by_class(int classCode, int idx, int *sig)
return PCIB_ERR_SUCCESS;
}
-
-
+
+
#define PCI_MULTI_FUNCTION 0x80
@@ -228,42 +228,42 @@ BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
unsigned short s;
unsigned char bus,dev,fun,hd;
- for (bus=0; bus<BusCountPCI(); bus++)
+ for (bus=0; bus<BusCountPCI(); bus++)
{
- for (dev=0; dev<PCI_MAX_DEVICES; dev++)
+ for (dev=0; dev<PCI_MAX_DEVICES; dev++)
{
sig = PCIB_DEVSIG_MAKE(bus,dev,0);
/* pci_read_config_byte(bus,dev,0, PCI_HEADER_TYPE, &hd); */
- pcib_conf_read8(sig, 0xe, &hd);
+ pcib_conf_read8(sig, 0xe, &hd);
hd = (hd & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1);
for (fun=0; fun<hd; fun++) {
- /*
+ /*
* The last devfn id/slot is special; must skip it
*/
if( PCI_MAX_DEVICES-1 == dev && PCI_MAX_FUNCTIONS-1 == fun )
break;
/*pci_read_config_dword(bus,dev,fun,PCI_VENDOR_ID,&d); */
- pcib_conf_read32(sig, 0, &d);
+ pcib_conf_read32(sig, 0, &d);
if( d == -1 )
continue;
#ifdef PCI_DEBUG
printk("BSP_pciFindDevice: found 0x%08x at %d/%d/%d\n",d,bus,dev,fun);
#endif
/* pci_read_config_word(bus,dev,fun,PCI_VENDOR_ID,&s); */
- pcib_conf_read16(sig, 0, &s);
+ pcib_conf_read16(sig, 0, &s);
if (vendorid != s)
continue;
/* pci_read_config_word(bus,dev,fun,PCI_DEVICE_ID,&s); */
- pcib_conf_read16(sig, 0x2, &s);
+ pcib_conf_read16(sig, 0x2, &s);
if (deviceid == s) {
if (instance--) continue;
- *pbus=bus;
- *pdev=dev;
+ *pbus=bus;
+ *pdev=dev;
*pfun=fun;
return 0;
}
@@ -274,9 +274,9 @@ BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
}
-
-/*
+
+/*
* Generate Special Cycle
*/
int
@@ -305,9 +305,9 @@ pcib_special_cycle(int busNo, int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-
-/*
+
+/*
* Read byte from config space
*/
int
@@ -343,9 +343,9 @@ pcib_conf_read8(int sig, int off, unsigned char *data)
return PCIB_ERR_SUCCESS;
}
-
-/*
+
+/*
* Read word from config space
*/
int
@@ -381,9 +381,9 @@ pcib_conf_read16(int sig, int off, unsigned short *data)
return PCIB_ERR_SUCCESS;
}
-
-/*
+
+/*
* Read dword from config space
*/
int
@@ -419,9 +419,9 @@ pcib_conf_read32(int sig, int off, unsigned int *data)
return PCIB_ERR_SUCCESS;
}
-
-/*
+
+/*
* Write byte into config space
*/
int
@@ -452,7 +452,7 @@ pcib_conf_write8(int sig, int off, unsigned int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-/*
+/*
* Write word into config space
*/
int
@@ -482,10 +482,10 @@ pcib_conf_write16(int sig, int off, unsigned int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-
-/*
+
+/*
* Write dword into config space
*/
int
@@ -515,7 +515,7 @@ pcib_conf_write32(int sig, int off, unsigned int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-
+
static int
pcib_convert_err(int err)
diff --git a/c/src/lib/libbsp/i386/shared/pci/pcibios.h b/c/src/lib/libbsp/i386/shared/pci/pcibios.h
index 1bd5d144b6..beba80ff5b 100644
--- a/c/src/lib/libbsp/i386/shared/pci/pcibios.h
+++ b/c/src/lib/libbsp/i386/shared/pci/pcibios.h
@@ -15,10 +15,10 @@
#define PCIB_ERR_NOFUNC (-3) /* Function not supported */
#define PCIB_ERR_BADVENDOR (-4) /* Bad Vendor ID */
#define PCIB_ERR_DEVNOTFOUND (-5) /* Device not found */
-#define PCIB_ERR_BADREG (-6) /* Bad register number */
+#define PCIB_ERR_BADREG (-6) /* Bad register number */
-/*
- * Make device signature from bus number, device numebr and function
+/*
+ * Make device signature from bus number, device numebr and function
* number
*/
#define PCIB_DEVSIG_MAKE(b,d,f) ((b<<8)|(d<<3)|(f))
diff --git a/c/src/lib/libbsp/i386/ts_386ex/clock/ckinit.c b/c/src/lib/libbsp/i386/ts_386ex/clock/ckinit.c
index fb39b12608..e890139db5 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/clock/ckinit.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/clock/ckinit.c
@@ -36,7 +36,7 @@ void Clock_exit( void );
/*
* These are set by clock driver during its init
*/
-
+
rtems_device_major_number rtems_clock_major = ~0;
rtems_device_major_number rtems_clock_minor = 0;
@@ -100,7 +100,7 @@ rtems_device_driver Clock_initialize(
/* External Prototypes */
extern void init_rtc(void); /* defined in 'rtc.c' */
extern long rtc_read(rtems_time_of_day *); /* defined in 'rtc.c' */
-
+
#ifdef BSP_DEBUG
printk("Loading clock from on-board real-time clock.\n");
#endif
@@ -113,25 +113,25 @@ rtems_device_driver Clock_initialize(
Clock_driver_ticks = 0;
- Clock_isrs =
- Clock_initial_isr_value =
+ Clock_isrs =
+ Clock_initial_isr_value =
BSP_Configuration.microseconds_per_tick / 1000; /* ticks per clock_isr */
-
+
/*
* configure the counter timer ( should be based on microsecs/tick )
* NB. The divisor(Clock_isrs) resolves the is the same number that appears in confdefs.h
* when setting the microseconds_per_tick value.
*/
ClockOff ( &clockIrqData );
-
+
timer_counter_init_value = BSP_Configuration.microseconds_per_tick / Clock_isrs;
clock_lsb = (unsigned char)timer_counter_init_value;
clock_msb = timer_counter_init_value >> 8;
-
- outport_byte (TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
+
+ outport_byte (TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
outport_byte (TIMER_CNTR0, clock_lsb ); /* load LSB first */
outport_byte (TIMER_CNTR0, clock_msb ); /* then MSB */
-
+
if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
printk("Unable to initialize system clock\n");
rtems_fatal_error_occurred(1);
@@ -140,10 +140,10 @@ rtems_device_driver Clock_initialize(
/*
* make major/minor avail to others such as shared memory driver
*/
-
+
rtems_clock_major = major;
rtems_clock_minor = minor;
-
+
return RTEMS_SUCCESSFUL;
}
@@ -154,15 +154,15 @@ rtems_device_driver Clock_control(
)
{
rtems_libio_ioctl_args_t *args = pargp;
-
+
if (args == 0)
goto done;
-
+
/*
* This is hokey, but until we get a defined interface
* to do this, it will just be this simple...
*/
-
+
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
{
Clock_isr();
@@ -178,13 +178,13 @@ rtems_device_driver Clock_control(
printk("Clock installed AGAIN\n");
#endif
}
-
+
done:
return RTEMS_SUCCESSFUL;
}
void Clock_exit()
{
- ClockOff(&clockIrqData);
+ ClockOff(&clockIrqData);
BSP_remove_rtems_irq_handler (&clockIrqData);
}
diff --git a/c/src/lib/libbsp/i386/ts_386ex/clock/rtc.c b/c/src/lib/libbsp/i386/ts_386ex/clock/rtc.c
index 401220bf6d..26c4c2056d 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/clock/rtc.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/clock/rtc.c
@@ -79,9 +79,9 @@
| Description: Convert 2 digit number to its BCD representation.
| Global Variables: None.
| Arguments: i - Number to convert.
-| Returns: BCD representation of number.
+| Returns: BCD representation of number.
+--------------------------------------------------------------------------*/
-static inline uint8_t
+static inline uint8_t
bcd(uint8_t i)
{
return ((i / 16) * 10 + (i % 16));
@@ -99,9 +99,9 @@ bcd(uint8_t i)
| Description: Convert years to seconds (since 1970).
| Global Variables: None.
| Arguments: y - year to convert (1970 <= y <= 2100).
-| Returns: number of seconds since 1970.
+| Returns: number of seconds since 1970.
+--------------------------------------------------------------------------*/
-static inline uint32_t
+static inline uint32_t
ytos(uint16_t y)
{ /* v NUM LEAP YEARS v */
return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY);
@@ -113,9 +113,9 @@ ytos(uint16_t y)
| Description: Convert months to seconds since January.
| Global Variables: None.
| Arguments: m - month to convert, leap - is this a month of a leap year.
-| Returns: number of seconds since January.
+| Returns: number of seconds since January.
+--------------------------------------------------------------------------*/
-static inline uint32_t
+static inline uint32_t
mtos(uint8_t m, rtems_boolean leap)
{
static uint16_t daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181,
@@ -132,9 +132,9 @@ mtos(uint8_t m, rtems_boolean leap)
| Description: Perform action on RTC and return its result.
| Global Variables: None.
| Arguments: what - what to write to RTC port (what to do).
-| Returns: result received from RTC port after action performed.
+| Returns: result received from RTC port after action performed.
+--------------------------------------------------------------------------*/
-static inline uint8_t
+static inline uint8_t
rtcin(uint8_t what)
{
uint8_t r;
@@ -153,7 +153,7 @@ rtcin(uint8_t what)
| Description: Initialize real-time clock (RTC).
| Global Variables: None.
| Arguments: None.
-| Returns: Nothing.
+| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
init_rtc(void)
@@ -181,7 +181,7 @@ init_rtc(void)
| Description: Read present time from RTC and return it.
| Global Variables: None.
| Arguments: tod - to return present time in 'rtems_time_of_day' format.
-| Returns: number of seconds from 1970/01/01 corresponding to 'tod'.
+| Returns: number of seconds from 1970/01/01 corresponding to 'tod'.
+--------------------------------------------------------------------------*/
long int
rtc_read(rtems_time_of_day *tod)
@@ -201,7 +201,7 @@ rtc_read(rtems_time_of_day *tod)
sa = rtcin(RTC_STATUSA);
tod->year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
- if (tod->year < 1970) tod->year += 100;
+ if (tod->year < 1970) tod->year += 100;
tod->month = bcd(rtcin(RTC_MONTH)); /* month */
tod->day = bcd(rtcin(RTC_DAY)); /* day */
(void) bcd(rtcin(RTC_WDAY)); /* weekday */
diff --git a/c/src/lib/libbsp/i386/ts_386ex/console/console.c b/c/src/lib/libbsp/i386/ts_386ex/console/console.c
index 6dedba06de..a101823370 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/console/console.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/console/console.c
@@ -1,7 +1,7 @@
/*-------------------------------------------------------------------------+
| console.c v1.1 - i386ex BSP - 1997/08/07
+--------------------------------------------------------------------------+
-| This file contains the i386ex console I/O package. It is just a termios
+| This file contains the i386ex console I/O package. It is just a termios
| wrapper.
+--------------------------------------------------------------------------+
| (C) Copyright 1997 -
@@ -48,7 +48,7 @@
* Possible value for console input/output :
* BSP_UART_COM1
* BSP_UART_COM2
- * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
+ * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
* All references to either keyboard or video handling have been removed.
*/
@@ -67,7 +67,7 @@ static int isr_is_on(const rtems_irq_connect_data *);
* Change references to com2 if required.
*/
-static rtems_irq_connect_data console_isr_data =
+static rtems_irq_connect_data console_isr_data =
{ BSP_UART_COM2_IRQ,
BSP_uart_termios_isr_com2,
isr_on,
@@ -79,7 +79,7 @@ isr_on(const rtems_irq_connect_data *unused)
{
return;
}
-
+
static void
isr_off(const rtems_irq_connect_data *unused)
{
@@ -108,20 +108,20 @@ console_initialize(rtems_device_major_number major,
* Set up TERMIOS
*/
rtems_termios_initialize ();
-
+
/*
* Do device-specific initialization
*/
-
+
/* 115200-8-N-1, without hardware flow control */
BSP_uart_init(BSPConsolePort, 115200, CHR_8_BITS, 0, 0, 0);
-
+
/* Set interrupt handler */
if(BSPConsolePort == BSP_UART_COM1)
{
console_isr_data.name = BSP_UART_COM1_IRQ;
console_isr_data.hdl = BSP_uart_termios_isr_com1;
-
+
}
else
{
@@ -129,9 +129,9 @@ console_initialize(rtems_device_major_number major,
console_isr_data.name = BSP_UART_COM2_IRQ;
console_isr_data.hdl = BSP_uart_termios_isr_com2;
}
-
+
status = BSP_install_rtems_irq_handler(&console_isr_data);
-
+
if (!status){
printk("Error installing serial console interrupt handler!\n");
rtems_fatal_error_occurred(status);
@@ -145,7 +145,7 @@ console_initialize(rtems_device_major_number major,
printk("Error registering console device!\n");
rtems_fatal_error_occurred (status);
}
-
+
if(BSPConsolePort == BSP_UART_COM1)
{
printk("Initialized console on port COM1 115200-8-N-1\n\n");
@@ -175,7 +175,7 @@ console_open(rtems_device_major_number major,
void *arg)
{
rtems_status_code status;
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
console_last_close, /* lastClose */
@@ -203,9 +203,9 @@ console_open(rtems_device_major_number major,
/*
* Pass data area info down to driver
*/
- BSP_uart_termios_set(BSPConsolePort,
+ BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
-
+
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
@@ -222,10 +222,10 @@ console_close(rtems_device_major_number major,
{
return (rtems_termios_close (arg));
-
+
} /* console_close */
-
+
/*-------------------------------------------------------------------------+
| Console device driver READ entry point.
+--------------------------------------------------------------------------+
@@ -246,7 +246,7 @@ console_read(rtems_device_major_number major,
return sc;
} /* console_read */
-
+
/*-------------------------------------------------------------------------+
| Console device driver WRITE entry point.
@@ -259,20 +259,20 @@ console_write(rtems_device_major_number major,
void * arg)
{
return rtems_termios_write (arg);
-
+
} /* console_write */
-
+
/*
* Handle ioctl request.
*/
-rtems_device_driver
+rtems_device_driver
console_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
return rtems_termios_ioctl (arg);
}
@@ -281,45 +281,45 @@ conSetAttr(int minor, const struct termios *t)
{
int baud;
- switch (t->c_cflag & CBAUD)
+ switch (t->c_cflag & CBAUD)
{
- case B50:
+ case B50:
baud = 50;
break;
- case B75:
- baud = 75;
+ case B75:
+ baud = 75;
break;
- case B110:
- baud = 110;
+ case B110:
+ baud = 110;
break;
- case B134:
- baud = 134;
+ case B134:
+ baud = 134;
break;
- case B150:
- baud = 150;
+ case B150:
+ baud = 150;
break;
case B200:
- baud = 200;
+ baud = 200;
break;
- case B300:
+ case B300:
baud = 300;
break;
- case B600:
- baud = 600;
+ case B600:
+ baud = 600;
break;
- case B1200:
+ case B1200:
baud = 1200;
break;
- case B1800:
- baud = 1800;
+ case B1800:
+ baud = 1800;
break;
- case B2400:
+ case B2400:
baud = 2400;
break;
- case B4800:
+ case B4800:
baud = 4800;
break;
- case B9600:
+ case B9600:
baud = 9600;
break;
case B19200:
@@ -328,7 +328,7 @@ conSetAttr(int minor, const struct termios *t)
case B38400:
baud = 38400;
break;
- case B57600:
+ case B57600:
baud = 57600;
break;
case B115200:
@@ -349,13 +349,13 @@ conSetAttr(int minor, const struct termios *t)
* BSP initialization
*/
-BSP_output_char_function_type BSP_output_char =
+BSP_output_char_function_type BSP_output_char =
(BSP_output_char_function_type) BSP_output_char_via_serial;
-BSP_polling_getchar_function_type BSP_poll_char =
+BSP_polling_getchar_function_type BSP_poll_char =
(BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
int BSP_poll_read(int ttyMinor){
-
+
return BSP_poll_char_via_serial();
}
diff --git a/c/src/lib/libbsp/i386/ts_386ex/include/bsp.h b/c/src/lib/libbsp/i386/ts_386ex/include/bsp.h
index 1b5ce3d639..ae38792de6 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/include/bsp.h
+++ b/c/src/lib/libbsp/i386/ts_386ex/include/bsp.h
@@ -37,7 +37,7 @@ extern "C" {
/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
#define CONFIGURE_INTERRUPT_STACK_MEMORY (8 * 1024)
-
+
/*
* Network driver configuration
*/
@@ -163,15 +163,15 @@ extern void Wait_X_ms (unsigned);
/*
* Device Driver Table Entries
*/
-
+
/*
* NOTE: Use the standard Console driver entry
*/
-
+
/*
* NOTE: Use the standard Clock driver entry
*/
-
+
/* miscellaneous stuff assumed to exist */
extern rtems_configuration_table BSP_Configuration;
diff --git a/c/src/lib/libbsp/i386/ts_386ex/include/wd80x3.h b/c/src/lib/libbsp/i386/ts_386ex/include/wd80x3.h
index 545861cb3b..c82035b61c 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/include/wd80x3.h
+++ b/c/src/lib/libbsp/i386/ts_386ex/include/wd80x3.h
@@ -9,7 +9,7 @@
/* page 0 read or read/write registers */
-#define CMDR 0x00+RO
+#define CMDR 0x00+RO
#define CLDA0 0x01+RO /* current local dma addr 0 for read */
#define CLDA1 0x02+RO /* current local dma addr 1 for read */
#define BNRY 0x03+RO /* boundary reg for rd and wr */
@@ -55,7 +55,7 @@
/*-----CMDR command bits-----*/
#define MSK_STP 0x01 /* stop the chip */
-#define MSK_STA 0x02 /* start the chip */
+#define MSK_STA 0x02 /* start the chip */
#define MSK_TXP 0x04 /* initial txing of a frm */
#define MSK_RRE 0x08 /* remote read */
#define MSK_RWR 0x10 /* remote write */
diff --git a/c/src/lib/libbsp/i386/ts_386ex/network/ne2000.c b/c/src/lib/libbsp/i386/ts_386ex/network/ne2000.c
index a6a51d900f..80e97d8904 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/network/ne2000.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/network/ne2000.c
@@ -23,7 +23,7 @@
* is any point to having more than two transmit buffers. However, the
* code does make it possible, by changing NE_TX_BUFS, although that
* would of course reduce the number of receive buffers.
- *
+ *
* I suspect that the wd80x3 driver would benefit slightly from copying
* the multiple transmit buffer code. However, I have no way to test
* that.
@@ -223,7 +223,7 @@ ne_read_data (struct ne_softc *sc, int addr, int len, unsigned char *p)
if (sc->byte_transfers)
while (len > 0) {
unsigned char d;
-
+
inport_byte (dport, d);
*p++ = d;
len--;
@@ -231,7 +231,7 @@ ne_read_data (struct ne_softc *sc, int addr, int len, unsigned char *p)
else /* word transfers */
while (len > 0) {
unsigned short d;
-
+
inport_word (dport, d);
*p++ = d;
*p++ = d >> 8;
@@ -643,7 +643,7 @@ ne_loadpacket (struct ne_softc *sc, struct mbuf *m)
leftover = 0;
}
- /* If using byte transfers, len always ends up as zero so
+ /* If using byte transfers, len always ends up as zero so
there are no leftovers. */
if (sc->byte_transfers)
@@ -954,7 +954,7 @@ rtems_ne_driver_attach (struct rtems_bsdnet_ifconfig *config)
memset (sc, 0, sizeof *sc);
/* Check whether we do byte-wide or word-wide transfers. */
-
+
#ifdef NE2000_BYTE_TRANSFERS
sc->byte_transfers = TRUE;
#else
diff --git a/c/src/lib/libbsp/i386/ts_386ex/start/80386ex.h b/c/src/lib/libbsp/i386/ts_386ex/start/80386ex.h
index 8c2c5caeff..a62f08f425 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/start/80386ex.h
+++ b/c/src/lib/libbsp/i386/ts_386ex/start/80386ex.h
@@ -8,7 +8,7 @@
* 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$
*/
diff --git a/c/src/lib/libbsp/i386/ts_386ex/start/start.S b/c/src/lib/libbsp/i386/ts_386ex/start/start.S
index 1add645b37..53c28c5585 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/start/start.S
+++ b/c/src/lib/libbsp/i386/ts_386ex/start/start.S
@@ -2,14 +2,14 @@
* This file is the main boot and configuration file for the TS-1325. It is
* solely responsible for initializing the internal register set to reflect
* the proper board configuration. This version is modified from the i386ex
- * BSP startup:
+ * BSP startup:
*
* 1) 1 MB RAM @ 0x0100000
* 2) 1 MB RAM @ 0x0 but with standard DOS memory usage.
* 3) Timer0 used as RTEMS clock ticker, 1 msec tick rate.
* 4) READY# is generated by CPU
*
- * The file describes the ".initial" section, which contains:
+ * The file describes the ".initial" section, which contains:
* 1) device configuration code
* 2) interrupt descriptor table
* 3) global descriptor table
@@ -33,12 +33,12 @@
#include "80386ex.inc"
#include "ts_1325.inc" /* controls for LED and button */
-
+
/*
* NEW_GAS Needed for binutils 2.9.1.0.7 and higher
- */
+ */
- EXTERN (boot_card) /* exits to bspstart */
+ EXTERN (boot_card) /* exits to bspstart */
EXTERN (_DOS_seg_base) /* defined in startup/linkcmds */
EXTERN (Clock_exit)
@@ -49,34 +49,34 @@
PUBLIC( SYM(_init_i386ex) )
-
+
.section .initial, "ax"
/*
* Enable access to peripheral register at expanded I/O addresses
*/
-SYM(_init_i386ex):
+SYM(_init_i386ex):
.code16
/*
LED_GREEN
WAIT_BUTTON
*/
# cli Move this up for now for debug.
- movw $0x8000 , ax
+ movw $0x8000 , ax
outb al , $REMAPCFGH
xchg al , ah
outb al , $REMAPCFGL
outw ax , $REMAPCFG ;
-/*
+/*
LED_OFF
WAIT_BUTTON
*/
/*
* Configure operation of the A20 Address Line
- */
+ */
SYM(A20):
movw $PORT92 , dx
-
+
inb dx , al # clear A20 port reset
andb $0xfe , al # b0 Fast Reset(0)=disabled,(1)=reset triggered
orb $0x02 , al # Bit 1 Fast A20 = 0 (always 0) else enabled.
@@ -88,14 +88,14 @@ SYM(A20):
SYM(Watchdog):
movw $WDTSTATUS , dx # address the WDT status port
inb dx , al # get the WDT status
- orb $0x01 , al # set the CLKDIS bit
+ orb $0x01 , al # set the CLKDIS bit
outb al , dx # disable the clock to the WDT
/*
LED_GREEN
WAIT_BUTTON
*/
/*
- * Initialize Refresh Control Unit for:
+ * Initialize Refresh Control Unit for:
* Refresh Address = 0x0000
* Refresh gate between rows is 20.0 (???) uSec
@@ -108,7 +108,7 @@ SYM(Watchdog):
*/
/*
-SYM(InitRCU):
+SYM(InitRCU):
SetExRegWord( RFSCIR , 0x1F4) # refresh interval 500
SetExRegWord( RFSBAD , 0x0) # base address
SetExRegWord( RFSADD , 0x0) # address register
@@ -120,15 +120,15 @@ SYM(InitRCU):
WAIT_BUTTON
*/
/*
- * Initialize clock and power mgmt unit for:
+ * Initialize clock and power mgmt unit for:
* Clock Frequency = 50 Mhz
* Prescaled clock output = 1 Mhz
* Normal halt instructions
*
- * NOTE: Hope this doesn't change the COMCLK frequency
+ * NOTE: Hope this doesn't change the COMCLK frequency
*/
-
-SYM(InitClk):
+
+SYM(InitClk):
SetExRegByte( PWRCON, 0x0 )
SetExRegWord( CLKPRS, 0x17) # 0x13 for 1.19318 MHz. 0x17 for 1MHz.
@@ -140,7 +140,7 @@ SYM(InitClk):
WAIT_BUTTON
*/
/*
- * Initialize I/O port 1 for:
+ * Initialize I/O port 1 for:
* PIN 0 = 0, Inport for external push-button switch
* PIN 1 = 1, RTS0# to package pin
* PIN 2 = 1, DTR0# to package pin
@@ -151,7 +151,7 @@ SYM(InitClk):
* PIN 7 = 0, Inport ???
*/
-SYM(InitPort1):
+SYM(InitPort1):
SetExRegByte( P1LTC , 0xd1 )
SetExRegByte( P1DIR , 0x91)
SetExRegByte( P1CFG , 0x0e)
@@ -160,9 +160,9 @@ SYM(InitPort1):
WAIT_BUTTON
*/
/*
- * Initialize I/O port 2 for:
+ * Initialize I/O port 2 for:
* PIN 0 = 0, Outport ???
- * PIN 1 = 0, Outport ???
+ * PIN 1 = 0, Outport ???
* PIN 2 = 0, Outport ???
* PIN 3 = 0, Outport ???
* PIN 4 = 0, Outport ???
@@ -170,8 +170,8 @@ SYM(InitPort1):
* PIN 6 = 1, Int. periph, TXD0
* PIN 7 = 0, Outport ???
*/
-
-SYM(InitPort2):
+
+SYM(InitPort2):
SetExRegByte( P2LTC , 0x1f )
SetExRegByte( P2DIR , 0x00 )
SetExRegByte( P2CFG , 0x60)
@@ -180,18 +180,18 @@ SYM(InitPort2):
WAIT_BUTTON
*/
/*
- * Initialize I/O port 3 P3CFG
+ * Initialize I/O port 3 P3CFG
* PIN 0 = 1, Int. periph, TMROUT0
- * PIN 1 = 1, Int. periph, TMROUT1
- * PIN 2 = 1, Int. periph, INT0 (IR1)
- * PIN 3 = 1, Int. periph, INT1 (IR5)
- * PIN 4 = 1, Int. periph, INT2 (IR6)
- * PIN 5 = 1, Int. periph, INT2 (IR7)
+ * PIN 1 = 1, Int. periph, TMROUT1
+ * PIN 2 = 1, Int. periph, INT0 (IR1)
+ * PIN 3 = 1, Int. periph, INT1 (IR5)
+ * PIN 4 = 1, Int. periph, INT2 (IR6)
+ * PIN 5 = 1, Int. periph, INT2 (IR7)
* PIN 6 = 0, Outport ???
* PIN 7 = 1, Int. periph, COMCLK used for serial I/O
*/
-
-SYM(InitPort3):
+
+SYM(InitPort3):
SetExRegByte( P3LTC , 0x00 )
SetExRegByte( P3DIR , 0xbf )
SetExRegByte( P3CFG , 0xbf ) # can check TMROUT0
@@ -200,7 +200,7 @@ SYM(InitPort3):
WAIT_BUTTON
*/
/*
- * Initialize Peripheral Pin Configurations:
+ * Initialize Peripheral Pin Configurations:
* PIN 0 = 1, Select RTS1#
* PIN 1 = 1, Select DTR1#
* PIN 2 = 1, Select TXD1#
@@ -210,23 +210,23 @@ SYM(InitPort3):
* PIN 6 = 0, Select CS6#
* PIN 7 = 0, Don't care
*/
-
-SYM(InitPeriph):
- SetExRegByte( PINCFG , 0x3f)
+
+SYM(InitPeriph):
+ SetExRegByte( PINCFG , 0x3f)
/*
LED_GREEN
WAIT_BUTTON
*/
/*
- * Initialize the Asynchronous Serial Ports:
+ * Initialize the Asynchronous Serial Ports:
* BIT 7 = 1, Internal SIO1 modem signals
* BIT 6 = 1, Internal SIO0 modem signals
* BIT 2 = 0, PSCLK for SSIO clock
- * BIT 1 = 1, SERCLK for SIO1 clock
+ * BIT 1 = 1, SERCLK for SIO1 clock
* BIT 0 = 1, SERCLK for SIO0 clock
*/
-SYM(InitSIO):
+SYM(InitSIO):
SetExRegByte( SIOCFG, 0x00 ) # COMCLK -> baud-rate generator
# modem signals -> package pins
SetExRegByte( LCR0, 0x80 ) # latch DLL0, DLH0
@@ -235,8 +235,8 @@ SYM(InitSIO):
SetExRegByte( LCR0, 0x03 ) # enable r/w buffers, IER0 accessible
# mode 8-n-1
SetExRegByte( IER0, 0x00 ) # no generated interrupts
-
- SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
+
+ SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
SetExRegByte( DLL1, 0x01 ) # 0x0C set to 9600 baud, 0x6 = 19.2K
SetExRegByte( DLH1, 0x00 ) # 0x4 is 28.8K baud
SetExRegByte( LCR1, 0x03 ) # enable r/w buffers, IER1 accessible
@@ -251,43 +251,43 @@ SYM(InitMCR):
SetExRegByte( MCR1, 0x03 ) # standard mode, RTS,DTR activated
/*
- * Initialize Timer for:
+ * Initialize Timer for:
* BIT 7 = 1, Timer clocks disabled
* BIT 6 = 0, Reserved
* BIT 5 = 1, TMRCLK2 instead of Vcc to Gate2
* BIT 4 = 0, PSCLK to CLK2
* BIT 3 = 1, TMRCLK1 instead of Vcc to Gate1
* BIT 2 = 0, PSCLK to Gate1
- * BIT 1 = 0, Vcc to Gate0
+ * BIT 1 = 0, Vcc to Gate0
* BIT 0 = 0, PSCLK to Gate0
*/
/*
LED_YELLOW
WAIT_BUTTON
*/
-SYM(InitTimer):
- SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
+SYM(InitTimer):
+ SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
# and 2 are set to Vcc
SetExRegByte(TMRCON , 0x34 ) # prepare to write counter 0 LSB,MSB
SetExRegByte(TMR0 , 0x00 ) # sfa
- SetExRegByte(TMR0 , 0x00 ) # sfa
+ SetExRegByte(TMR0 , 0x00 ) # sfa
+
-
SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc
- SetExRegByte(TMR1 , 0x00 ) # sfa
SetExRegByte(TMR1 , 0x00 ) # sfa
-
+ SetExRegByte(TMR1 , 0x00 ) # sfa
+
SetExRegByte(TMRCON , 0xB0 ) # mode 0 disables on gate =Vcc
- SetExRegByte(TMR2 , 0x00 ) #
- SetExRegByte(TMR2 , 0x00 ) #
+ SetExRegByte(TMR2 , 0x00 ) #
+ SetExRegByte(TMR2 , 0x00 ) #
/*
LED_GREEN
WAIT_BUTTON
*/
/*
- * Initialize the DMACFG register for:
+ * Initialize the DMACFG register for:
* BIT 7 = 1 , Disable DACK#1
* BITs 6:4 = 100, TMROUT2 connected to DRQ1
* BIT 3 = 1 , Disable DACK0#
@@ -315,7 +315,7 @@ SYM(InitTimer):
*/
SYM(InitInt):
-
+
cli # !
/*
LED_YELLOW
@@ -330,7 +330,7 @@ SYM(InitInt):
SetExRegByte(ICW2M , 0x20 ) # base vector starts at byte 32
SetExRegByte(ICW3M , 0x04) # internal slave cascaded from master IR2
SetExRegByte(ICW4M , 0x01 ) # idem
-
+
SetExRegByte(OCW1M , 0xfb ) # mask master IRQs, but not IR2 (cascade)
SetExRegByte(OCW1S , 0xff ) # mask all slave IRQs
SetExRegByte(INTCFG , 0x00 ) # slave IRs -> Vss or SSIOINT
@@ -346,11 +346,11 @@ SYM(InitInt):
/*
NOTE: not sure about this so comment out...
-SYM(SetCS4):
+SYM(SetCS4):
SetExRegWord(CS4ADL , 0x702) #Configure chip select 4
SetExRegWord(CS4ADH , 0x00)
- SetExRegWord(CS4MSKH, 0x03F)
- SetExRegWord(CS4MSKL, 0xFC01)
+ SetExRegWord(CS4MSKH, 0x03F)
+ SetExRegWord(CS4MSKL, 0xFC01)
*/
/*
LED_GREEN
@@ -364,10 +364,10 @@ SYM(SetCS4):
movl $SYM(GDTR), eax
andl $0xFFFF, eax
-#ifdef NEW_GAS
+#ifdef NEW_GAS
addr32
data32
-#endif
+#endif
#if 0
lgdt (eax) # location of GDT in segment
@@ -375,11 +375,11 @@ SYM(SetCS4):
lgdt SYM(GDTR) # location of GDT
/*
- NOTE: not sure about this either so comment out for now...
-SYM(SetUCS):
+ NOTE: not sure about this either so comment out for now...
+SYM(SetUCS):
SetExRegWord(UCSADL, 0xC503) # values taken from TS-1325 memory
SetExRegWord(UCSADH, 0x000D)
- SetExRegWord(UCSMSKH, 0x0000)
+ SetExRegWord(UCSMSKH, 0x0000)
SetExRegWord(UCSMSKL, 0x3C01) # configure upper chip select
*/
/*
@@ -392,7 +392,7 @@ SYM(SetUCS):
mov cr0, eax
orw $0x1, ax
mov eax, cr0
-
+
/**************************
* Flush prefetch queue,
* and load CS selector
@@ -406,7 +406,7 @@ SYM(SetUCS):
/*
* Load the segment registers
*/
-SYM(_load_segment_registers):
+SYM(_load_segment_registers):
.code32
/*
LED_GREEN
@@ -417,7 +417,7 @@ SYM(_load_segment_registers):
pLOAD_SEGMENT( GDT_DATA_PTR, ss)
pLOAD_SEGMENT( GDT_DATA_PTR, ds)
pLOAD_SEGMENT( GDT_DATA_PTR, es)
-
+
/*
* Set up the stack
*/
@@ -482,7 +482,7 @@ SYM (zero_bss):
.balign 4 # align tables to 4 byte boundary
SYM(IDTR): DESC3( SYM(Interrupt_descriptor_table), 0x07ff );
-
+
SYM(Interrupt_descriptor_table): /* Now in data section */
.rept 256
.word 0,0,0,0
@@ -493,8 +493,8 @@ SYM(Interrupt_descriptor_table): /* Now in data section */
* Use the first (null) entry in the the GDT as a self-pointer for the GDTR.
* (looks like a common trick)
*/
-
-SYM (_Global_descriptor_table):
+
+SYM (_Global_descriptor_table):
SYM(GDTR): DESC3( GDTR, 0x17 ); # one less than the size
.word 0 # padding to DESC2 size
SYM(GDT_CODE): DESC2(0xffff,0,0x0,0x9B,0xDF,0x00);
diff --git a/c/src/lib/libbsp/i386/ts_386ex/startup/bspstart.c b/c/src/lib/libbsp/i386/ts_386ex/startup/bspstart.c
index aca43a4d56..e84334c41c 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/startup/bspstart.c
@@ -13,10 +13,10 @@
*
* Ported to the i386ex and submitted by:
*
- * Erik Ivanenko
+ * Erik Ivanenko
* University of Toronto
* erik.ivanenko@utoronto.ca
- *
+ *
* $Id$
*/
@@ -45,7 +45,7 @@ extern uint32_t rdb_start;
/*
* Use the shared implementations of the following routines
*/
-
+
void bsp_postdriver_hook(void);
void bsp_libc_init( void *, uint32_t, int );
@@ -62,7 +62,7 @@ void bsp_libc_init( void *, uint32_t, int );
* not yet initialized.
*
*/
-
+
void bsp_pretasking_hook(void)
{
extern int heap_bottom;
diff --git a/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c b/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c
index c4301d39aa..3125165466 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c
@@ -33,7 +33,7 @@ rtems_boolean Timer_driver_Find_average_overhead;
extern void timerisr();
-/*
+/*
* Number of us per timer interrupt. Note: 1 us == 1 tick.
*/
@@ -87,7 +87,7 @@ static rtems_raw_irq_connect_data timer_raw_irq_data = {
static rtems_raw_irq_connect_data old_raw_irq_data = {
BSP_PERIODIC_TIMER + BSP_IRQ_VECTOR_BASE,
-};
+};
void Timer_exit()
{
@@ -143,7 +143,7 @@ int Read_timer(void)
/* latch the count */
outport_byte (TIMER_MODE, TIMER_SEL0|TIMER_LATCH );
- /* read the count */
+ /* read the count */
inport_byte (TIMER_CNTR0, lsb );
inport_byte (TIMER_CNTR0, msb );
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/init.c b/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/init.c
index 1df43db4a3..ede6acd692 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/init.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/init.c
@@ -1,4 +1,4 @@
-/*
+/*
* COPYRIGHT (c) 1989-1997.
* On-Line Applications Research Corporation (OAR).
*
@@ -30,7 +30,7 @@ pid_t getpid()
* of the "Ada environment task". Otherwise, we would be
* stuck with the defaults set by RTEMS.
*/
-
+
void *start_gnat_main( void * argument )
{
extern int gnat_main ( int argc, char **argv, char **envp );
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/serial_debug.adb b/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/serial_debug.adb
index f89e290764..5250d82fee 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/serial_debug.adb
+++ b/c/src/lib/libbsp/i386/ts_386ex/tools/debug_ada/serial_debug.adb
@@ -63,4 +63,3 @@ begin
I386_Stub_Glue_Init_Breakin;
end Serial_Debug;
-
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c
index 6b3342f91b..5e87ddf6e2 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/listener/init.c
@@ -1,4 +1,4 @@
-/*
+/*
* COPYRIGHT (c) 1989-1997.
* On-Line Applications Research Corporation (OAR).
*
@@ -32,7 +32,7 @@ pid_t getpid()
* of the "Ada environment task". Otherwise, we would be
* stuck with the defaults set by RTEMS.
*/
-
+
void *start_gnat_main( void * argument )
{
extern int gnat_main ( int argc, char **argv, char **envp );
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h
index 41dfbe11d4..6b424ccb96 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h
+++ b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/networkconfig.h
@@ -1,9 +1,9 @@
/*
* Network configuration
- *
+ *
************************************************************
* EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION *
- * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! *
+ * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! *
************************************************************
*
* $Id$
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c
index e05eb635d4..5590ad8f2a 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/tools/network_ada/tcprelay/init.c
@@ -1,4 +1,4 @@
-/*
+/*
* COPYRIGHT (c) 1989-1997.
* On-Line Applications Research Corporation (OAR).
*
@@ -32,7 +32,7 @@ pid_t getpid()
* of the "Ada environment task". Otherwise, we would be
* stuck with the defaults set by RTEMS.
*/
-
+
void *start_gnat_main( void * argument )
{
extern int gnat_main ( int argc, char **argv, char **envp );
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/i386_ports.ads b/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/i386_ports.ads
index c27ea646e7..44090c4f4b 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/i386_ports.ads
+++ b/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/i386_ports.ads
@@ -43,5 +43,3 @@ private
P3DIR: constant Port_Address := 16#F874#;
end I386_Ports;
-
-
diff --git a/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/init.c b/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/init.c
index 7d3c2026ea..faa6f9876f 100644
--- a/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/init.c
+++ b/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/init.c
@@ -1,4 +1,4 @@
-/*
+/*
* COPYRIGHT (c) 1989-1997.
* On-Line Applications Research Corporation (OAR).
*
@@ -28,7 +28,7 @@ pid_t getpid()
* of the "Ada environment task". Otherwise, we would be
* stuck with the defaults set by RTEMS.
*/
-
+
void *start_gnat_main( void * argument )
{
extern int gnat_main ( int argc, char **argv, char **envp );