[rtems commit] no_cpu: Remove use of proc_ptr

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


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Nov  9 07:54:31 2018 +0100

no_cpu: Remove use of proc_ptr

Update #3585.

---

 cpukit/score/cpu/no_cpu/cpu.c                     | 38 ++++++++++++-----------
 cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h | 21 +++++++++----
 2 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/cpukit/score/cpu/no_cpu/cpu.c b/cpukit/score/cpu/no_cpu/cpu.c
index fe1e303..6202708 100644
--- a/cpukit/score/cpu/no_cpu/cpu.c
+++ b/cpukit/score/cpu/no_cpu/cpu.c
@@ -51,9 +51,9 @@ uint32_t   _CPU_ISR_Get_level( 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
 )
 {
   /*
@@ -63,27 +63,29 @@ void _CPU_ISR_install_raw_handler(
 }
 
 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
 )
 {
-   *old_handler = _ISR_Vector_table[ vector ];
+  CPU_ISR_raw_handler ignored;
 
-   /*
-    *  If the interrupt vector table is a table of pointer to isr entry
-    *  points, then we need to install the appropriate RTEMS interrupt
-    *  handler for this vector number.
-    */
+  *old_handler = _ISR_Vector_table[ vector ];
 
-   _CPU_ISR_install_raw_handler( vector, new_handler, old_handler );
+  /*
+   *  If the interrupt vector table is a table of pointer to isr entry
+   *  points, then we need to install the appropriate RTEMS interrupt
+   *  handler for this vector number.
+   */
+
+  _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
 
-   /*
-    *  We put the actual user ISR address in '_ISR_vector_table'.  This will
-    *  be used by the _ISR_Handler so the user gets control.
-    */
+  /*
+   *  We put the actual user ISR address in '_ISR_vector_table'.  This will
+   *  be used by the _ISR_Handler so the user gets control.
+   */
 
-    _ISR_Vector_table[ vector ] = new_handler;
+   _ISR_Vector_table[ vector ] = new_handler;
 }
 
 /*
diff --git a/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
index 8e66182..a9294d0 100644
--- a/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
@@ -976,12 +976,16 @@ uint32_t   _CPU_ISR_Get_level( void );
  */
 void _CPU_Initialize(void);
 
+typedef void ( *CPU_ISR_raw_handler )( void );
+
 /**
  * @ingroup CPUInterrupt
  * 
  * This routine installs a "raw" interrupt handler directly into the
  * processor's vector table.
  *
+ * This routine is not used by architecture-independent code and thus optional.
+ *
  * @param[in] vector is the vector number
  * @param[in] new_handler is the raw ISR handler to install
  * @param[in] old_handler is the previously installed ISR Handler
@@ -991,16 +995,21 @@ void _CPU_Initialize(void);
  * XXX document implementation including references if appropriate
  */
 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
 );
 
+typedef void ( *CPU_ISR_handler )( uint32_t );
+
 /**
  * @ingroup CPUInterrupt
  * 
  * This routine installs an interrupt vector.
  *
+ * This routine is only used by architecture-independent code if
+ * CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE, otherwise it is optional.
+ *
  * @param[in] vector is the vector number
  * @param[in] new_handler is the RTEMS ISR handler to install
  * @param[in] old_handler is the previously installed ISR Handler
@@ -1010,9 +1019,9 @@ void _CPU_ISR_install_raw_handler(
  * XXX document implementation including references if appropriate
  */
 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