[rtems commit] m68k: Remove use of proc_ptr

Sebastian Huber sebh at rtems.org
Mon Nov 12 14:42:25 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov  8 15:44:56 2018 +0100

m68k: Remove use of proc_ptr

Update #3585.

---

 bsps/m68k/gen68340/console/console.c            |  4 ++--
 bsps/m68k/shared/fpsp/rtems_fpsp.c              | 10 +++++---
 cpukit/score/cpu/m68k/cpu.c                     | 32 ++++++++++++-------------
 cpukit/score/cpu/m68k/include/rtems/score/cpu.h | 27 +++++++--------------
 4 files changed, 34 insertions(+), 39 deletions(-)

diff --git a/bsps/m68k/gen68340/console/console.c b/bsps/m68k/gen68340/console/console.c
index d6634b1..b10ad95 100644
--- a/bsps/m68k/gen68340/console/console.c
+++ b/bsps/m68k/gen68340/console/console.c
@@ -308,7 +308,7 @@ dbugInitialise (void)
 	      it may be usefull to do so to check for performances with an oscilloscope */
 	   /*
 	   {
-	    proc_ptr ignored;
+	    CPU_ISR_raw_handler ignored;
 	    _CPU_ISR_install_raw_handler( CONSOLE_VECTOR, _Debug_ISR_Handler_Console, &ignored );
 	   }
 	   */
@@ -391,7 +391,7 @@ dbugInitialise (void)
 	      it may be usefull to do so to check for performances with an oscilloscope */
 	   /*
 	   {
-	    proc_ptr ignored;
+	    CPU_ISR_raw_handler ignored;
 	    _CPU_ISR_install_raw_handler( CONSOLE_VECTOR, _Debug_ISR_Handler_Console, &ignored );
 	   }
 	   */
diff --git a/bsps/m68k/shared/fpsp/rtems_fpsp.c b/bsps/m68k/shared/fpsp/rtems_fpsp.c
index 9a237e7..558dc04 100644
--- a/bsps/m68k/shared/fpsp/rtems_fpsp.c
+++ b/bsps/m68k/shared/fpsp/rtems_fpsp.c
@@ -6,14 +6,18 @@
 /*
  * User exception handlers
  */
-proc_ptr M68040FPSPUserExceptionHandlers[9];
+CPU_ISR_raw_handler M68040FPSPUserExceptionHandlers[9];
 
 /*
  * Intercept requests to install an exception handler.
  * FPSP exceptions get special treatment.
  */
 static int
-FPSP_install_raw_handler (uint32_t   vector, proc_ptr new_handler, proc_ptr *old_handler)
+FPSP_install_raw_handler(
+  uint32_t vector,
+  CPU_ISR_raw_handler new_handler,
+  CPU_ISR_raw_handler *old_handler
+)
 {
   int fpspVector;
 
@@ -71,7 +75,7 @@ M68KFPSPInstallExceptionHandlers (void)
     { 55,  _fpspEntry_unsupp },
   };
   int i;
-  proc_ptr oldHandler;
+  CPU_ISR_raw_handler oldHandler;
 
   for (i = 0 ; i < sizeof fpspHandlers / sizeof fpspHandlers[0] ; i++) {
     _CPU_ISR_install_raw_handler(fpspHandlers[i].vector_number, fpspHandlers[i].handler, &oldHandler);
diff --git a/cpukit/score/cpu/m68k/cpu.c b/cpukit/score/cpu/m68k/cpu.c
index 87e0fe3..be63351 100644
--- a/cpukit/score/cpu/m68k/cpu.c
+++ b/cpukit/score/cpu/m68k/cpu.c
@@ -50,8 +50,8 @@ _CPU_ISR_jump_table[ CPU_INTERRUPT_NUMBER_OF_VECTORS ];
 #if (M68K_HAS_FPSP_PACKAGE == 1)
 int (*_FPSP_install_raw_handler)(
   uint32_t   vector,
-  proc_ptr new_handler,
-  proc_ptr *old_handler
+  CPU_ISR_raw_handler new_handler,
+  CPU_ISR_raw_handler *old_handler
 );
 #endif
 
@@ -97,17 +97,17 @@ uint32_t   _CPU_ISR_Get_level( void )
   return level;
 }
 
