[PATCH 04/54] i386/pc386: Clean up and fix warnings

Joel Sherrill joel.sherrill at oarcorp.com
Mon Oct 13 15:36:48 UTC 2014


---
 c/src/lib/libbsp/i386/pc386/clock/ckinit.c    |  2 --
 c/src/lib/libbsp/i386/pc386/console/inch.c    | 10 ++++------
 c/src/lib/libbsp/i386/pc386/include/bsp.h     |  5 +++++
 c/src/lib/libbsp/i386/shared/comm/i386-stub.c |  6 +++---
 c/src/lib/libbsp/i386/shared/comm/uart.c      | 20 +++++++++-----------
 c/src/lib/libbsp/i386/shared/irq/irq_init.c   |  4 ++++
 6 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
index 97c11c8..2782252 100644
--- a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
+++ b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
@@ -257,8 +257,6 @@ static void clockOff(void)
   outport_byte(TIMER_CNTR0, 0);
 } /* Clock_exit */
 
-#define Clock_driver_support_shutdown_hardware() clockOff()
-
 bool Clock_isr_enabled = false;
 static void Clock_isr_handler(void *param)
 {
diff --git a/c/src/lib/libbsp/i386/pc386/console/inch.c b/c/src/lib/libbsp/i386/pc386/console/inch.c
index fe13b69..e503de5 100644
--- a/c/src/lib/libbsp/i386/pc386/console/inch.c
+++ b/c/src/lib/libbsp/i386/pc386/console/inch.c
@@ -239,12 +239,10 @@ _IBMPC_inch(void)
     return c;
 } /* _IBMPC_inch */
 
- /*
-  * Routine that can be used before interrupt management is initialized.
-  */
-
-int
-BSP_wait_polled_input(void)
+/*
+ * Routine that can be used before interrupt management is initialized.
+ */
+int BSP_wait_polled_input(void)
 {
   char c;
   while (!_IBMPC_scankey(&c))
diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h
index 7e6d3f3..62cf0f0 100644
--- a/c/src/lib/libbsp/i386/pc386/include/bsp.h
+++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h
@@ -177,6 +177,10 @@ 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'   */
+int           BSP_wait_polled_input(void); /* from 'inch.c' */
+int           rtems_kbpoll( void );      /* from 'inch.c' */
+int           getch( void );             /* from 'inch.c' */
+void           add_to_queue( unsigned short b ); /* from 'inch.c' */
 
 void Wait_X_ms(unsigned int timeToWait); /* from 'timer.c'  */
 void Calibrate_loop_1ms(void);           /* from 'timer.c'  */
@@ -188,6 +192,7 @@ void bsp_size_memory(void);              /* from 'bspstart.c' */
 void Clock_driver_install_handler(void); /* from 'ckinit.c'  */
 void Clock_driver_support_initialize_hardware(void); /* from 'ckinit.c'  */
 
+void kbd_reset_setup(char *str, int *ints);   /* from 'pc_keyb.c' */
 size_t read_aux(char * buffer, size_t count); /* from 'ps2_mouse.c'  */
 
 /* Definitions for BSPConsolePort */
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 8113d7e..20e3592 100644
--- a/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
+++ b/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
@@ -465,7 +465,7 @@ hex (char ch)
 }
 
 /* scan for the sequence $<data>#<checksum>     */
-void
+static void
 getpacket (char *buffer)
 {
   unsigned char checksum;
@@ -529,7 +529,7 @@ getpacket (char *buffer)
 
 /* send the packet in buffer.  */
 
-void
+static void
 putpacket (char *buffer)
 {
   unsigned char checksum;
@@ -631,7 +631,7 @@ mem2hex (char *mem, char *buf, int count, int may_fault)
 
 /* convert the hex array pointed to by buf into binary to be placed in mem */
 /* return a pointer to the character AFTER the last byte written */
-char *
+static char *
 hex2mem (char *buf, char *mem, int count, int may_fault)
 {
   int i;
diff --git a/c/src/lib/libbsp/i386/shared/comm/uart.c b/c/src/lib/libbsp/i386/shared/comm/uart.c
index 72c7f36..6946492 100644
--- a/c/src/lib/libbsp/i386/shared/comm/uart.c
+++ b/c/src/lib/libbsp/i386/shared/comm/uart.c
@@ -60,15 +60,17 @@ uwrite(int uart, int reg, unsigned int val)
   }
 }
 
-#ifdef UARTDEBUG
-    static void
+static void
 uartError(int uart)
 {
   unsigned char uartStatus, dummy;
 
   uartStatus = uread(uart, LSR);
+  (void) uartStatus; /* avoid set but not used warning */
   dummy = uread(uart, RBR);
+  (void) dummy;      /* avoid set but not used warning */
 
+#ifdef UARTDEBUG
   if (uartStatus & OE)
     printk("********* Over run Error **********\n");
   if (uartStatus & PE)
@@ -79,15 +81,8 @@ uartError(int uart)
     printk("********* Parity Error   **********\n");
   if (uartStatus & ERFIFO)
     printk("********* Error receive Fifo **********\n");
-
-}
-#else
-inline void uartError(int uart)
-{
-  uread(uart, LSR);
-  uread(uart, RBR);
-}
 #endif
+}
 
 /*
  * Uart initialization, it is hardcoded to 8 bit, no parity,
@@ -455,7 +450,10 @@ static void ( *driver_input_handler_com2 )( void *,  char *, int ) = 0;
  * This routine sets the handler to handle the characters received
  * from the serial port.
  */
-void uart_set_driver_handler( int port, void ( *handler )( void *,  char *, int ) )
+static void uart_set_driver_handler(
+  int port,
+  void ( *handler )( void *,  char *, int )
+)
 {
   switch( port )
   {
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 628a366..9bf9bc5 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
@@ -98,6 +98,10 @@ static interrupt_gate_descriptor	idtEntry;
 
 static rtems_raw_irq_global_settings raw_initial_config;
 
+
+/*
+ *  This method is called from irq_asm.S and cannot be static.
+ */
 void raw_idt_notify(void)
 {
   printk("raw_idt_notify has been called \n");
-- 
1.9.3




More information about the devel mailing list