mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 03:13:44 +08:00
sparc/ldst_helper: make range overlap check more readable
use ranges_overlap() instead of open-coding the overlap check to improve the readability of the code. Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240722040742.11513-9-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
7b3e371526
commit
2a48b590f7
@ -19,6 +19,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/range.h"
|
||||
#include "cpu.h"
|
||||
#include "tcg/tcg.h"
|
||||
#include "exec/helper-proto.h"
|
||||
@ -240,9 +241,7 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb,
|
||||
if (new_ctx == ctx) {
|
||||
uint64_t vaddr = tlb[i].tag & ~0x1fffULL;
|
||||
uint64_t size = 8192ULL << 3 * TTE_PGSIZE(tlb[i].tte);
|
||||
if (new_vaddr == vaddr
|
||||
|| (new_vaddr < vaddr + size
|
||||
&& vaddr < new_vaddr + new_size)) {
|
||||
if (ranges_overlap(new_vaddr, new_size, vaddr, size)) {
|
||||
DPRINTF_MMU("auto demap entry [%d] %lx->%lx\n", i, vaddr,
|
||||
new_vaddr);
|
||||
replace_tlb_entry(&tlb[i], tlb_tag, tlb_tte, env1);
|
||||
|
Loading…
Reference in New Issue
Block a user