[PATCH 10/15] Clean up compiler warnings

Ric Claus claus at slac.stanford.edu
Tue Nov 27 03:26:48 UTC 2012


---
 c/src/lib/libbsp/powerpc/virtex5/Makefile.am       |    6 ++--
 c/src/lib/libbsp/powerpc/virtex5/include/irq.h     |    6 +++-
 c/src/lib/libbsp/powerpc/virtex5/irq/irq_init.c    |   26 ++++++++++---------
 c/src/lib/libbsp/powerpc/virtex5/mmu/mmu.c         |    1 -
 c/src/lib/libbsp/powerpc/virtex5/preinstall.am     |    4 +++
 .../lib/libbsp/powerpc/virtex5/startup/bspstart.c  |   19 ++------------
 6 files changed, 28 insertions(+), 34 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/virtex5/Makefile.am b/c/src/lib/libbsp/powerpc/virtex5/Makefile.am
index 9d8800c..a2b6bd3 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/virtex5/Makefile.am
@@ -41,8 +41,6 @@ libbsp_a_SOURCES = startup/bspclean.c \
 libbsp_a_SOURCES += startup/start.S
 
 # clock & timer
-libbsp_a_SOURCES += ../../../libcpu/@RTEMS_CPU@/mpc6xx/clock/c_clock.c
-libbsp_a_SOURCES += ../../../libcpu/@RTEMS_CPU@/mpc6xx/timer/timer.c
 libbsp_a_SOURCES += ../../powerpc/shared/clock/p_clock.c
 
 # console
@@ -67,7 +65,9 @@ libbsp_a_SOURCES += libc/memcpy.c libc/fastcopy.S
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
                   ../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
                   ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
-                  ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel
+                  ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
+                  ../../../libcpu/@RTEMS_CPU@/e500/clock.rel \
+                  ../../../libcpu/@RTEMS_CPU@/e500/timer.rel
 
 EXTRA_DIST = times
 
