[PATCH 16/19] sh: Remove use of proc_ptr
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Nov 9 12:49:08 UTC 2018
Update #3585.
---
bsps/sh/gensh1/start/cpu_asm.c | 3 --
bsps/sh/gensh1/start/ispsh7032.c | 4 +--
bsps/sh/gensh2/start/cpu_asm.c | 3 --
bsps/sh/gensh2/start/ispsh7045.c | 4 +--
bsps/sh/gensh4/start/cpu_asm.c | 3 --
bsps/sh/shared/start/setvec.c | 2 +-
bsps/sh/shsim/start/ispshgdb.c | 4 +--
cpukit/score/cpu/sh/cpu.c | 43 +++++++--------------------
cpukit/score/cpu/sh/include/rtems/score/cpu.h | 27 +++++++----------
9 files changed, 27 insertions(+), 66 deletions(-)
diff --git a/bsps/sh/gensh1/start/cpu_asm.c b/bsps/sh/gensh1/start/cpu_asm.c
index 57c5c11796..2556623c47 100644
--- a/bsps/sh/gensh1/start/cpu_asm.c
+++ b/bsps/sh/gensh1/start/cpu_asm.c
@@ -41,9 +41,6 @@
#include <rtems/score/iosh7032.h>
#include <rtems/score/sh_io.h>
-/* from cpu_isps.c */
-extern proc_ptr _Hardware_isr_Table[];
-
unsigned long *_old_stack_ptr;
register unsigned long *stack_ptr __asm__ ("r15");
diff --git a/bsps/sh/gensh1/start/ispsh7032.c b/bsps/sh/gensh1/start/ispsh7032.c
index 05ba2f1e90..9857b755ab 100644
--- a/bsps/sh/gensh1/start/ispsh7032.c
+++ b/bsps/sh/gensh1/start/ispsh7032.c
@@ -25,7 +25,7 @@
* http://www.rtems.org/license/LICENSE.
*/
-#include <rtems/system.h>
+#include <rtems/score/cpu.h>
#include <rtems/score/ispsh7032.h>
/*
@@ -33,7 +33,7 @@
*
* It has the same structure like the actual vector table (vectab)
*/
-proc_ptr _Hardware_isr_Table[256]={
+CPU_ISR_raw_handler _Hardware_isr_Table[256]={
_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
_dummy_isp, _dummy_isp, _dummy_isp,
diff --git a/bsps/sh/gensh2/start/cpu_asm.c b/bsps/sh/gensh2/start/cpu_asm.c
index 7d6e09c4c4..479b771d73 100644
--- a/bsps/sh/gensh2/start/cpu_asm.c
+++ b/bsps/sh/gensh2/start/cpu_asm.c
@@ -39,9 +39,6 @@
#include <rtems/score/iosh7045.h>
#include <rtems/score/sh_io.h>
-/* from cpu_isps.c */
-extern proc_ptr _Hardware_isr_Table[];
-
unsigned long *_old_stack_ptr;
register unsigned long *stack_ptr __asm__ ("r15");
diff --git a/bsps/sh/gensh2/start/ispsh7045.c b/bsps/sh/gensh2/start/ispsh7045.c
index 4e6dabed3f..874d930ba1 100644
--- a/bsps/sh/gensh2/start/ispsh7045.c
+++ b/bsps/sh/gensh2/start/ispsh7045.c
@@ -37,7 +37,7 @@
* by the authors or by TGA Technologies.
*/
-#include <rtems/system.h>
+#include <rtems/score/cpu.h>
/*
* This is a exception vector table
@@ -49,7 +49,7 @@
/* SH-2 ISR Table */
#include <rtems/score/ispsh7045.h>
-proc_ptr _Hardware_isr_Table[256]={
+CPU_ISR_raw_handler _Hardware_isr_Table[256]={
_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, /* PWRon Reset, Maual Reset,...*/
_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
_dummy_isp, _dummy_isp, _dummy_isp,
diff --git a/bsps/sh/gensh4/start/cpu_asm.c b/bsps/sh/gensh4/start/cpu_asm.c
index 7618db3e27..6b530fe8b7 100644
--- a/bsps/sh/gensh4/start/cpu_asm.c
+++ b/bsps/sh/gensh4/start/cpu_asm.c
@@ -39,9 +39,6 @@
#include <rtems/score/sh4_regs.h>
#include <rtems/score/sh_io.h>
-/* from cpu_isps.c */
-extern proc_ptr _Hardware_isr_Table[];
-
unsigned long *_old_stack_ptr;
register unsigned long *stack_ptr __asm__ ("r15");
diff --git a/bsps/sh/shared/start/setvec.c b/bsps/sh/shared/start/setvec.c
index c3f4071aea..5d11e64f72 100644
--- a/bsps/sh/shared/start/setvec.c
+++ b/bsps/sh/shared/start/setvec.c
@@ -48,7 +48,7 @@ sh_isr_entry set_vector( /* returns old vector */
if ( type )
rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
else {
- _CPU_ISR_install_raw_handler( vector, handler, (proc_ptr*) &previous_isr );
+ _CPU_ISR_install_raw_handler( vector, handler, &previous_isr );
}
return previous_isr;
diff --git a/bsps/sh/shsim/start/ispshgdb.c b/bsps/sh/shsim/start/ispshgdb.c
index 09843172d9..f69ea10955 100644
--- a/bsps/sh/shsim/start/ispshgdb.c
+++ b/bsps/sh/shsim/start/ispshgdb.c
@@ -27,7 +27,7 @@
* Modified to reflect dummy isp entries for GDB SH simulator by Joel.
*/
-#include <rtems/system.h>
+#include <rtems/score/cpu.h>
/*
* This is a exception vector table
@@ -37,7 +37,7 @@
void _dummy_isp(uint32_t);
-proc_ptr _Hardware_isr_Table[256]={
+CPU_ISR_raw_handler _Hardware_isr_Table[256]={
_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, /* PWRon Reset, Maual Reset,...*/
_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
diff --git a/cpukit/score/cpu/sh/cpu.c b/cpukit/score/cpu/sh/cpu.c
index b1e8766ff0..9f8be46b93 100644
--- a/cpukit/score/cpu/sh/cpu.c
+++ b/cpukit/score/cpu/sh/cpu.c
@@ -37,11 +37,7 @@
#include <rtems/score/sh.h>
/* referenced in start.S */
-extern proc_ptr vectab[] ;
-
-proc_ptr vectab[256] ;
-
-extern proc_ptr _Hardware_isr_Table[];
+CPU_ISR_raw_handler vectab[256] ;
#if SH_HAS_FPU
Context_Control_fp _CPU_Null_fp_context;
@@ -98,21 +94,18 @@ uint32_t _CPU_ISR_Get_level( void )
return ( _mask);
}
-/*
- * _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
)
+
{
/*
* This is where we install the interrupt handler into the "raw" interrupt
* table used by the CPU to dispatch interrupt handlers.
*/
- volatile proc_ptr *vbr ;
+ volatile CPU_ISR_raw_handler *vbr ;
#if SH_PARANOID_ISR
uint32_t level ;
@@ -131,30 +124,14 @@ void _CPU_ISR_install_raw_handler(
#endif
}
-
-/*
- * _CPU_ISR_install_vector
- *
- * This kernel routine installs the RTEMS handler for the
- * specified vector.
- *
- * Input parameters:
- * vector - interrupt vector number
- * old_handler - former ISR for this vector number
- * new_handler - replacement ISR for this vector number
- *
- * Output parameters: NONE
- *
- */
-
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
)
{
#if defined(__sh1__) || defined(__sh2__)
- proc_ptr ignored ;
+ CPU_ISR_raw_handler ignored ;
#endif
*old_handler = _ISR_Vector_table[ vector ];
diff --git a/cpukit/score/cpu/sh/include/rtems/score/cpu.h b/cpukit/score/cpu/sh/include/rtems/score/cpu.h
index 61d8e56448..0d633b0c68 100644
--- a/cpukit/score/cpu/sh/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sh/include/rtems/score/cpu.h
@@ -546,29 +546,22 @@ void _CPU_Context_Initialize(
*/
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 );
+
+extern CPU_ISR_raw_handler _Hardware_isr_Table[];
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
+ uint32_t vector,
+ CPU_ISR_handler new_handler,
+ CPU_ISR_handler *old_handler
);
void *_CPU_Thread_Idle_body( uintptr_t ignored );
--
2.16.4
More information about the devel
mailing list