aboutsummaryrefslogtreecommitdiff
path: root/target-sh4
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-03-18 18:41:57 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-03-18 18:41:57 +0000
commit43dc2a645e00e6761a741e3d16c27c5b5a373b66 (patch)
treedaf9f3fd9fa34306ac03fbb6efc72860efc879ca /target-sh4
parent609c1daced7f444f9f6569bba72d6a56a697ac95 (diff)
Replace assert(0) with abort() or cpu_abort()
When building with -DNDEBUG, assert(0) will not stop execution so it must not be used for abnormal termination. Use cpu_abort() when in CPU context, abort() otherwise. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sh4')
-rw-r--r--target-sh4/README.sh42
-rw-r--r--target-sh4/helper.c6
-rw-r--r--target-sh4/op_helper.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/target-sh4/README.sh4 b/target-sh4/README.sh4
index a92b6f38c4..e578830f79 100644
--- a/target-sh4/README.sh4
+++ b/target-sh4/README.sh4
@@ -6,7 +6,7 @@ The sh4 target is not ready at all yet for integration in qemu. This
file describes the current state of implementation.
Most places requiring attention and/or modification can be detected by
-looking for "XXXXX" or "assert (0)".
+looking for "XXXXX" or "abort()".
The sh4 core is located in target-sh4/*, while the 7750 peripheral
features (IO ports for example) are located in hw/sh7750.[ch]. The
diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index 6c3f896a2d..9e70352311 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -235,7 +235,7 @@ static int itlb_replacement(CPUState * env)
return 2;
if ((env->mmucr & 0x2c000000) == 0x00000000)
return 3;
- assert(0);
+ cpu_abort(env, "Unhandled itlb_replacement");
}
/* Find the corresponding entry in the right TLB
@@ -462,7 +462,7 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
env->exception_index = 0x100;
break;
default:
- assert(0);
+ cpu_abort(env, "Unhandled MMU fault");
}
return 1;
}
@@ -514,7 +514,7 @@ void cpu_load_tlb(CPUSH4State * env)
entry->size = 1024 * 1024; /* 1M */
break;
default:
- assert(0);
+ cpu_abort(env, "Unhandled load_tlb");
break;
}
entry->sh = (uint8_t)cpu_ptel_sh(env->ptel);
diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c
index 529df0ca9e..2e5f5552a2 100644
--- a/target-sh4/op_helper.c
+++ b/target-sh4/op_helper.c
@@ -71,7 +71,7 @@ void helper_ldtlb(void)
{
#ifdef CONFIG_USER_ONLY
/* XXXXX */
- assert(0);
+ cpu_abort(env, "Unhandled ldtlb");
#else
cpu_load_tlb(env);
#endif