summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/shared
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/i386/shared')
-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
14 files changed, 259 insertions, 248 deletions
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))