summaryrefslogtreecommitdiffstats
path: root/bsps/riscv/riscv/clock/clockdrv.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-19 12:11:19 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-25 10:07:43 +0200
commit8db3f0e878b7f008ad05716f501220509662e2c4 (patch)
treed55db59defa95096a3ef156427822a9f8744ab58 /bsps/riscv/riscv/clock/clockdrv.c
parentriscv: New CPU_Exception_frame (diff)
downloadrtems-8db3f0e878b7f008ad05716f501220509662e2c4.tar.bz2
riscv: Rework exception handling
Remove _CPU_ISR_install_raw_handler() and _CPU_ISR_install_vector() functions. Applications can install an exception handler via the fatal error handler to handle synchronous exceptions. Handle interrupt exceptions via _RISCV_Interrupt_dispatch() which must be provided by the BSP. Update #3433.
Diffstat (limited to 'bsps/riscv/riscv/clock/clockdrv.c')
-rw-r--r--bsps/riscv/riscv/clock/clockdrv.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/bsps/riscv/riscv/clock/clockdrv.c b/bsps/riscv/riscv/clock/clockdrv.c
index d2d7a406a0..52fb441ce1 100644
--- a/bsps/riscv/riscv/clock/clockdrv.c
+++ b/bsps/riscv/riscv/clock/clockdrv.c
@@ -72,11 +72,20 @@ static void riscv_clock_at_tick(void)
#endif
}
-static void riscv_clock_handler_install(proc_ptr new_isr)
+static void riscv_clock_handler_install(void)
{
- _CPU_ISR_install_vector(RISCV_MACHINE_TIMER_INTERRUPT,
- new_isr,
- NULL);
+ rtems_status_code sc;
+
+ sc = rtems_interrupt_handler_install(
+ RISCV_INTERRUPT_VECTOR_TIMER,
+ "Clock",
+ RTEMS_INTERRUPT_UNIQUE,
+ (rtems_interrupt_handler) Clock_isr,
+ NULL
+ );
+ if (sc != RTEMS_SUCCESSFUL) {
+ bsp_fatal(RISCV_FATAL_CLOCK_IRQ_INSTALL);
+ }
}
static uint32_t riscv_clock_get_timecount(struct timecounter *tc)
@@ -136,6 +145,6 @@ uint32_t _CPU_Counter_frequency( void )
#define Clock_driver_support_initialize_hardware() riscv_clock_initialize()
#define Clock_driver_support_install_isr(isr) \
- riscv_clock_handler_install(isr)
+ riscv_clock_handler_install()
#include "../../../shared/dev/clock/clockimpl.h"