[PATCH 07/62] m68k/ods68302: Fix warnings

Joel Sherrill joel.sherrill at oarcorp.com
Wed Oct 15 19:59:57 UTC 2014


---
 c/src/lib/libbsp/m68k/ods68302/Makefile.am         |  4 +-
 c/src/lib/libbsp/m68k/ods68302/console/console.c   | 46 ++++------------------
 c/src/lib/libbsp/m68k/ods68302/include/bsp.h       | 31 +++++++++++++++
 c/src/lib/libbsp/m68k/ods68302/start/reset.S       | 12 ++++--
 c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c | 15 +++++--
 c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c |  6 +++
 c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c  | 31 ---------------
 c/src/lib/libbsp/m68k/ods68302/startup/trace.c     |  6 +--
 8 files changed, 67 insertions(+), 84 deletions(-)
 delete mode 100644 c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c

diff --git a/c/src/lib/libbsp/m68k/ods68302/Makefile.am b/c/src/lib/libbsp/m68k/ods68302/Makefile.am
index 7c77320..4b5cfed 100644
--- a/c/src/lib/libbsp/m68k/ods68302/Makefile.am
+++ b/c/src/lib/libbsp/m68k/ods68302/Makefile.am
@@ -45,8 +45,8 @@ libbsp_a_SOURCES =
 libbsp_a_SOURCES += startup/cpuboot.c startup/crc.c startup/debugport.c \
     startup/gdb-hooks.c ../../shared/bootcard.c \
     startup/m68302scc.c startup/m68k-stub.c \
-    ../../shared/bsppretaskinghook.c startup/memcheck.c \
-    ../../shared/bspgetworkarea.c startup/memcheck.c \
+    ../../shared/bsppretaskinghook.c \
+    ../../shared/bspgetworkarea.c \
     startup/trace.c ../../shared/gnatinstallhandler.c ../../shared/bsplibc.c \
     ../../shared/bsppredriverhook.c ../../shared/bsppost.c \
     ../../shared/bspstart.c ../../shared/bspclean.c ../../shared/sbrk.c \
diff --git a/c/src/lib/libbsp/m68k/ods68302/console/console.c b/c/src/lib/libbsp/m68k/ods68302/console/console.c
index 24069a2..4077904 100644
--- a/c/src/lib/libbsp/m68k/ods68302/console/console.c
+++ b/c/src/lib/libbsp/m68k/ods68302/console/console.c
@@ -1,7 +1,9 @@
 /*
  * Initialize the MC68302 SCC2 for console IO board support package.
- *
- *  COPYRIGHT (c) 1989-1999.
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2014.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -18,14 +20,7 @@
 /*  console_initialize
  *
  *  This routine initializes the console IO driver.
- *
- *  Input parameters: NONE
- *
- *  Output parameters:  NONE
- *
- *  Return values:
  */
