X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=cputlb.c;h=aba7e44e1e424fa618272e39b4607d92c5d56839;hb=9e1c2ec8fd8d9a9ee299ea86c5f6c986fe25e838;hp=0627f32e3573cf5bc7daf71bd30c7c0353039c33;hpb=7762c2c1e02e44fdc473cbe75105faba08b906cc;p=qemu.git diff --git a/cputlb.c b/cputlb.c index 0627f32e3..aba7e44e1 100644 --- a/cputlb.c +++ b/cputlb.c @@ -19,12 +19,13 @@ #include "config.h" #include "cpu.h" -#include "exec-all.h" -#include "memory.h" +#include "exec/exec-all.h" +#include "exec/memory.h" +#include "exec/address-spaces.h" -#include "cputlb.h" +#include "exec/cputlb.h" -#include "memory-internal.h" +#include "exec/memory-internal.h" //#define DEBUG_TLB //#define DEBUG_TLB_CHECK @@ -53,6 +54,7 @@ static const CPUTLBEntry s_cputlb_empty_entry = { */ void tlb_flush(CPUArchState *env, int flush_global) { + CPUState *cpu = ENV_GET_CPU(env); int i; #if defined(DEBUG_TLB) @@ -60,7 +62,7 @@ void tlb_flush(CPUArchState *env, int flush_global) #endif /* must reset current TB so that interrupts cannot modify the links while we are modifying them */ - env->current_tb = NULL; + cpu->current_tb = NULL; for (i = 0; i < CPU_TLB_SIZE; i++) { int mmu_idx; @@ -91,6 +93,7 @@ static inline void tlb_flush_entry(CPUTLBEntry *tlb_entry, target_ulong addr) void tlb_flush_page(CPUArchState *env, target_ulong addr) { + CPUState *cpu = ENV_GET_CPU(env); int i; int mmu_idx; @@ -109,7 +112,7 @@ void tlb_flush_page(CPUArchState *env, target_ulong addr) } /* must reset current TB so that interrupts cannot modify the links while we are modifying them */ - env->current_tb = NULL; + cpu->current_tb = NULL; addr &= TARGET_PAGE_MASK; i = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); @@ -236,7 +239,7 @@ static void tlb_add_large_page(CPUArchState *env, target_ulong vaddr, is permitted. Only a single TARGET_PAGE_SIZE region is mapped, the supplied size is only used by tlb_flush_page. */ void tlb_set_page(CPUArchState *env, target_ulong vaddr, - target_phys_addr_t paddr, int prot, + hwaddr paddr, int prot, int mmu_idx, target_ulong size) { MemoryRegionSection *section; @@ -245,13 +248,13 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr, target_ulong code_address; uintptr_t addend; CPUTLBEntry *te; - target_phys_addr_t iotlb; + hwaddr iotlb; assert(size >= TARGET_PAGE_SIZE); if (size != TARGET_PAGE_SIZE) { tlb_add_large_page(env, vaddr, size); } - section = phys_page_find(paddr >> TARGET_PAGE_BITS); + section = phys_page_find(address_space_memory.dispatch, paddr >> TARGET_PAGE_BITS); #if defined(DEBUG_TLB) printf("tlb_set_page: vaddr=" TARGET_FMT_lx " paddr=0x" TARGET_FMT_plx " prot=%x idx=%d pd=0x%08lx\n", @@ -346,15 +349,15 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr) #define SOFTMMU_CODE_ACCESS #define SHIFT 0 -#include "softmmu_template.h" +#include "exec/softmmu_template.h" #define SHIFT 1 -#include "softmmu_template.h" +#include "exec/softmmu_template.h" #define SHIFT 2 -#include "softmmu_template.h" +#include "exec/softmmu_template.h" #define SHIFT 3 -#include "softmmu_template.h" +#include "exec/softmmu_template.h" #undef env