aboutsummaryrefslogtreecommitdiff
path: root/target/mips/cp0_helper.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-11-09 09:15:41 +0100
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-12-13 19:58:54 +0100
commit547b9b17f9cbe7bc16db73f4aaceeead54c03f29 (patch)
treed2dac7034aab55508b60a855591216e5204dd923 /target/mips/cp0_helper.c
parent34cffe960e494ae6dc79efeb87fc3e79fe7de90c (diff)
downloadqemu-547b9b17f9cbe7bc16db73f4aaceeead54c03f29.zip
qemu-547b9b17f9cbe7bc16db73f4aaceeead54c03f29.tar.gz
qemu-547b9b17f9cbe7bc16db73f4aaceeead54c03f29.tar.bz2
target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN
Replace magic values related to page size: 12 -> TARGET_PAGE_BITS_MIN 13 -> CP0PM_MASK Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Huacai Chen <chenhc@lemote.com> Message-Id: <20201109090422.2445166-2-f4bug@amsat.org>
Diffstat (limited to 'target/mips/cp0_helper.c')
-rw-r--r--target/mips/cp0_helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c
index a1b5140..e8b9343 100644
--- a/target/mips/cp0_helper.c
+++ b/target/mips/cp0_helper.c
@@ -904,7 +904,7 @@ void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagemask)
goto invalid;
}
/* We don't support VTLB entry smaller than target page */
- if ((maskbits + 12) < TARGET_PAGE_BITS) {
+ if ((maskbits + TARGET_PAGE_BITS_MIN) < TARGET_PAGE_BITS) {
goto invalid;
}
env->CP0_PageMask = mask << CP0PM_MASK;
@@ -913,7 +913,8 @@ void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagemask)
invalid:
/* When invalid, set to default target page size. */
- env->CP0_PageMask = (~TARGET_PAGE_MASK >> 12) << CP0PM_MASK;
+ mask = (~TARGET_PAGE_MASK >> TARGET_PAGE_BITS_MIN);
+ env->CP0_PageMask = mask << CP0PM_MASK;
}
void helper_mtc0_pagemask(CPUMIPSState *env, target_ulong arg1)