mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
MMU: Move invalidation logic into the TLBEntry struct
Puts the invalidation logic in one place and lets us tidy up InvalidateTLBEntry a little.
This commit is contained in:
parent
3216040bfe
commit
1c776d8c1a
@ -1295,13 +1295,8 @@ void InvalidateTLBEntry(u32 address)
|
||||
{
|
||||
const u32 entry_index = (address >> HW_PAGE_INDEX_SHIFT) & HW_PAGE_INDEX_MASK;
|
||||
|
||||
TLBEntry& tlbe = ppcState.tlb[0][entry_index];
|
||||
tlbe.tag[0] = TLBEntry::INVALID_TAG;
|
||||
tlbe.tag[1] = TLBEntry::INVALID_TAG;
|
||||
|
||||
TLBEntry& tlbe_i = ppcState.tlb[1][entry_index];
|
||||
tlbe_i.tag[0] = TLBEntry::INVALID_TAG;
|
||||
tlbe_i.tag[1] = TLBEntry::INVALID_TAG;
|
||||
ppcState.tlb[0][entry_index].Invalidate();
|
||||
ppcState.tlb[1][entry_index].Invalidate();
|
||||
}
|
||||
|
||||
// Page Address Translation
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <iosfwd>
|
||||
#include <tuple>
|
||||
@ -49,12 +50,16 @@ constexpr size_t TLB_WAYS = 2;
|
||||
|
||||
struct TLBEntry
|
||||
{
|
||||
using WayArray = std::array<u32, TLB_WAYS>;
|
||||
|
||||
static constexpr u32 INVALID_TAG = 0xffffffff;
|
||||
|
||||
u32 tag[TLB_WAYS] = {INVALID_TAG, INVALID_TAG};
|
||||
u32 paddr[TLB_WAYS] = {};
|
||||
u32 pte[TLB_WAYS] = {};
|
||||
WayArray tag{INVALID_TAG, INVALID_TAG};
|
||||
WayArray paddr{};
|
||||
WayArray pte{};
|
||||
u32 recent = 0;
|
||||
|
||||
void Invalidate() { tag.fill(INVALID_TAG); }
|
||||
};
|
||||
|
||||
struct PairedSingle
|
||||
|
Loading…
x
Reference in New Issue
Block a user