-/*
- *  _CPU_ISR_install_raw_handler
- */
-
 void _CPU_ISR_install_raw_handler(
-  uint32_t    vector,
-  proc_ptr    new_handler,
-  proc_ptr   *old_handler
+  uint32_t             vector,
+  CPU_ISR_raw_handler  new_handler,
+  CPU_ISR_raw_handler *old_handler
 )
 {
-  proc_ptr *interrupt_table = NULL;
+#if ( M68K_HAS_VBR == 1 )
+  CPU_ISR_raw_handler *interrupt_table = NULL;
+#else
+  _CPU_ISR_handler_entry *interrupt_table = NULL;
+#endif
 
 #if (M68K_HAS_FPSP_PACKAGE == 1)
   /*
@@ -141,20 +141,20 @@ void _CPU_ISR_install_raw_handler(
    *  load it appropriately to vector to the RTEMS jump table.
    */
 
-  *old_handler = (proc_ptr) _CPU_ISR_jump_table[vector].isr_handler;
+  *old_handler = (CPU_ISR_raw_handler) _CPU_ISR_jump_table[vector].isr_handler;
   _CPU_ISR_jump_table[vector].isr_handler = (uint32_t) new_handler;
   if ( (uint32_t) interrupt_table != 0xFFFFFFFF )
-    interrupt_table[ vector ] = (proc_ptr) &_CPU_ISR_jump_table[vector];
+    interrupt_table[ vector ] = &_CPU_ISR_jump_table[vector];
 #endif /* M68K_HAS_VBR */
 }
 
 void _CPU_ISR_install_vector(
-  uint32_t    vector,
-  proc_ptr    new_handler,
-  proc_ptr   *old_handler
+  uint32_t         vector,
+  CPU_ISR_handler  new_handler,
+  CPU_ISR_handler *old_handler
 )
 {
-  proc_ptr ignored = 0;  /* to avoid warning */
+  CPU_ISR_raw_handler ignored = 0;  /* to avoid warning */
 
   *old_handler = _ISR_Vector_table[ vector ];
 
diff --git a/cpukit/score/cpu/m68k/include/rtems/score/cpu.h b/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
index cd3f55f..08690f2 100644
--- a/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
@@ -564,29 +564,20 @@ extern const unsigned char _CPU_m68k_BFFFO_table[256];
 
 void _CPU_Initialize(void);
 
-/*
- *  _CPU_ISR_install_raw_handler
- *
- *  This routine installs a "raw" interrupt handler directly into the
- *  processor's vector table.
- */
+typedef void ( *CPU_ISR_raw_handler )( void );
 
 void _CPU_ISR_install_raw_handler(
-  uint32_t    vector,
-  proc_ptr    new_handler,
-  proc_ptr   *old_handler
+  uint32_t             vector,
+  CPU_ISR_raw_handler  new_handler,
+  CPU_ISR_raw_handler *old_handler
 );
 
-/*
- *  _CPU_ISR_install_vector
- *
- *  This routine installs an interrupt vector.
- */
+typedef void ( *CPU_ISR_handler )( uint32_t );
 
 void _CPU_ISR_install_vector(
   uint32_t         vector,
-  proc_ptr         new_handler,
-  proc_ptr        *old_handler
+  CPU_ISR_handler  new_handler,
+  CPU_ISR_handler *old_handler
 );
 
 /*
@@ -677,8 +668,8 @@ void M68KFPSPInstallExceptionHandlers (void);
 
 extern int (*_FPSP_install_raw_handler)(
   uint32_t   vector,
-  proc_ptr new_handler,
-  proc_ptr *old_handler
+  CPU_ISR_raw_handler new_handler,
+  CPU_ISR_raw_handler *old_handler
 );
 
 #endif



More information about the vc mailing list