Support building on Android arm aarch64 x86 x86_64
1. Add cmake support in CMakeLists.txt according to https://developer.android.com/ndk/guides/other_build_systems
2. Resolve symbols errors
3. Backport fixes from 438ed42311
> QEMU relies on two optimization for ppc64 and arm:
>
> 1. if(0) /* optimized code */
> 2. assert(0); /* optimized code */
>
> But the assert on mingw32 doesn't have noreturn attribute which prevents
> the second optimization and some code is reverted to the original code
> to fit in the first optimization.
>
> The assert implementation is copied from glib as qemu did.
Unfortunately, NDK also doesn't have an assert implementation qemu prefers.
This commit is contained in:
@@ -143,8 +143,8 @@ static void cp_reg_check_reset(gpointer key, gpointer value, gpointer opaque)
|
||||
cp_reg_reset(key, value, opaque);
|
||||
#ifndef NDEBUG
|
||||
newvalue = read_raw_cp_reg(&cpu->env, ri);
|
||||
#endif
|
||||
assert(oldvalue == newvalue);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void arm_cpu_reset(CPUState *dev)
|
||||
@@ -919,7 +919,9 @@ void arm_cpu_realizefn(struct uc_struct *uc, CPUState *dev)
|
||||
* Presence of EL2 itself is ARM_FEATURE_EL2, and of the
|
||||
* Security Extensions is ARM_FEATURE_EL3.
|
||||
*/
|
||||
#ifndef NDEBUG
|
||||
assert(no_aa32 || cpu_isar_feature(aa32_arm_div, cpu));
|
||||
#endif
|
||||
set_feature(env, ARM_FEATURE_LPAE);
|
||||
set_feature(env, ARM_FEATURE_V7);
|
||||
}
|
||||
@@ -945,7 +947,9 @@ void arm_cpu_realizefn(struct uc_struct *uc, CPUState *dev)
|
||||
if (arm_feature(env, ARM_FEATURE_V6)) {
|
||||
set_feature(env, ARM_FEATURE_V5);
|
||||
if (!arm_feature(env, ARM_FEATURE_M)) {
|
||||
#ifndef NDEBUG
|
||||
assert(no_aa32 || cpu_isar_feature(aa32_jazelle, cpu));
|
||||
#endif
|
||||
set_feature(env, ARM_FEATURE_AUXCR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6027,12 +6027,11 @@ static void define_debug_regs(ARMCPU *cpu)
|
||||
wrps = arm_num_wrps(cpu);
|
||||
#ifndef NDEBUG
|
||||
ctx_cmps = arm_num_ctx_cmps(cpu);
|
||||
assert(ctx_cmps <= brps);
|
||||
#else
|
||||
arm_num_ctx_cmps(cpu);
|
||||
#endif
|
||||
|
||||
assert(ctx_cmps <= brps);
|
||||
|
||||
define_one_arm_cp_reg(cpu, &dbgdidr);
|
||||
define_arm_cp_regs(cpu, debug_cp_reginfo);
|
||||
|
||||
|
||||
@@ -1172,7 +1172,9 @@ void ppc_hash64_init(PowerPCCPU *cpu)
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
||||
|
||||
if (!pcc->hash64_opts) {
|
||||
#ifndef NDEBUG
|
||||
assert(!(env->mmu_model & POWERPC_MMU_64));
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user