[PATCH] [rtems-tools] Add QEMU patch for openrisc to recognize halt signals

Hesham ALMatary heshamelmatary at gmail.com
Thu Apr 2 16:30:45 UTC 2015


---
 ...rminate-qemu-process-upon-receiving-a-hal.patch | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 tools/qemu/0001-openrisc-terminate-qemu-process-upon-receiving-a-hal.patch

diff --git a/tools/qemu/0001-openrisc-terminate-qemu-process-upon-receiving-a-hal.patch b/tools/qemu/0001-openrisc-terminate-qemu-process-upon-receiving-a-hal.patch
new file mode 100644
index 0000000..8d8f0cd
--- /dev/null
+++ b/tools/qemu/0001-openrisc-terminate-qemu-process-upon-receiving-a-hal.patch
@@ -0,0 +1,33 @@
+From e4f207ced08631ae991776b227879754289d2a0c Mon Sep 17 00:00:00 2001
+From: Hesham ALMatary <heshamelmatary at gmail.com>
+Date: Thu, 2 Apr 2015 17:08:09 +0100
+Subject: [PATCH] openrisc: terminate qemu process upon receiving a halt
+ signal.
+
+or1ksim simulator currently handles "l.nop 0xC" instruction as a halt signal. Do
+the same for QEMU.
+
+Signed-off-by: Hesham ALMatary  <heshamelmatary at gmail.com>
+---
+ target-openrisc/translate.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c
+index dc76789..b024f11 100644
+--- a/target-openrisc/translate.c
++++ b/target-openrisc/translate.c
+@@ -750,6 +750,11 @@ static void dec_misc(DisasContext *dc, uint32_t insn)
+         switch (op1) {
+         case 0x01:    /* l.nop */
+             LOG_DIS("l.nop %d\n", I16);
++
++						if(I16 == 0xC) {
++                exit(0);
++            }
++
+             break;
+ 
+         default:
+-- 
+2.1.0
+
-- 
2.1.0



More information about the devel mailing list