提交 1e7855a5 编写于 作者: M Max Filippov 提交者: Blue Swirl

exec: provide tb_invalidate_phys_addr function

Allow TB invalidation by its physical address, extract implementation
from the breakpoint_invalidate function.
Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 20503968
...@@ -102,6 +102,7 @@ void tlb_flush(CPUArchState *env, int flush_global); ...@@ -102,6 +102,7 @@ void tlb_flush(CPUArchState *env, int flush_global);
void tlb_set_page(CPUArchState *env, target_ulong vaddr, void tlb_set_page(CPUArchState *env, target_ulong vaddr,
target_phys_addr_t paddr, int prot, target_phys_addr_t paddr, int prot,
int mmu_idx, target_ulong size); int mmu_idx, target_ulong size);
void tb_invalidate_phys_addr(target_phys_addr_t addr);
#endif #endif
#define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */ #define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */
......
...@@ -1463,13 +1463,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) ...@@ -1463,13 +1463,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
tb_invalidate_phys_page_range(pc, pc + 1, 0); tb_invalidate_phys_page_range(pc, pc + 1, 0);
} }
#else #else
static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) void tb_invalidate_phys_addr(target_phys_addr_t addr)
{ {
target_phys_addr_t addr;
ram_addr_t ram_addr; ram_addr_t ram_addr;
MemoryRegionSection *section; MemoryRegionSection *section;
addr = cpu_get_phys_page_debug(env, pc);
section = phys_page_find(addr >> TARGET_PAGE_BITS); section = phys_page_find(addr >> TARGET_PAGE_BITS);
if (!(memory_region_is_ram(section->mr) if (!(memory_region_is_ram(section->mr)
|| (section->mr->rom_device && section->mr->readable))) { || (section->mr->rom_device && section->mr->readable))) {
...@@ -1479,6 +1477,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) ...@@ -1479,6 +1477,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
+ section_addr(section, addr); + section_addr(section, addr);
tb_invalidate_phys_page_range(ram_addr, ram_addr + 1, 0); tb_invalidate_phys_page_range(ram_addr, ram_addr + 1, 0);
} }
static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
{
tb_invalidate_phys_addr(cpu_get_phys_page_debug(env, pc));
}
#endif #endif
#endif /* TARGET_HAS_ICE */ #endif /* TARGET_HAS_ICE */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册