[rtems commit] arm: Remove use of proc_ptr

Sebastian Huber sebh at rtems.org
Mon Nov 12 14:41:45 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Nov  9 08:01:53 2018 +0100

arm: Remove use of proc_ptr

Update #3585.

---

 cpukit/score/cpu/arm/armv7m-isr-vector-install.c |  6 +++---
 cpukit/score/cpu/arm/cpu.c                       | 16 ++++++++--------
 cpukit/score/cpu/arm/include/rtems/score/cpu.h   |  8 +++++---
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/cpukit/score/cpu/arm/armv7m-isr-vector-install.c b/cpukit/score/cpu/arm/armv7m-isr-vector-install.c
index cb3abc9..26a0c5a 100644
--- a/cpukit/score/cpu/arm/armv7m-isr-vector-install.c
+++ b/cpukit/score/cpu/arm/armv7m-isr-vector-install.c
@@ -28,9 +28,9 @@
 #ifdef ARM_MULTILIB_ARCH_V7M
 
 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
 )
 {
   uint32_t level;
diff --git a/cpukit/score/cpu/arm/cpu.c b/cpukit/score/cpu/arm/cpu.c
index 01a43b3..63c31a5 100644
--- a/cpukit/score/cpu/arm/cpu.c
+++ b/cpukit/score/cpu/arm/cpu.c
@@ -144,24 +144,24 @@ uint32_t _CPU_ISR_Get_level( void )
 }
 
 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
 )
 {
   /* Redirection table starts at the end of the vector table */
-  volatile uint32_t *table = (volatile uint32_t *) (MAX_EXCEPTIONS * 4);
+  CPU_ISR_handler *table = (CPU_ISR_handler *) (MAX_EXCEPTIONS * 4);
 
-  uint32_t current_handler = table [vector];
+  CPU_ISR_handler current_handler = table [vector];
 
   /* The current handler is now the old one */
   if (old_handler != NULL) {
-    *old_handler = (proc_ptr) current_handler;
+    *old_handler = current_handler;
   }
 
   /* Write only if necessary to avoid writes to a maybe read-only memory */
-  if (current_handler != (uint32_t) new_handler) {
-    table [vector] = (uint32_t) new_handler;
+  if (current_handler != new_handler) {
+    table [vector] = new_handler;
   }
 }
 
diff --git a/cpukit/score/cpu/arm/include/rtems/score/cpu.h b/cpukit/score/cpu/arm/include/rtems/score/cpu.h
index a44abe1..bb8270d 100644
--- a/cpukit/score/cpu/arm/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/include/rtems/score/cpu.h
@@ -464,10 +464,12 @@ void _CPU_Context_Initialize(
  */
 void _CPU_Initialize( void );
 
+typedef void ( *CPU_ISR_handler )( void );
+
 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
 );
 
 /**




More information about the vc mailing list