simplify interfaces to DTLB/ITLB

This commit is contained in:
Stanislav Shwartsman 2019-12-09 18:46:36 +00:00
parent 4b66fecaad
commit 6c8db0f569
3 changed files with 6 additions and 6 deletions

View File

@ -1483,11 +1483,11 @@ void bx_dbg_tlb_lookup(bx_lin_address laddr)
{
char cpu_param_name[16];
index = BX_ITLB_INDEX_OF(laddr, 0);
Bit32u index = BX_ITLB_INDEX_OF(laddr);
sprintf(cpu_param_name, "ITLB.entry%d", index);
bx_dbg_show_param_command(cpu_param_name, 0);
Bit32u index = BX_DTLB_INDEX_OF(laddr, 0);
index = BX_DTLB_INDEX_OF(laddr, 0);
sprintf(cpu_param_name, "DTLB.entry%d", index);
bx_dbg_show_param_command(cpu_param_name, 0);
}

View File

@ -590,7 +590,7 @@ void BX_CPU_C::prefetch(void)
BX_CPU_THIS_PTR clear_RF();
bx_address lpf = LPFOf(laddr);
bx_TLB_entry *tlbEntry = BX_ITLB_ENTRY_OF(laddr, 0);
bx_TLB_entry *tlbEntry = BX_ITLB_ENTRY_OF(laddr);
Bit8u *fetchPtr = 0;
if ((tlbEntry->lpf == lpf) && (tlbEntry->accessBits & (1<<USER_PL)) != 0) {

View File

@ -58,8 +58,8 @@ BX_CPP_INLINE bx_address AlignedAccessLPFOf(bx_address laddr, unsigned alignment
#define BX_DTLB_ENTRY_OF(lpf, len) (BX_CPU_THIS_PTR DTLB.get_entry_of((lpf), (len)))
#define BX_DTLB_INDEX_OF(lpf, len) (BX_CPU_THIS_PTR DTLB.get_index_of((lpf), (len)))
#define BX_ITLB_ENTRY_OF(lpf, len) (BX_CPU_THIS_PTR ITLB.get_entry_of((lpf), (len)))
#define BX_ITLB_INDEX_OF(lpf, len) (BX_CPU_THIS_PTR ITLB.get_index_of((lpf), (len)))
#define BX_ITLB_ENTRY_OF(lpf) (BX_CPU_THIS_PTR ITLB.get_entry_of(lpf))
#define BX_ITLB_INDEX_OF(lpf) (BX_CPU_THIS_PTR ITLB.get_index_of(lpf))
typedef bx_ptr_equiv_t bx_hostpageaddr_t;
@ -134,7 +134,7 @@ struct bx_TLB_entry
#endif
Bit32u lpf_mask; // linear address mask of the page size
#if BX_SUPPORT_MEMTYPE
Bit32u memtype; // keep it Bit32u for alignment
Bit32u memtype; // keep it Bit32u for alignment
#endif
bx_TLB_entry() { invalidate(); }