[PATCH 14/19] or1k: Remove use of proc_ptr
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Nov 9 12:49:06 UTC 2018
Update #3585.
---
bsps/or1k/generic_or1k/clock/clockdrv.c | 5 +--
cpukit/score/cpu/or1k/cpu.c | 22 +++++--------
cpukit/score/cpu/or1k/include/rtems/score/cpu.h | 41 ++++++++++---------------
3 files changed, 25 insertions(+), 43 deletions(-)
diff --git a/bsps/or1k/generic_or1k/clock/clockdrv.c b/bsps/or1k/generic_or1k/clock/clockdrv.c
index e2a8e4db17..44365aa02c 100644
--- a/bsps/or1k/generic_or1k/clock/clockdrv.c
+++ b/bsps/or1k/generic_or1k/clock/clockdrv.c
@@ -33,9 +33,6 @@ static struct timecounter or1ksim_tc;
/* CPU counter */
static CPU_Counter_ticks cpu_counter_ticks;
-/* This prototype is added here to Avoid warnings */
-void Clock_isr(void *arg);
-
static void generic_or1k_clock_at_tick(void)
{
uint32_t TTMR;
@@ -56,7 +53,7 @@ static void generic_or1k_clock_at_tick(void)
cpu_counter_ticks += TTMR_NUM_OF_CLOCK_TICKS_INTERRUPT;
}
-static void generic_or1k_clock_handler_install(proc_ptr new_isr)
+static void generic_or1k_clock_handler_install(CPU_ISR_handler new_isr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
_CPU_ISR_install_vector(OR1K_EXCEPTION_TICK_TIMER,
diff --git a/cpukit/score/cpu/or1k/cpu.c b/cpukit/score/cpu/or1k/cpu.c
index b4cbe00f9b..75abb2f3f0 100644
--- a/cpukit/score/cpu/or1k/cpu.c
+++ b/cpukit/score/cpu/or1k/cpu.c
@@ -69,22 +69,14 @@ 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
)
{
-}
-
-void _CPU_ISR_install_vector(
- uint32_t vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- proc_ptr *table =
- (proc_ptr *) bsp_start_vector_table_begin;
- proc_ptr current_handler;
+ CPU_ISR_raw_handler *table =
+ (CPU_ISR_raw_handler *) bsp_start_vector_table_begin;
+ CPU_ISR_raw_handler current_handler;
ISR_Level level;
@@ -94,7 +86,7 @@ void _CPU_ISR_install_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 */
diff --git a/cpukit/score/cpu/or1k/include/rtems/score/cpu.h b/cpukit/score/cpu/or1k/include/rtems/score/cpu.h
index 8d66ccf522..0d1566a0c9 100644
--- a/cpukit/score/cpu/or1k/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/or1k/include/rtems/score/cpu.h
@@ -590,35 +590,28 @@ 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 )( uint32_t, CPU_Exception_frame * );
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.
- *
- * NO_CPU Specific Information:
- *
- * XXX document implementation including references if appropriate
- */
+typedef void ( *CPU_ISR_handler )( uint32_t );
-void _CPU_ISR_install_vector(
- uint32_t vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
+RTEMS_INLINE_ROUTINE void _CPU_ISR_install_vector(
+ uint32_t vector,
+ CPU_ISR_handler new_handler,
+ CPU_ISR_handler *old_handler
+)
+{
+ _CPU_ISR_install_raw_handler(
+ vector,
+ (CPU_ISR_raw_handler) new_handler,
+ (CPU_ISR_raw_handler *) old_handler
+ );
+}
void *_CPU_Thread_Idle_body( uintptr_t ignored );
--
2.16.4
More information about the devel
mailing list