[PATCH 7/9] bsp/tms570: Add TMS570_FATAL_RTI_IRQ_INSTALL

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Apr 23 19:15:53 UTC 2024


Update #4982.
---
 bsps/arm/tms570/clock/clock.c | 15 ++++-----------
 bsps/include/bsp/fatal.h      |  3 +++
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/bsps/arm/tms570/clock/clock.c b/bsps/arm/tms570/clock/clock.c
index cf14d5772f..2fb884b3ce 100644
--- a/bsps/arm/tms570/clock/clock.c
+++ b/bsps/arm/tms570/clock/clock.c
@@ -41,6 +41,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/fatal.h>
 #include <bsp/irq.h>
 #include <bsp/tms570.h>
 #include <rtems/timecounter.h>
@@ -117,19 +118,11 @@ static void tms570_clock_driver_support_at_tick(volatile tms570_rti_t *rti)
   rti->INTFLAG = TMS570_RTI_INTFLAG_INT0;
 }
 
-/**
- * @brief registers RTI interrupt handler
- *
- * @param[in] Clock_isr new ISR handler
- * @param[in] Old_ticker old ISR handler (unused and type broken)
- *
- * @retval Void
- */
 static void tms570_clock_driver_support_install_isr(
   rtems_interrupt_handler handler
 )
 {
-  rtems_status_code sc = RTEMS_SUCCESSFUL;
+  rtems_status_code sc;
 
   sc = rtems_interrupt_handler_install(
     TMS570_IRQ_TIMER_0,
@@ -138,8 +131,8 @@ static void tms570_clock_driver_support_install_isr(
     handler,
     RTEMS_DEVOLATILE(tms570_rti_t *, &TMS570_RTI)
   );
-  if ( sc != RTEMS_SUCCESSFUL ) {
-    rtems_fatal_error_occurred(0xdeadbeef);
+  if (sc != RTEMS_SUCCESSFUL) {
+    bsp_fatal(TMS570_FATAL_RTI_IRQ_INSTALL);
   }
 }
 
diff --git a/bsps/include/bsp/fatal.h b/bsps/include/bsp/fatal.h
index 87fc481ead..b41ef2d5c2 100644
--- a/bsps/include/bsp/fatal.h
+++ b/bsps/include/bsp/fatal.h
@@ -217,6 +217,9 @@ typedef enum {
 
   /* Xilinx fatal codes */
   XIL_FATAL_TTC_IRQ_INSTALL = BSP_FATAL_CODE_BLOCK(17),
+
+  /* TMS570 fatal codes */
+  TMS570_FATAL_RTI_IRQ_INSTALL = BSP_FATAL_CODE_BLOCK(18),
 } bsp_fatal_code;
 
 RTEMS_NO_RETURN static inline void
-- 
2.35.3



More information about the devel mailing list