diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-07-07 21:40:52 +0100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-07-15 08:02:32 +0100 |
commit | bef6f008b9811d961fd311c102f1a22dc28278a1 (patch) | |
tree | 4ad2dbec9cb5b560a8dfaf400f0bbf191aca7344 /target | |
parent | 91e9e116fea2a3b957e86daf55c832155fdf4b04 (diff) | |
download | qemu-bef6f008b9811d961fd311c102f1a22dc28278a1.zip qemu-bef6f008b9811d961fd311c102f1a22dc28278a1.tar.gz qemu-bef6f008b9811d961fd311c102f1a22dc28278a1.tar.bz2 |
accel/tcg: Return bool from page_check_range
Replace the 0/-1 result with true/false.
Invert the sense of the test of all callers.
Document the function.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230707204054.8792-25-richard.henderson@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/hppa/op_helper.c | 2 | ||||
-rw-r--r-- | target/riscv/vector_helper.c | 2 | ||||
-rw-r--r-- | target/sparc/ldst_helper.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 32c27c6..f25a5a7 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -168,7 +168,7 @@ target_ureg HELPER(probe)(CPUHPPAState *env, target_ulong addr, uint32_t level, uint32_t want) { #ifdef CONFIG_USER_ONLY - return (page_check_range(addr, 1, want) == 0) ? 1 : 0; + return page_check_range(addr, 1, want); #else int prot, excp; hwaddr phys; diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 71bb9b4..cfacf2e 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -583,7 +583,7 @@ vext_ldff(void *vd, void *v0, target_ulong base, cpu_mmu_index(env, false)); if (host) { #ifdef CONFIG_USER_ONLY - if (page_check_range(addr, offset, PAGE_READ) < 0) { + if (page_check_range(addr, offset, PAGE_READ)) { vl = i; goto ProbeSuccess; } diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index 981a47d..78b0330 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -1191,7 +1191,7 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr, case ASI_PNFL: /* Primary no-fault LE */ case ASI_SNF: /* Secondary no-fault */ case ASI_SNFL: /* Secondary no-fault LE */ - if (page_check_range(addr, size, PAGE_READ) == -1) { + if (!page_check_range(addr, size, PAGE_READ)) { ret = 0; break; } |