Skip to content

Commit

Permalink
exec: provide tb_invalidate_phys_addr function
Browse files Browse the repository at this point in the history
Allow TB invalidation by its physical address, extract implementation
from the breakpoint_invalidate function.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
jcmvbkbc authored and blueswirl committed Apr 14, 2012
1 parent 2050396 commit 1e7855a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions exec-all.h
Expand Up @@ -102,6 +102,7 @@ void tlb_flush(CPUArchState *env, int flush_global);
void tlb_set_page(CPUArchState *env, target_ulong vaddr,
target_phys_addr_t paddr, int prot,
int mmu_idx, target_ulong size);
void tb_invalidate_phys_addr(target_phys_addr_t addr);
#endif

#define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */
Expand Down
9 changes: 6 additions & 3 deletions exec.c
Expand Up @@ -1463,13 +1463,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
tb_invalidate_phys_page_range(pc, pc + 1, 0);
}
#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;
MemoryRegionSection *section;

addr = cpu_get_phys_page_debug(env, pc);
section = phys_page_find(addr >> TARGET_PAGE_BITS);
if (!(memory_region_is_ram(section->mr)
|| (section->mr->rom_device && section->mr->readable))) {
Expand All @@ -1479,6 +1477,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
+ section_addr(section, addr);
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 /* TARGET_HAS_ICE */

Expand Down

0 comments on commit 1e7855a

Please sign in to comment.