[PATCH 07/54] m68k/uC5282: Fix warnings

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


---
 c/src/lib/libbsp/m68k/uC5282/clock/clock.c      |  2 +-
 c/src/lib/libbsp/m68k/uC5282/include/bsp.h      | 10 +++++
 c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c | 52 ++-----------------------
 c/src/lib/libbsp/m68k/uC5282/startup/init5282.c | 14 ++++++-
 4 files changed, 27 insertions(+), 51 deletions(-)

diff --git a/c/src/lib/libbsp/m68k/uC5282/clock/clock.c b/c/src/lib/libbsp/m68k/uC5282/clock/clock.c
index 139a07f..8636f96 100644
--- a/c/src/lib/libbsp/m68k/uC5282/clock/clock.c
+++ b/c/src/lib/libbsp/m68k/uC5282/clock/clock.c
@@ -128,7 +128,7 @@ Thread bsp_idle_thread(uint32_t ignored)
     __asm__ volatile ("addq.l #1,%0"::"m"(IDLE_COUNTER));
 }
 
-int rtems_bsp_cpu_load_percentage(void)
+int bsp_cpu_load_percentage(void)
 {
     return MAX_IDLE_COUNT ?
            (100 - ((100 * (FILTERED_IDLE >> FILTER_SHIFT)) / MAX_IDLE_COUNT)) :
diff --git a/c/src/lib/libbsp/m68k/uC5282/include/bsp.h b/c/src/lib/libbsp/m68k/uC5282/include/bsp.h
index ecde78e..23579f2 100644
--- a/c/src/lib/libbsp/m68k/uC5282/include/bsp.h
+++ b/c/src/lib/libbsp/m68k/uC5282/include/bsp.h
@@ -138,6 +138,16 @@ void *bsp_idle_thread( uintptr_t ignored );
 #define BSP_IDLE_TASK_BODY bsp_idle_thread
 
 /*
+ *  The custom IDLE task keeps some idle statistics.
+ */
+int bsp_cpu_load_percentage(void);
+
+/*
+ *  This is a helper method to determine the cause of a reset.
+ */
+void bsp_reset_cause(char *buf, size_t capacity);
+
+/*
  * SRAM. The BSP uses SRAM for maintaining some clock-driver data
  *       and for ethernet descriptors (and the initial stack during
  *       early boot).
diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c b/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c
index 8623056..791913d 100644
--- a/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c
@@ -411,6 +411,7 @@ do {                                                   \
 } while (0)
 
 #define syscall_1(type,name,d1type,d1)                      \
+type bsp_##name(d1type d1);                                 \
 type bsp_##name(d1type d1)                                  \
 {                                                           \
    long ret;                                                \
@@ -425,6 +426,7 @@ type bsp_##name(d1type d1)                                  \
 }
 
 #define syscall_2(type,name,d1type,d1,d2type,d2)            \
+type bsp_##name(d1type d1, d2type d2);                      \
 type bsp_##name(d1type d1, d2type d2)                       \
 {                                                           \
    long ret;                                                \
@@ -441,6 +443,7 @@ type bsp_##name(d1type d1, d2type d2)                       \
 }
 
 #define syscall_3(type,name,d1type,d1,d2type,d2,d3type,d3)  \
+type bsp_##name(d1type d1, d2type d2, d3type d3);           \
 type bsp_##name(d1type d1, d2type d2, d3type d3)            \
 {                                                           \
    long ret;                                                \
@@ -598,53 +601,6 @@ rtems_interrupt_level level;
   rtems_interrupt_enable(level);
 }
 
-static void
-disable_irq(unsigned source)
-{
-rtems_interrupt_level level;
-
-  rtems_interrupt_disable(level);
-  if (source >= 32)
-    MCF5282_INTC0_IMRH |= (1 << (source - 32));
-  else
-    MCF5282_INTC0_IMRL |= (1 << source);
-  rtems_interrupt_enable(level);
-}
-
-void
-BSP_enable_irq_at_pic(rtems_vector_number v)
-{
-int                   source = v - 64;
-
-  if ( source > 0 && source < 64 ) {
-    enable_irq(source);
-  }
-}
-
-void
-BSP_disable_irq_at_pic(rtems_vector_number v)
-{
-int                   source = v - 64;
-
-  if ( source > 0 && source < 64 ) {
-    disable_irq(source);
-  }
-}
-
-int
-BSP_irq_is_enabled_at_pic(rtems_vector_number v)
-{
-int                   source = v - 64;
-
-  if ( source > 0 && source < 64 ) {
-    return ! ((source >= 32) ?
-      MCF5282_INTC0_IMRH & (1 << (source - 32)) :
-      MCF5282_INTC0_IMRL & (1 << source));
-  }
-  return -1;
-}
-
-
 static int
 init_intc0_bit(unsigned long vector)
 {
@@ -756,7 +712,7 @@ BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr
 }
 
 void
-rtems_bsp_reset_cause(char *buf, size_t capacity)
+bsp_reset_cause(char *buf, size_t capacity)
 {
   int bit, rsr;
   size_t i;
diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/init5282.c b/c/src/lib/libbsp/m68k/uC5282/startup/init5282.c
index 62a96b5..201ee58 100644
--- a/c/src/lib/libbsp/m68k/uC5282/startup/init5282.c
+++ b/c/src/lib/libbsp/m68k/uC5282/startup/init5282.c
@@ -5,7 +5,9 @@
  *
  * This routine is pretty simple for the uC5282 because all the hard
  * work has been done by the bootstrap dBUG code.
- *
+ */
+
+/*
  *  Author: W. Eric Norum <norume at aps.anl.gov>
  *
  *  COPYRIGHT (c) 2005.
@@ -23,7 +25,15 @@
 #define m68k_set_acr0(_acr0) __asm__ volatile ("movec %0,%%acr0" : : "d" (_acr0))
 #define m68k_set_acr1(_acr1) __asm__ volatile ("movec %0,%%acr1" : : "d" (_acr1))
 
- extern void CopyDataClearBSSAndStart (void);
+/*
+ * This method is implemented in start.S.
+ */
+extern void CopyDataClearBSSAndStart (void);
+
+/*
+ * This method cannot be static because it is called from start.S.
+ */
+void Init5282 (void);
 
 void Init5282 (void)
 {
-- 
1.9.3




More information about the devel mailing list