[rtems commit] libbsp/i386/shared: Fix warnings

Joel Sherrill joel at rtems.org
Thu Oct 16 13:50:01 UTC 2014


Module:    rtems
Branch:    master
Commit:    1ecb21d8f4f74f9bd9d90baed1fa309255e227f0
Changeset: http://git.rtems.org/rtems/commit/?id=1ecb21d8f4f74f9bd9d90baed1fa309255e227f0

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Mon Oct 13 19:08:14 2014 -0500

libbsp/i386/shared: Fix warnings

---

 c/src/lib/libbsp/i386/shared/comm/i386-stub.c |   16 ++++++++++------
 c/src/lib/libbsp/i386/shared/irq/irq.c        |    7 ++++---
 c/src/lib/libbsp/i386/shared/irq/irq_asm.S    |    9 ++++++---
 c/src/lib/libbsp/i386/shared/pci/pcibios.c    |   18 ------------------
 4 files changed, 20 insertions(+), 30 deletions(-)

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 d4c5eee..bc72396 100644
--- a/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
+++ b/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
@@ -99,6 +99,15 @@
 #include <string.h>
 #include <stdbool.h>
 
+/*
+ * Prototypes we need to avoid warnings but not going into public space.
+ */
+void breakpoint (void);
+void set_debug_traps(void);
+void set_mem_err(void);
+void _returnFromException(void);
+void exceptionHandler (int, void (*handler) (void));
+
 /************************************************************************
  *
  * external low-level support routines
@@ -106,8 +115,6 @@
 extern int putDebugChar (int ch);	   /* write a single character      */
 extern int getDebugChar (void);	           /* read and return a single char */
 
-/* assign an exception handler */
-extern void exceptionHandler (int, void (*handler) (void));
 
 /************************************************************************/
 /* BUFMAX defines the maximum number of characters in inbound/outbound buffers */
@@ -564,7 +571,7 @@ char remcomInBuffer[BUFMAX];
 char remcomOutBuffer[BUFMAX];
 static short error;
 
-void
+static void
 debug_error (
      char *format,
      char *parm
@@ -753,7 +760,6 @@ handle_exception (int exceptionVector)
   int sigval;
   int addr, length, reg;
   char *ptr;
-  int newPC;
 
   gdb_i386vector = exceptionVector;
 
@@ -898,8 +904,6 @@ handle_exception (int exceptionVector)
 	  if (hexToInt (&ptr, &addr))
 	    registers[PC] = addr;
 
-	  newPC = registers[PC];
-
 	  /* clear the trace bit */
 	  registers[PS] &= 0xfffffeff;
 
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.c b/c/src/lib/libbsp/i386/shared/irq/irq.c
index 8ff056c..415d0d0 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.c
@@ -1,7 +1,8 @@
-/* irq.c
- *
+/*
  *  This file contains the implementation of the function described in irq.h
- *
+ */
+
+/*
  *  Copyright (c) 2009 embedded brains GmbH
  *  Copyright (C) 1998 valette at crf.canon.fr
  *
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 40e6626..5ea84e5 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
@@ -1,7 +1,8 @@
-/* irq.c
- *
+/*
  *  This file contains the implementation of the function described in irq.h
- *
+ */
+
+/*
  *  Copyright (C) 1998 valette at crf.canon.fr
  *
  *  COPYRIGHT (c) 1989-2011.
@@ -19,6 +20,8 @@
 #include <rtems/score/cpu.h>
 #include <rtems/score/percpu.h>
 
+#include <bsp.h> /* to establish dependency on prototype */
+
 #ifndef CPU_STACK_ALIGNMENT
 #error "Missing header? CPU_STACK_ALIGNMENT is not defined here"
 #endif
diff --git a/c/src/lib/libbsp/i386/shared/pci/pcibios.c b/c/src/lib/libbsp/i386/shared/pci/pcibios.c
index b704eab..7767e7c 100644
--- a/c/src/lib/libbsp/i386/shared/pci/pcibios.c
+++ b/c/src/lib/libbsp/i386/shared/pci/pcibios.c
@@ -264,24 +264,6 @@ pci_bus_count(void)
   return ucBusCount;
 }
 
-
-int
-BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
-                   int instance, int *pbus, int *pdev, int *pfun )
-{
-   int sig, rval;
-
-   rval = pcib_find_by_devid(vendorid, deviceid, instance, &sig);
-
-   if ( PCIB_ERR_SUCCESS == rval ) {
-		*pbus = PCIB_DEVSIG_BUS(sig);
-		*pdev = PCIB_DEVSIG_DEV(sig);
-		*pfun = PCIB_DEVSIG_FUNC(sig);
-   }
-
-   return rval;
-}
-
 /*
  * Generate Special Cycle
  */



More information about the vc mailing list