[rtems commit] or1k: Send halt signal to or1k simulators when rtems terminates
Joel Sherril
joel at rtems.org
Thu Apr 2 15:02:03 UTC 2015
Module: rtems
Branch: master
Commit: 1c8466165c25970f8336ed3ef11b32009dc238ba
Changeset: http://git.rtems.org/rtems/commit/?id=1c8466165c25970f8336ed3ef11b32009dc238ba
Author: Hesham ALMatary <heshamelmatary at gmail.com>
Date: Thu Apr 2 14:11:26 2015 +0100
or1k: Send halt signal to or1k simulators when rtems terminates
---
cpukit/score/cpu/or1k/rtems/score/cpu.h | 1 +
cpukit/score/cpu/or1k/rtems/score/or1k-utility.h | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/cpukit/score/cpu/or1k/rtems/score/cpu.h b/cpukit/score/cpu/or1k/rtems/score/cpu.h
index 45aeb08..21cbb6d 100644
--- a/cpukit/score/cpu/or1k/rtems/score/cpu.h
+++ b/cpukit/score/cpu/or1k/rtems/score/cpu.h
@@ -702,6 +702,7 @@ void _CPU_Context_Initialize(
#define _CPU_Fatal_halt(_source, _error ) \
printk("Fatal Error %d.%d Halted\n",_source, _error); \
+ _OR1KSIM_CPU_Halt(); \
for(;;)
/* end of Fatal Error manager macros */
diff --git a/cpukit/score/cpu/or1k/rtems/score/or1k-utility.h b/cpukit/score/cpu/or1k/rtems/score/or1k-utility.h
index 6b238b1..c2d1bcb 100644
--- a/cpukit/score/cpu/or1k/rtems/score/or1k-utility.h
+++ b/cpukit/score/cpu/or1k/rtems/score/or1k-utility.h
@@ -362,7 +362,6 @@ static inline void _OR1K_mtspr(uint32_t reg, uint32_t value)
#define _OR1K_CPU_Sleep() \
_OR1K_mtspr(CPU_OR1K_SPR_PMR, CPU_OR1K_SPR_PMR_SME)
-
#define _OR1K_CPU_Suspend() \
_OR1K_mtspr(CPU_OR1K_SPR_PMR, CPU_OR1K_SPR_PMR_SME)
@@ -376,6 +375,16 @@ static inline void _OR1K_Sync_pipeline( void )
asm volatile("l.psync");
}
+/**
+ * @brief or1ksim simulator can be sent a halt signal from RTEMS to tell
+ * the running or1ksim process on the host machine to exit. The following
+ * implementation has no effect on QEMU or hardware implementation and will
+ * be treated as normal l.nop.
+ *
+ */
+#define _OR1KSIM_CPU_Halt() \
+ asm volatile ("l.nop 0xc")
+
#else /* ASM */
#endif /* ASM */
More information about the vc
mailing list