PowerPC: Rename tlb_entry struct to TLBEntry

Makes it consistent with our naming style.
This commit is contained in:
Lioncash 2017-02-04 18:58:43 -05:00
parent 529dc6aa53
commit 52b45a3933
2 changed files with 7 additions and 8 deletions

View File

@ -972,7 +972,7 @@ enum TLBLookupResult
static TLBLookupResult LookupTLBPageAddress(const XCheckTLBFlag flag, const u32 vpa, u32* paddr) static TLBLookupResult LookupTLBPageAddress(const XCheckTLBFlag flag, const u32 vpa, u32* paddr)
{ {
u32 tag = vpa >> HW_PAGE_INDEX_SHIFT; u32 tag = vpa >> HW_PAGE_INDEX_SHIFT;
PowerPC::tlb_entry* tlbe = &PowerPC::ppcState.tlb[IsOpcodeFlag(flag)][tag & HW_PAGE_INDEX_MASK]; TLBEntry* tlbe = &ppcState.tlb[IsOpcodeFlag(flag)][tag & HW_PAGE_INDEX_MASK];
if (tlbe->tag[0] == tag) if (tlbe->tag[0] == tag)
{ {
// Check if C bit requires updating // Check if C bit requires updating
@ -1026,7 +1026,7 @@ static void UpdateTLBEntry(const XCheckTLBFlag flag, UPTE2 PTE2, const u32 addre
return; return;
int tag = address >> HW_PAGE_INDEX_SHIFT; int tag = address >> HW_PAGE_INDEX_SHIFT;
PowerPC::tlb_entry* tlbe = &PowerPC::ppcState.tlb[IsOpcodeFlag(flag)][tag & HW_PAGE_INDEX_MASK]; TLBEntry* tlbe = &ppcState.tlb[IsOpcodeFlag(flag)][tag & HW_PAGE_INDEX_MASK];
int index = tlbe->recent == 0 && tlbe->tag[0] != TLB_TAG_INVALID; int index = tlbe->recent == 0 && tlbe->tag[0] != TLB_TAG_INVALID;
tlbe->recent = index; tlbe->recent = index;
tlbe->paddr[index] = PTE2.RPN << HW_PAGE_INDEX_SHIFT; tlbe->paddr[index] = PTE2.RPN << HW_PAGE_INDEX_SHIFT;
@ -1036,12 +1036,11 @@ static void UpdateTLBEntry(const XCheckTLBFlag flag, UPTE2 PTE2, const u32 addre
void InvalidateTLBEntry(u32 address) void InvalidateTLBEntry(u32 address)
{ {
PowerPC::tlb_entry* tlbe = TLBEntry* tlbe = &ppcState.tlb[0][(address >> HW_PAGE_INDEX_SHIFT) & HW_PAGE_INDEX_MASK];
&PowerPC::ppcState.tlb[0][(address >> HW_PAGE_INDEX_SHIFT) & HW_PAGE_INDEX_MASK];
tlbe->tag[0] = TLB_TAG_INVALID; tlbe->tag[0] = TLB_TAG_INVALID;
tlbe->tag[1] = TLB_TAG_INVALID; tlbe->tag[1] = TLB_TAG_INVALID;
PowerPC::tlb_entry* tlbe_i =
&PowerPC::ppcState.tlb[1][(address >> HW_PAGE_INDEX_SHIFT) & HW_PAGE_INDEX_MASK]; TLBEntry* tlbe_i = &ppcState.tlb[1][(address >> HW_PAGE_INDEX_SHIFT) & HW_PAGE_INDEX_MASK];
tlbe_i->tag[0] = TLB_TAG_INVALID; tlbe_i->tag[0] = TLB_TAG_INVALID;
tlbe_i->tag[1] = TLB_TAG_INVALID; tlbe_i->tag[1] = TLB_TAG_INVALID;
} }

View File

@ -42,7 +42,7 @@ enum CoreMode
#define TLB_WAYS 2 #define TLB_WAYS 2
#define TLB_TAG_INVALID 0xffffffff #define TLB_TAG_INVALID 0xffffffff
struct tlb_entry struct TLBEntry
{ {
u32 tag[TLB_WAYS] = {TLB_TAG_INVALID, TLB_TAG_INVALID}; u32 tag[TLB_WAYS] = {TLB_TAG_INVALID, TLB_TAG_INVALID};
u32 paddr[TLB_WAYS] = {}; u32 paddr[TLB_WAYS] = {};
@ -114,7 +114,7 @@ struct PowerPCState
// Storage for the stack pointer of the BLR optimization. // Storage for the stack pointer of the BLR optimization.
u8* stored_stack_pointer; u8* stored_stack_pointer;
std::array<std::array<tlb_entry, TLB_SIZE / TLB_WAYS>, NUM_TLBS> tlb; std::array<std::array<TLBEntry, TLB_SIZE / TLB_WAYS>, NUM_TLBS> tlb;
u32 pagetable_base; u32 pagetable_base;
u32 pagetable_hashmask; u32 pagetable_hashmask;