-
 rtems_device_driver console_initialize(
   rtems_device_major_number  major,
   rtems_device_minor_number  minor,
@@ -46,23 +41,14 @@ rtems_device_driver console_initialize(
     rtems_fatal_error_occurred(status);
 
   return RTEMS_SUCCESSFUL;
-
 }
 
 /*  is_character_ready
  *
  *  Check to see if a character is available on the MC68302's SCC2.  If so,
  *  then return a TRUE (along with the character).  Otherwise return FALSE.
- *
- *  Input parameters:   pointer to location in which to return character
- *
- *  Output parameters:  character (if available)
- *
- *  Return values:      TRUE - character available
- *                      FALSE - no character available
  */
-
-bool is_character_ready(
+static bool is_character_ready(
   char *ch				/* -> character  */
 )
 {
@@ -77,15 +63,8 @@ bool is_character_ready(
 /*  inbyte
  *
  *  Receive a character from the MC68302's SCC2.
- *
- *  Input parameters:   NONE
- *
- *  Output parameters:  NONE
- *
- *  Return values:      character read
  */
-
-char inbyte( void )
+static char inbyte( void )
 {
   char ch;
 
@@ -98,14 +77,8 @@ char inbyte( void )
  *
  *  Transmit a character out on the MC68302's SCC2.
  *  It may support XON/XOFF flow control.
- *
- *  Input parameters:
- *    ch  - character to be transmitted
- *
- *  Output parameters:  NONE
  */
-
-void outbyte(
+static void outbyte(
   char ch
 )
 {
@@ -115,7 +88,6 @@ void outbyte(
 /*
  *  Open entry point
  */
-
 rtems_device_driver console_open(
   rtems_device_major_number major,
   rtems_device_minor_number minor,
@@ -128,7 +100,6 @@ rtems_device_driver console_open(
 /*
  *  Close entry point
  */
-
 rtems_device_driver console_close(
   rtems_device_major_number major,
   rtems_device_minor_number minor,
@@ -141,7 +112,6 @@ rtems_device_driver console_close(
 /*
  * read bytes from the serial port. We only have stdin.
  */
-
 rtems_device_driver console_read(
   rtems_device_major_number major,
   rtems_device_minor_number minor,
@@ -173,7 +143,6 @@ rtems_device_driver console_read(
 /*
  * write bytes to the serial port. Stdout and stderr are the same.
  */
-
 rtems_device_driver console_write(
   rtems_device_major_number major,
   rtems_device_minor_number minor,
@@ -204,7 +173,6 @@ rtems_device_driver console_write(
 /*
  *  IO Control entry point
  */
-
 rtems_device_driver console_control(
   rtems_device_major_number major,
   rtems_device_minor_number minor,
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/bsp.h b/c/src/lib/libbsp/m68k/ods68302/include/bsp.h
index c951696..ae3699a 100644
--- a/c/src/lib/libbsp/m68k/ods68302/include/bsp.h
+++ b/c/src/lib/libbsp/m68k/ods68302/include/bsp.h
@@ -15,6 +15,8 @@
 #ifndef _BSP_H
 #define _BSP_H
 
+#ifndef ASM
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -62,8 +64,37 @@ rtems_isr_entry set_vector(
   int                 type
 );
 
+/*
+ * Prototypes for methods called only from .S files
+ */
+void boot_phase_1(void);
+void boot_phase_2(void);
+void boot_phase_3(void);
+void trace_exception(
+  unsigned long d0,
+  unsigned long d1,
+  unsigned long d2,
+  unsigned long d3,
+  unsigned long d4,
+  unsigned long d5,
+  unsigned long d6,
+  unsigned long d7,
+  unsigned long a0,
+  unsigned long a1,
+  unsigned long a2,
+  unsigned long a3,
+  unsigned long a4,
+  unsigned long a5,
+  unsigned long a6,
+  unsigned long a7,
+  unsigned long sr_pch,
+  unsigned long pcl_format
+);
+
 #ifdef __cplusplus
 }
 #endif
 
 #endif
+
+#endif
diff --git a/c/src/lib/libbsp/m68k/ods68302/start/reset.S b/c/src/lib/libbsp/m68k/ods68302/start/reset.S
index 481ebe4..22f5d82 100644
--- a/c/src/lib/libbsp/m68k/ods68302/start/reset.S
+++ b/c/src/lib/libbsp/m68k/ods68302/start/reset.S
@@ -1,16 +1,18 @@
 /*
+ *  Manages all vectors with seperate handlers to trap unhandled
+ *  execptions.
+ *
  *  Re-written the gen68302 start-up code.
  *
  *  Uses gas syntax only, removed the OAR asm.h.
  *
  *  Supplies a complete vector table in ROM.
  *
- *  Manages all vectors with seperate handlers to trap unhandled
- *  execptions.
- *
  *  Uses the target specific header file to get the runtime
  *  configuration
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1996
  *  Objective Design Systems Pty Ltd (ODS)
  *
@@ -19,6 +21,8 @@
  *
  */
 
+#include <bsp.h>  /* just to indicate the dependency */
+
 |
 | some basic defined, this is that is required
 |
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c b/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
index 0ea119c..45bfe42 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
@@ -1,9 +1,7 @@
-/*****************************************************************************/
 /*
-  Hooks for GDB
-
+ *  Hooks for GDB
+ *
  */
-/*****************************************************************************/
 
 #include <bsp.h>
 #include <rtems/m68k/m68302.h>
@@ -11,6 +9,15 @@
 
 static int initialised = 0;
 
+/*
+ * This file does not intend to make things part of the public interface.
+ * Methods here are only available to the GDB stub. So prototypes are
+ * needed to avoid warnings.
+ */
+void putDebugChar(char ch);
+char getDebugChar(void);
+void exceptionHandler(unsigned int vector, void *handler);
+
 void putDebugChar(char ch)
 {
   if (!initialised)
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c b/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
index e82bb72..d9533ef 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
@@ -537,6 +537,12 @@ __asm__ ("		movel   %d0,%sp at -");	/* push exception onto stack  */
 __asm__ ("		jbsr    handle_exception");    /* this never returns */
 __asm__ ("           rts");                  /* return */
 
+/*
+ * This is only called from assembly in this file. This file is a self
+ * contained gdb stub.
+ */
+void _returnFromException(Frame *frame);
+
 void _returnFromException(Frame *frame)
 {
   /* if no passed in frame, use the last one */
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c b/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c
deleted file mode 100644
index 74d8f92..0000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*****************************************************************************/
-/*
-  Memory check routines.
-
-  The production test is a destrucive full test.
-  The boot test is a minimal, non-desctructive.
-  The partial memory test performs a scetion at a time, and gets
-  called in a repeated fashion to completely check the memory,
-
- */
-/*****************************************************************************/
-
-void
-production_memory_test(void)
-{
-}
-
-void
-boot_memory_test(void)
-{
-}
-
-void
-reset_partial_memory_test(void)
-{
-}
-
-void
-partial_memory_test(void)
-{
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/trace.c b/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
index 46114ea..efe8abf 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
@@ -1,9 +1,7 @@
-/*****************************************************************************/
 /*
-  Trace Exception dumps a back trace to the debug serial port
-
+ *  Trace Exception dumps a back trace to the debug serial port
+ *
  */
-/*****************************************************************************/
 
 #include <bsp.h>
 #include <debugport.h>
-- 
1.9.3




More information about the devel mailing list