diff --git a/c/src/lib/libbsp/powerpc/virtex5/include/irq.h b/c/src/lib/libbsp/powerpc/virtex5/include/irq.h
index 62a86a5..35e2148 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/include/irq.h
+++ b/c/src/lib/libbsp/powerpc/virtex5/include/irq.h
@@ -62,7 +62,7 @@ extern "C" {
  */
   typedef enum {
     BSP_EXT               = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 0,
-    BSP_DEC               = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 1,
+    BSP_PIT               = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 1,
     BSP_CRIT              = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 2
   } rtems_irq_symbolic_name;
 
@@ -72,7 +72,9 @@ extern "C" {
 #ifdef __cplusplus
 }
 #endif
-#define	BSP_DECREMENTER   BSP_DEC
+
+#define	BSP_DEC           BSP_PIT
+#define	BSP_DECREMENTER   BSP_PIT
 
 #endif /* ASM */
 
diff --git a/c/src/lib/libbsp/powerpc/virtex5/irq/irq_init.c b/c/src/lib/libbsp/powerpc/virtex5/irq/irq_init.c
index 2eeed10..51fb8a9 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/irq/irq_init.c
+++ b/c/src/lib/libbsp/powerpc/virtex5/irq/irq_init.c
@@ -35,21 +35,21 @@ rtems_irq_global_settings* BSP_rtems_irq_config;
  * these functions just do nothing fulfill the semantic
  * requirements to enable/disable a certain interrupt or exception
  */
-void BSP_irq_nop_func(const rtems_irq_connect_data *unused)
+static void BSP_irq_nop_func(const rtems_irq_connect_data *unused)
 {
   /*
    * nothing to do
    */
 }
 
-void BSP_irq_nop_hdl(void *hdl)
+static void BSP_irq_nop_hdl(void *hdl)
 {
   /*
    * nothing to do
    */
 }
 
-int BSP_irq_isOn_func(const rtems_irq_connect_data *unused)
+static int BSP_irq_isOn_func(const rtems_irq_connect_data *unused)
 {
   /*
    * nothing to do
@@ -64,7 +64,7 @@ int BSP_irq_isOn_func(const rtems_irq_connect_data *unused)
 /***********************************************************
  * functions to enable/disable/query external/critical interrupts
  */
-void BSP_irqexc_on_fnc(rtems_irq_connect_data *conn_data)
+static void BSP_irqexc_on_fnc(const rtems_irq_connect_data *conn_data)
 {
   uint32_t msr_value;
   /*
@@ -76,7 +76,7 @@ void BSP_irqexc_on_fnc(rtems_irq_connect_data *conn_data)
   _CPU_MSR_SET(msr_value);
 }
 
-void BSP_irqexc_off_fnc(rtems_irq_connect_data *unused)
+static void BSP_irqexc_off_fnc(const rtems_irq_connect_data *unused)
 {
   uint32_t msr_value;
   /*
@@ -90,7 +90,8 @@ void BSP_irqexc_off_fnc(rtems_irq_connect_data *unused)
 
 SPR_RW(BOOKE_TSR)
 
-int C_dispatch_dec_handler (BSP_Exception_frame *frame, unsigned int excNum)
+static int C_dispatch_dec_handler (BSP_Exception_frame *frame,
+                                   unsigned int         excNum)
 {
   /* Acknowledge the interrupt */
   _write_BOOKE_TSR( BOOKE_TSR_DIS );
@@ -105,7 +106,8 @@ int C_dispatch_dec_handler (BSP_Exception_frame *frame, unsigned int excNum)
 /***********************************************************
  * High level IRQ handler called from shared_raw_irq_code_entry
  */
-int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum)
+static int C_dispatch_irq_handler (BSP_Exception_frame *frame,
+                                   unsigned int         excNum)
 {
   /*
    * Handle interrupt
@@ -292,17 +294,17 @@ int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
  * dummy for an empty IRQ handler entry
  */
 static rtems_irq_connect_data emptyIrq = {
-  0, 		         /* Irq Name                 */
+  0, 		         /* IRQ Name                 */
   BSP_irq_nop_hdl,       /* handler function         */
   NULL,                  /* handle passed to handler */
-  BSP_irq_nop_func,      /* on function              */
-  BSP_irq_nop_func,      /* off function             */
+  BSP_irqexc_on_fnc,     /* on function              */
+  BSP_irqexc_off_fnc,    /* off function             */
   BSP_irq_isOn_func      /* isOn function            */
 };
 
 static rtems_irq_global_settings initialConfig = {
-  BSP_IRQ_NUMBER,    /* irqNb */
-  {  0, 		         /* Irq Name                 */
+  BSP_IRQ_NUMBER,           /* IRQ number               */
+  {  0, 		    /* IRQ Name                 */
      BSP_irq_nop_hdl,       /* handler function         */
      NULL,                  /* handle passed to handler */
      BSP_irq_nop_func,      /* on function              */
diff --git a/c/src/lib/libbsp/powerpc/virtex5/mmu/mmu.c b/c/src/lib/libbsp/powerpc/virtex5/mmu/mmu.c
index a598024..990cb99 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/mmu/mmu.c
+++ b/c/src/lib/libbsp/powerpc/virtex5/mmu/mmu.c
@@ -543,7 +543,6 @@ bsp_mmu_invalidate(bsp_tlb_idx_t key)
   bsp_tlb_idx_t         k0;
   rtems_interrupt_level lvl;
   bsp_tlb_entry_t       tlb;
-  uint32_t              msr;
 
   /* minimal guard against bad key */
   if ( key < 0 || key > NTLBS-1 )
diff --git a/c/src/lib/libbsp/powerpc/virtex5/preinstall.am b/c/src/lib/libbsp/powerpc/virtex5/preinstall.am
index 34b03f1..e441f38 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/preinstall.am
+++ b/c/src/lib/libbsp/powerpc/virtex5/preinstall.am
@@ -69,6 +69,10 @@ $(PROJECT_INCLUDE)/bsp/irq.h: include/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
 
+$(PROJECT_INCLUDE)/bsp/mmu.h: include/mmu.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mmu.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/mmu.h
+
 $(PROJECT_INCLUDE)/bsp/vectors.h: ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h
diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
index 53e8a37..5b47d4e 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
@@ -151,24 +151,14 @@ void BSP_ask_for_reset(void)
 
 void BSP_panic(char *s)
 {
-  rtems_interrupt_level level;
-
-  rtems_interrupt_disable(level);
-
   printk("\n%s PANIC %s\n", rtems_get_version_string(), s);
-
   BSP_ask_for_reset();
 }
 
 
 void _BSP_Fatal_error(unsigned int v)
 {
-  rtems_interrupt_level level;
-
-  rtems_interrupt_disable(level);
-
   printk("\n%s FATAL ERROR %x\n", rtems_get_version_string(), v);
-
   BSP_ask_for_reset();
 }
 
@@ -223,12 +213,9 @@ void bsp_start(void)
   intrStackStart = CPU_UP_ALIGN((uint32_t)__bsp_ram_start);
   intrStackSize  = rtems_configuration_get_interrupt_stack_size();
 
-  sc = ppc_exc_initialize(PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
-                          intrStackStart,
-                          intrStackSize);
-  if (sc != RTEMS_SUCCESSFUL) {
-    BSP_panic("Cannot initialize exceptions");
-  }
+  ppc_exc_initialize(PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
+                     intrStackStart,
+                     intrStackSize);
 
   /* Let the user know what parameters we were compiled with */
   printk("                  Base/Start     End         Size\n"
-- 
1.7.1




More information about the devel mailing list