Revision 4d7a0880 exec-all.h
b/exec-all.h | ||
---|---|---|
93 | 93 |
int tlb_set_page_exec(CPUState *env, target_ulong vaddr, |
94 | 94 |
target_phys_addr_t paddr, int prot, |
95 | 95 |
int mmu_idx, int is_softmmu); |
96 |
static inline int tlb_set_page(CPUState *env, target_ulong vaddr, |
|
96 |
static inline int tlb_set_page(CPUState *env1, target_ulong vaddr,
|
|
97 | 97 |
target_phys_addr_t paddr, int prot, |
98 | 98 |
int mmu_idx, int is_softmmu) |
99 | 99 |
{ |
100 | 100 |
if (prot & PAGE_READ) |
101 | 101 |
prot |= PAGE_EXEC; |
102 |
return tlb_set_page_exec(env, vaddr, paddr, prot, mmu_idx, is_softmmu); |
|
102 |
return tlb_set_page_exec(env1, vaddr, paddr, prot, mmu_idx, is_softmmu);
|
|
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
#define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */ |
... | ... | |
550 | 550 |
#endif |
551 | 551 |
|
552 | 552 |
#if defined(CONFIG_USER_ONLY) |
553 |
static inline target_ulong get_phys_addr_code(CPUState *env, target_ulong addr) |
|
553 |
static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr)
|
|
554 | 554 |
{ |
555 | 555 |
return addr; |
556 | 556 |
} |
... | ... | |
558 | 558 |
/* NOTE: this function can trigger an exception */ |
559 | 559 |
/* NOTE2: the returned address is not exactly the physical address: it |
560 | 560 |
is the offset relative to phys_ram_base */ |
561 |
static inline target_ulong get_phys_addr_code(CPUState *env, target_ulong addr) |
|
561 |
static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr)
|
|
562 | 562 |
{ |
563 |
int mmu_idx, index, pd; |
|
563 |
int mmu_idx, page_index, pd;
|
|
564 | 564 |
|
565 |
index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); |
|
566 |
mmu_idx = cpu_mmu_index(env); |
|
567 |
if (__builtin_expect(env->tlb_table[mmu_idx][index].addr_code !=
|
|
565 |
page_index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
|
|
566 |
mmu_idx = cpu_mmu_index(env1);
|
|
567 |
if (__builtin_expect(env1->tlb_table[mmu_idx][page_index].addr_code !=
|
|
568 | 568 |
(addr & TARGET_PAGE_MASK), 0)) { |
569 | 569 |
ldub_code(addr); |
570 | 570 |
} |
571 |
pd = env->tlb_table[mmu_idx][index].addr_code & ~TARGET_PAGE_MASK;
|
|
571 |
pd = env1->tlb_table[mmu_idx][page_index].addr_code & ~TARGET_PAGE_MASK;
|
|
572 | 572 |
if (pd > IO_MEM_ROM && !(pd & IO_MEM_ROMD)) { |
573 | 573 |
#if defined(TARGET_SPARC) || defined(TARGET_MIPS) |
574 | 574 |
do_unassigned_access(addr, 0, 1, 0); |
575 | 575 |
#else |
576 |
cpu_abort(env, "Trying to execute code outside RAM or ROM at 0x" TARGET_FMT_lx "\n", addr); |
|
576 |
cpu_abort(env1, "Trying to execute code outside RAM or ROM at 0x" TARGET_FMT_lx "\n", addr);
|
|
577 | 577 |
#endif |
578 | 578 |
} |
579 |
return addr + env->tlb_table[mmu_idx][index].addend - (unsigned long)phys_ram_base;
|
|
579 |
return addr + env1->tlb_table[mmu_idx][page_index].addend - (unsigned long)phys_ram_base;
|
|
580 | 580 |
} |
581 | 581 |
#endif |
582 | 582 |
|
Also available in: Unified diff