32a6ceb4e5
Initially required due to the split codepath with how the initial main process instance was initialized. We used to initialize the process like: Init() { main_process = Process::Create(...); kernel.MakeCurrentProcess(main_process.get()); } Load() { const auto load_result = loader.Load(*kernel.GetCurrentProcess()); if (load_result != Loader::ResultStatus::Success) { // Handle error here. } ... } which presented a problem. Setting a created process as the main process would set the page table for that process as the main page table. This is fine... until we get to the part that the page table can have its size changed in the Load() function via NPDM metadata, which can dictate either a 32-bit, 36-bit, or 39-bit usable address space. Now that we have full control over the process' creation in load, we can simply set the initial process as the main process after all the loading is done, reflecting the potential page table changes without any special-casing behavior. We can also remove the cache flushing within LoadModule(), as execution wouldn't have even begun yet during all usages of this function, now that we have the initialization order cleaned up. |
||
---|---|---|
.. | ||
arm | ||
crypto | ||
file_sys | ||
frontend | ||
gdbstub | ||
hle | ||
loader | ||
tracer | ||
CMakeLists.txt | ||
core.cpp | ||
core.h | ||
core_cpu.cpp | ||
core_cpu.h | ||
core_timing.cpp | ||
core_timing.h | ||
core_timing_util.cpp | ||
core_timing_util.h | ||
cpu_core_manager.cpp | ||
cpu_core_manager.h | ||
memory.cpp | ||
memory.h | ||
memory_setup.h | ||
perf_stats.cpp | ||
perf_stats.h | ||
settings.cpp | ||
settings.h | ||
telemetry_session.cpp | ||
telemetry_session.h |