PowerPC: Move MMU-specifics from PowerPC.h to MMU.h
PowerPC.h at this point is pretty much a general glob of stuff, and it's unfortunate, since it means pulling in a lot of unrelated header dependencies and a bunch of other things that don't need to be seen by things that just want to read memory. Breaking this out into its own header keeps all the MMU-related stuff together and also limits the amount of header dependencies being included (the primary motivation for this being the former reason).
This commit is contained in:
parent
6ef7578321
commit
b9aad3310e
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include "Core/ARDecrypt.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
|
||||
namespace ActionReplay
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "Core/IOS/FS/FileSystem.h"
|
||||
#include "Core/IOS/IOS.h"
|
||||
#include "Core/IOS/Uids.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
#include "DiscIO/Enums.h"
|
||||
|
|
|
@ -524,6 +524,7 @@
|
|||
<ClInclude Include="PowerPC\SignatureDB\MEGASignatureDB.h" />
|
||||
<ClInclude Include="PowerPC\SignatureDB\SignatureDB.h" />
|
||||
<ClInclude Include="PowerPC\JitInterface.h" />
|
||||
<ClInclude Include="PowerPC\MMU.h" />
|
||||
<ClInclude Include="PowerPC\PowerPC.h" />
|
||||
<ClInclude Include="PowerPC\PPCAnalyst.h" />
|
||||
<ClInclude Include="PowerPC\PPCCache.h" />
|
||||
|
|
|
@ -1305,6 +1305,9 @@
|
|||
<ClInclude Include="PowerPC\JitInterface.h">
|
||||
<Filter>PowerPC</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PowerPC\MMU.h">
|
||||
<Filter>PowerPC</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PowerPC\PowerPC.h">
|
||||
<Filter>PowerPC</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCAnalyst.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/DSP.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
void RSOHeaderView::Load(u32 address)
|
||||
{
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "Core/HW/SystemTimers.h"
|
||||
#include "Core/HW/VideoInterface.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
#include "VideoCommon/CommandProcessor.h"
|
||||
|
|
|
@ -12,10 +12,11 @@
|
|||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/CommonPaths.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/FileUtil.h"
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
namespace Gecko
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
|
||||
#include "Core/HLE/HLE_Misc.h"
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/GeckoCode.h"
|
||||
#include "Core/HW/CPU.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
namespace HLE_Misc
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/HLE/HLE_VarArgs.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
namespace HLE_OS
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "Common/Align.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
#include <type_traits>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "Common/CommonTypes.h"
|
||||
#include "Common/MathUtil.h"
|
||||
#include "Common/Swap.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
|
||||
// Global declarations
|
||||
class PointerWrap;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "Core/ConfigManager.h"
|
||||
#include "Core/GeckoCode.h"
|
||||
#include "Core/GeckoCodeConfig.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
namespace PatchEngine
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "Common/Logging/Log.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
|
||||
bool BreakPoints::IsAddressBreakPoint(u32 address) const
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HW/CPU.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCTables.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "Core/CoreTiming.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
void Interpreter::bx(UGeckoInstruction inst)
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "Core/PowerPC/Interpreter/Interpreter.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
bool Interpreter::m_reserve;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "Common/MathUtil.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
// dequantize table
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "Core/HW/GPFifo.h"
|
||||
#include "Core/HW/SystemTimers.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
/*
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "Core/PowerPC/Jit64Common/Jit64PowerPCState.h"
|
||||
#include "Core/PowerPC/Jit64Common/TrampolineCache.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/PowerPC/Profiler.h"
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
#include "Common/CPUDetect.h"
|
||||
#include "Common/FloatUtils.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
#include "Common/Swap.h"
|
||||
#include "Core/HW/MMIO.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/Gekko.h"
|
||||
#include "Core/PowerPC/Jit64Common/Jit64Base.h"
|
||||
#include "Core/PowerPC/Jit64Common/Jit64PowerPCState.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
using namespace Gen;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/JitArm64/Jit.h"
|
||||
#include "Core/PowerPC/JitArmCommon/BackPatch.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
using namespace Arm64Gen;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "Core/PowerPC/JitArm64/JitArm64_RegCache.h"
|
||||
#include "Core/PowerPC/JitArm64/Jit_Util.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCTables.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "Core/CoreTiming.h"
|
||||
#include "Core/PowerPC/JitArm64/Jit.h"
|
||||
#include "Core/PowerPC/JitArm64/JitArm64_RegCache.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCTables.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "Core/PowerPC/JitArm64/Jit.h"
|
||||
#include "Core/PowerPC/JitCommon/JitAsmCommon.h"
|
||||
#include "Core/PowerPC/JitCommon/JitCache.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
using namespace Arm64Gen;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/PowerPC/JitCommon/JitBase.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "Core/PowerPC/CPUCoreBase.h"
|
||||
#include "Core/PowerPC/CachedInterpreter/CachedInterpreter.h"
|
||||
#include "Core/PowerPC/JitCommon/JitBase.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/PowerPC/Profiler.h"
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "Common/Atomic.h"
|
||||
#include "Common/BitUtils.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
// Copyright 2018 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
namespace PowerPC
|
||||
{
|
||||
// Routines for debugger UI, cheats, etc. to access emulated memory from the
|
||||
// perspective of the CPU. Not for use by core emulation routines.
|
||||
// Use "Host_" prefix.
|
||||
u8 HostRead_U8(u32 address);
|
||||
u16 HostRead_U16(u32 address);
|
||||
u32 HostRead_U32(u32 address);
|
||||
u64 HostRead_U64(u32 address);
|
||||
float HostRead_F32(u32 address);
|
||||
double HostRead_F64(u32 address);
|
||||
u32 HostRead_Instruction(u32 address);
|
||||
|
||||
void HostWrite_U8(u8 var, u32 address);
|
||||
void HostWrite_U16(u16 var, u32 address);
|
||||
void HostWrite_U32(u32 var, u32 address);
|
||||
void HostWrite_U64(u64 var, u32 address);
|
||||
void HostWrite_F32(float var, u32 address);
|
||||
void HostWrite_F64(double var, u32 address);
|
||||
|
||||
std::string HostGetString(u32 address, size_t size = 0);
|
||||
|
||||
// Returns whether a read or write to the given address will resolve to a RAM
|
||||
// access given the current CPU state.
|
||||
bool HostIsRAMAddress(u32 address);
|
||||
|
||||
// Same as HostIsRAMAddress, but uses IBAT instead of DBAT.
|
||||
bool HostIsInstructionRAMAddress(u32 address);
|
||||
|
||||
// Routines for the CPU core to access memory.
|
||||
|
||||
// Used by interpreter to read instructions, uses iCache
|
||||
u32 Read_Opcode(u32 address);
|
||||
struct TryReadInstResult
|
||||
{
|
||||
bool valid;
|
||||
bool from_bat;
|
||||
u32 hex;
|
||||
u32 physical_address;
|
||||
};
|
||||
TryReadInstResult TryReadInstruction(u32 address);
|
||||
|
||||
u8 Read_U8(u32 address);
|
||||
u16 Read_U16(u32 address);
|
||||
u32 Read_U32(u32 address);
|
||||
u64 Read_U64(u32 address);
|
||||
|
||||
// Useful helper functions, used by ARM JIT
|
||||
float Read_F32(u32 address);
|
||||
double Read_F64(u32 address);
|
||||
|
||||
// used by JIT. Return zero-extended 32bit values
|
||||
u32 Read_U8_ZX(u32 address);
|
||||
u32 Read_U16_ZX(u32 address);
|
||||
|
||||
void Write_U8(u8 var, u32 address);
|
||||
void Write_U16(u16 var, u32 address);
|
||||
void Write_U32(u32 var, u32 address);
|
||||
void Write_U64(u64 var, u32 address);
|
||||
|
||||
void Write_U16_Swap(u16 var, u32 address);
|
||||
void Write_U32_Swap(u32 var, u32 address);
|
||||
void Write_U64_Swap(u64 var, u32 address);
|
||||
|
||||
// Useful helper functions, used by ARM JIT
|
||||
void Write_F64(double var, u32 address);
|
||||
|
||||
void DMA_LCToMemory(u32 mem_address, u32 cache_address, u32 num_blocks);
|
||||
void DMA_MemoryToLC(u32 cache_address, u32 mem_address, u32 num_blocks);
|
||||
void ClearCacheLine(u32 address); // Zeroes 32 bytes; address should be 32-byte-aligned
|
||||
|
||||
// TLB functions
|
||||
void SDRUpdated();
|
||||
void InvalidateTLBEntry(u32 address);
|
||||
void DBATUpdated();
|
||||
void IBATUpdated();
|
||||
|
||||
// Result changes based on the BAT registers and MSR.DR. Returns whether
|
||||
// it's safe to optimize a read or write to this address to an unguarded
|
||||
// memory access. Does not consider page tables.
|
||||
bool IsOptimizableRAMAddress(u32 address);
|
||||
u32 IsOptimizableMMIOAccess(u32 address, u32 access_size);
|
||||
bool IsOptimizableGatherPipeWrite(u32 address);
|
||||
|
||||
struct TranslateResult
|
||||
{
|
||||
bool valid;
|
||||
bool from_bat;
|
||||
u32 address;
|
||||
};
|
||||
TranslateResult JitCache_TranslateAddress(u32 address);
|
||||
|
||||
constexpr int BAT_INDEX_SHIFT = 17;
|
||||
constexpr u32 BAT_PAGE_SIZE = 1 << BAT_INDEX_SHIFT;
|
||||
constexpr u32 BAT_MAPPED_BIT = 0x1;
|
||||
constexpr u32 BAT_PHYSICAL_BIT = 0x2;
|
||||
constexpr u32 BAT_RESULT_MASK = UINT32_C(~0x3);
|
||||
using BatTable = std::array<u32, 1 << (32 - BAT_INDEX_SHIFT)>; // 128 KB
|
||||
extern BatTable ibat_table;
|
||||
extern BatTable dbat_table;
|
||||
inline bool TranslateBatAddess(const BatTable& bat_table, u32* address)
|
||||
{
|
||||
u32 bat_result = bat_table[*address >> BAT_INDEX_SHIFT];
|
||||
if ((bat_result & BAT_MAPPED_BIT) == 0)
|
||||
return false;
|
||||
*address = (bat_result & BAT_RESULT_MASK) | (*address & (BAT_PAGE_SIZE - 1));
|
||||
return true;
|
||||
}
|
||||
} // namespace PowerPC
|
|
@ -15,6 +15,7 @@
|
|||
#include "Common/Logging/Log.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PPCTables.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
#include "Common/CommonTypes.h"
|
||||
#include "Common/File.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCAnalyst.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/PowerPC/SignatureDB/SignatureDB.h"
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
#include "Core/ConfigManager.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/HW/CPU.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/HW/SystemTimers.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/PowerPC/CPUCoreBase.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
|
||||
namespace PowerPC
|
||||
{
|
||||
|
|
|
@ -210,112 +210,6 @@ void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst);
|
|||
#define riPS0(i) (*(u64*)(&PowerPC::ppcState.ps[i][0]))
|
||||
#define riPS1(i) (*(u64*)(&PowerPC::ppcState.ps[i][1]))
|
||||
|
||||
// Routines for debugger UI, cheats, etc. to access emulated memory from the
|
||||
// perspective of the CPU. Not for use by core emulation routines.
|
||||
// Use "Host_" prefix.
|
||||
u8 HostRead_U8(u32 address);
|
||||
u16 HostRead_U16(u32 address);
|
||||
u32 HostRead_U32(u32 address);
|
||||
u64 HostRead_U64(u32 address);
|
||||
float HostRead_F32(u32 address);
|
||||
double HostRead_F64(u32 address);
|
||||
u32 HostRead_Instruction(u32 address);
|
||||
|
||||
void HostWrite_U8(u8 var, u32 address);
|
||||
void HostWrite_U16(u16 var, u32 address);
|
||||
void HostWrite_U32(u32 var, u32 address);
|
||||
void HostWrite_U64(u64 var, u32 address);
|
||||
void HostWrite_F32(float var, u32 address);
|
||||
void HostWrite_F64(double var, u32 address);
|
||||
|
||||
// Returns whether a read or write to the given address will resolve to a RAM
|
||||
// access given the current CPU state.
|
||||
bool HostIsRAMAddress(u32 address);
|
||||
// Same as HostIsRAMAddress, but uses IBAT instead of DBAT.
|
||||
bool HostIsInstructionRAMAddress(u32 address);
|
||||
|
||||
std::string HostGetString(u32 em_address, size_t size = 0);
|
||||
|
||||
// Routines for the CPU core to access memory.
|
||||
|
||||
// Used by interpreter to read instructions, uses iCache
|
||||
u32 Read_Opcode(u32 address);
|
||||
struct TryReadInstResult
|
||||
{
|
||||
bool valid;
|
||||
bool from_bat;
|
||||
u32 hex;
|
||||
u32 physical_address;
|
||||
};
|
||||
TryReadInstResult TryReadInstruction(u32 address);
|
||||
|
||||
u8 Read_U8(u32 address);
|
||||
u16 Read_U16(u32 address);
|
||||
u32 Read_U32(u32 address);
|
||||
u64 Read_U64(u32 address);
|
||||
|
||||
// Useful helper functions, used by ARM JIT
|
||||
float Read_F32(u32 address);
|
||||
double Read_F64(u32 address);
|
||||
|
||||
// used by JIT. Return zero-extended 32bit values
|
||||
u32 Read_U8_ZX(u32 address);
|
||||
u32 Read_U16_ZX(u32 address);
|
||||
|
||||
void Write_U8(u8 var, u32 address);
|
||||
void Write_U16(u16 var, u32 address);
|
||||
void Write_U32(u32 var, u32 address);
|
||||
void Write_U64(u64 var, u32 address);
|
||||
|
||||
void Write_U16_Swap(u16 var, u32 address);
|
||||
void Write_U32_Swap(u32 var, u32 address);
|
||||
void Write_U64_Swap(u64 var, u32 address);
|
||||
|
||||
// Useful helper functions, used by ARM JIT
|
||||
void Write_F64(double var, u32 address);
|
||||
|
||||
void DMA_LCToMemory(u32 memAddr, u32 cacheAddr, u32 numBlocks);
|
||||
void DMA_MemoryToLC(u32 cacheAddr, u32 memAddr, u32 numBlocks);
|
||||
void ClearCacheLine(u32 address); // Zeroes 32 bytes; address should be 32-byte-aligned
|
||||
|
||||
// TLB functions
|
||||
void SDRUpdated();
|
||||
void InvalidateTLBEntry(u32 address);
|
||||
void DBATUpdated();
|
||||
void IBATUpdated();
|
||||
|
||||
// Result changes based on the BAT registers and MSR.DR. Returns whether
|
||||
// it's safe to optimize a read or write to this address to an unguarded
|
||||
// memory access. Does not consider page tables.
|
||||
bool IsOptimizableRAMAddress(u32 address);
|
||||
u32 IsOptimizableMMIOAccess(u32 address, u32 accessSize);
|
||||
bool IsOptimizableGatherPipeWrite(u32 address);
|
||||
|
||||
struct TranslateResult
|
||||
{
|
||||
bool valid;
|
||||
bool from_bat;
|
||||
u32 address;
|
||||
};
|
||||
TranslateResult JitCache_TranslateAddress(u32 address);
|
||||
|
||||
constexpr int BAT_INDEX_SHIFT = 17;
|
||||
constexpr u32 BAT_PAGE_SIZE = 1 << BAT_INDEX_SHIFT;
|
||||
constexpr u32 BAT_MAPPED_BIT = 0x1;
|
||||
constexpr u32 BAT_PHYSICAL_BIT = 0x2;
|
||||
constexpr u32 BAT_RESULT_MASK = UINT32_C(~0x3);
|
||||
using BatTable = std::array<u32, 1 << (32 - BAT_INDEX_SHIFT)>; // 128 KB
|
||||
extern BatTable ibat_table;
|
||||
extern BatTable dbat_table;
|
||||
inline bool TranslateBatAddess(const BatTable& bat_table, u32* address)
|
||||
{
|
||||
u32 bat_result = bat_table[*address >> BAT_INDEX_SHIFT];
|
||||
if ((bat_result & BAT_MAPPED_BIT) == 0)
|
||||
return false;
|
||||
*address = (bat_result & BAT_RESULT_MASK) | (*address & (BAT_PAGE_SIZE - 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
enum CRBits
|
||||
{
|
||||
CR_SO = 1,
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include "Common/Logging/Log.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
// Format Handlers
|
||||
#include "Core/PowerPC/SignatureDB/CSVSignatureDB.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "Core/Core.h"
|
||||
#include "Core/Debugger/PPCDebugInterface.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "UICommon/GameFile.h"
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "Common/StringUtil.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Debugger/PPCDebugInterface.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCAnalyst.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "Core/Core.h"
|
||||
#include "Core/Debugger/Debugger_SymbolMap.h"
|
||||
#include "Core/HW/CPU.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinQt2/Host.h"
|
||||
|
|
|
@ -10,10 +10,13 @@
|
|||
#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include <cctype>
|
||||
#include <cmath>
|
||||
|
||||
#include "Core/Core.h"
|
||||
#include "Core/PowerPC/BreakPoints.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
#include "DolphinQt2/QtUtils/ActionHelper.h"
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "Common/IniFile.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
#include "DolphinQt2/QtUtils/ActionHelper.h"
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HW/WiiSave.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/IOS/ES/ES.h"
|
||||
#include "Core/IOS/IOS.h"
|
||||
#include "Core/IOS/USB/Bluetooth/BTEmu.h"
|
||||
#include "Core/Movie.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCAnalyst.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#include "Common/SymbolDB.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCAnalyst.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinWX/Debugger/AssemblerEntryDialog.h"
|
||||
#include "DolphinWX/Debugger/CodeView.h"
|
||||
#include "DolphinWX/Debugger/DebuggerUIUtil.h"
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "Core/PowerPC/BreakPoints.h"
|
||||
#include "Core/PowerPC/Gekko.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PPCTables.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "Common/StringUtil.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinWX/Debugger/CodeWindow.h"
|
||||
#include "DolphinWX/Debugger/DebuggerUIUtil.h"
|
||||
#include "DolphinWX/Debugger/WatchWindow.h"
|
||||
|
|
|
@ -2,20 +2,19 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <wx/colour.h>
|
||||
#include "DolphinWX/Debugger/WatchView.h"
|
||||
|
||||
#include <wx/grid.h>
|
||||
#include <wx/menu.h>
|
||||
|
||||
#include "Common/GekkoDisassembler.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinWX/Debugger/BreakpointWindow.h"
|
||||
#include "DolphinWX/Debugger/CodeWindow.h"
|
||||
#include "DolphinWX/Debugger/DebuggerUIUtil.h"
|
||||
#include "DolphinWX/Debugger/MemoryWindow.h"
|
||||
#include "DolphinWX/Debugger/RegisterView.h"
|
||||
#include "DolphinWX/Debugger/WatchView.h"
|
||||
#include "DolphinWX/Debugger/WatchWindow.h"
|
||||
#include "DolphinWX/Frame.h"
|
||||
#include "DolphinWX/Main.h"
|
||||
|
|
Loading…
Reference in New Issue