提交 8f3e03cb 编写于 作者: P Paolo Bonzini

cputlb: simplify tlb_set_page

The same "if" condition is repeated twice.
Reviewed-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 ae4e43e8
......@@ -262,17 +262,14 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr,
#endif
address = vaddr;
if (!(memory_region_is_ram(section->mr) ||
memory_region_is_romd(section->mr))) {
/* IO memory case (romd handled later) */
if (!memory_region_is_ram(section->mr) && !memory_region_is_romd(section->mr)) {
/* IO memory case */
address |= TLB_MMIO;
}
if (memory_region_is_ram(section->mr) ||
memory_region_is_romd(section->mr)) {
addend = 0;
} else {
/* TLB_MMIO for rom/romd handled below */
addend = (uintptr_t)memory_region_get_ram_ptr(section->mr)
+ memory_region_section_addr(section, paddr);
} else {
addend = 0;
}
code_address = address;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册