StarletBootstrapProbe: --mmu-faults
Enables the ARM926 MMU aborts of ARMCore (SetMMUFaultsEnabled) for the run. Without the option the probe behaves as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
9b493a1e16
commit
cdec826bb8
1 file changed
+9
-4
@@ -40,7 +40,7 @@ bool FailOnAlert(const char* caption, const char* text, bool, Common::MsgType)
|
||||
std::_Exit(ALERT_EXIT_STATUS);
|
||||
}
|
||||
|
||||
bool Run(const std::string& path, bool jit, ExpectedOutcome expected)
|
||||
bool Run(const std::string& path, bool jit, bool mmu_faults, ExpectedOutcome expected)
|
||||
{
|
||||
std::ifstream file(path, std::ios::binary | std::ios::ate);
|
||||
if (!file || file.tellg() <= 0 || file.tellg() > 16 * 1024 * 1024)
|
||||
@@ -74,6 +74,8 @@ bool Run(const std::string& path, bool jit, ExpectedOutcome expected)
|
||||
core.SetJitEnabled(jit);
|
||||
core.Reset(info.entry);
|
||||
core.SetBigEndian(true);
|
||||
// StarOS MMU-001: translation, domain, permission and alignment aborts (off by default).
|
||||
core.SetMMUFaultsEnabled(mmu_faults);
|
||||
constexpr u32 TRACE_MAGIC = 0x52455631;
|
||||
constexpr u32 TRACE_CAPACITY = 1024;
|
||||
for (int slice = 0; slice < 512; ++slice)
|
||||
@@ -148,13 +150,14 @@ bool Run(const std::string& path, bool jit, ExpectedOutcome expected)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Common::RegisterMsgAlertHandler(FailOnAlert);
|
||||
if (argc < 2 || argc > 4)
|
||||
if (argc < 2 || argc > 5)
|
||||
{
|
||||
std::cerr << "Usage: StarletBootstrapProbe <ELF> [--jit] "
|
||||
std::cerr << "Usage: StarletBootstrapProbe <ELF> [--jit] [--mmu-faults] "
|
||||
"[--expect-panic|--expect-fatal-data|--expect-undefined-fault|--expect-phase2]\n";
|
||||
return 2;
|
||||
}
|
||||
bool jit = false;
|
||||
bool mmu_faults = false;
|
||||
ExpectedOutcome expected = ExpectedOutcome::Idle;
|
||||
bool outcome_selected = false;
|
||||
for (int index = 2; index < argc; ++index)
|
||||
@@ -162,6 +165,8 @@ int main(int argc, char** argv)
|
||||
const std::string_view option = argv[index];
|
||||
if (option == "--jit")
|
||||
jit = true;
|
||||
else if (option == "--mmu-faults")
|
||||
mmu_faults = true;
|
||||
else if (option == "--expect-panic" || option == "--expect-fatal-data" ||
|
||||
option == "--expect-undefined-fault" || option == "--expect-phase2")
|
||||
{
|
||||
@@ -189,7 +194,7 @@ int main(int argc, char** argv)
|
||||
auto& system = Core::System::GetInstance();
|
||||
system.SetIsWii(true);
|
||||
system.GetMemory().Init();
|
||||
const bool passed = Run(argv[1], jit, expected);
|
||||
const bool passed = Run(argv[1], jit, mmu_faults, expected);
|
||||
system.GetMemory().Shutdown();
|
||||
return passed ? 0 : 1;
|
||||
}
|
||||
Reference in new issue
Block a user