[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 08/12] target/mips: Update ITU to handle bus error
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PULL v2 08/12] target/mips: Update ITU to handle bus errors |
Date: |
Fri, 18 Jan 2019 17:59:41 +0100 |
From: Yongbok Kim <address@hidden>
Update ITU to handle bus errors.
Reviewed-by: Stefan Markovic <address@hidden>
Signed-off-by: Yongbok Kim <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
---
hw/misc/mips_itu.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c
index ee1addc..1257d8f 100644
--- a/hw/misc/mips_itu.c
+++ b/hw/misc/mips_itu.c
@@ -375,6 +375,12 @@ static void view_pv_try_write(ITCStorageCell *c)
view_pv_common_write(c);
}
+static void raise_exception(int excp)
+{
+ current_cpu->exception_index = excp;
+ cpu_loop_exit(current_cpu);
+}
+
static uint64_t itc_storage_read(void *opaque, hwaddr addr, unsigned size)
{
MIPSITUState *s = (MIPSITUState *)opaque;
@@ -382,6 +388,14 @@ static uint64_t itc_storage_read(void *opaque, hwaddr
addr, unsigned size)
ITCView view = get_itc_view(addr);
uint64_t ret = -1;
+ switch (size) {
+ case 1:
+ case 2:
+ s->icr0 |= 1 << ITC_ICR0_ERR_AXI;
+ raise_exception(EXCP_DBE);
+ return 0;
+ }
+
switch (view) {
case ITCVIEW_BYPASS:
ret = view_bypass_read(cell);
@@ -420,6 +434,14 @@ static void itc_storage_write(void *opaque, hwaddr addr,
uint64_t data,
ITCStorageCell *cell = get_cell(s, addr);
ITCView view = get_itc_view(addr);
+ switch (size) {
+ case 1:
+ case 2:
+ s->icr0 |= 1 << ITC_ICR0_ERR_AXI;
+ raise_exception(EXCP_DBE);
+ return;
+ }
+
switch (view) {
case ITCVIEW_BYPASS:
view_bypass_write(cell, data);
--
2.7.4
- [Qemu-devel] [PULL v2 00/12] MIPS queue for January 17, 2019 - v2, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 04/12] target/mips: Add fields for SAARI and SAAR CP0 registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 01/12] target/mips: Move comment containing summary of CP0 registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 12/12] target/mips: Introduce 32 R5900 multimedia registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 06/12] target/mips: Add field and R/W access to ITU control register ICR0, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 10/12] target/mips: Add CP0 register MemoryMapID, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 08/12] target/mips: Update ITU to handle bus errors,
Aleksandar Markovic <=
- [Qemu-devel] [PULL v2 02/12] target/mips: Add preprocessor constants for 32 major CP0 registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 07/12] target/mips: Update ITU to utilize SAARI and SAAR CP0 registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 05/12] target/mips: Provide R/W access to SAARI and SAAR CP0 registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 09/12] target/mips: Amend preprocessor constants for CP0 registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 03/12] target/mips: Use preprocessor constants for 32 major CP0 registers, Aleksandar Markovic, 2019/01/18
- [Qemu-devel] [PULL v2 11/12] target/mips: Rename 'rn' to 'register_name', Aleksandar Markovic, 2019/01/18
- Re: [Qemu-devel] [PULL v2 00/12] MIPS queue for January 17, 2019 - v2, Peter Maydell, 2019/01/21