suyu/src/core/hle/kernel
Lioncash 32a6ceb4e5 core/process: Remove unideal page table setting from LoadFromMetadata()
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.
2019-04-11 22:11:41 -04:00
..
address_arbiter.cpp Small fixes to address_arbiter to better match the IDB. 2019-03-19 20:32:46 -04:00
address_arbiter.h kernel: Make the address arbiter instance per-process 2019-03-07 23:27:51 -05:00
client_port.cpp kernel/server_session: Return a std::pair from CreateSessionPair() 2019-04-06 01:42:03 -04:00
client_port.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
client_session.cpp kernel/server_session: Make data members private 2019-03-05 20:10:07 -05:00
client_session.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
code_set.cpp kernel: Move CodeSet structure to its own source files 2019-03-20 13:07:04 -04:00
code_set.h kernel/codeset: Make CodeSet's memory data member a regular std::vector 2019-03-22 18:43:46 -04:00
errors.h kernel/handle_table: Allow process capabilities to limit the handle table size 2019-02-25 11:12:32 -05:00
handle_table.cpp kernel/handle_table: Make local variables as const where applicable 2019-02-25 11:12:38 -05:00
handle_table.h kernel/handle_table: Allow process capabilities to limit the handle table size 2019-02-25 11:12:32 -05:00
hle_ipc.cpp kernel/hle_ipc: Convert std::shared_ptr IPC header instances to std::optional 2019-03-07 23:34:37 -05:00
hle_ipc.h kernel/hle_ipc: Convert std::shared_ptr IPC header instances to std::optional 2019-03-07 23:34:37 -05:00
kernel.cpp core/cpu_core_manager: Create threads separately from initialization. 2019-04-11 22:11:40 -04:00
kernel.h kernel/svc: Implement svcGetProcessList 2019-04-02 00:47:14 -04:00
mutex.cpp core/hle/kernel/mutex: Remove usages of global system accessors 2019-03-14 20:55:52 -04:00
mutex.h core/hle/kernel: Make Mutex a per-process class. 2019-03-14 20:55:52 -04:00
object.cpp kernel/object: Remove unused handle type entry 2019-04-03 10:24:32 -04:00
object.h kernel/object: Remove unused handle type entry 2019-04-03 10:24:32 -04:00
process.cpp core/process: Remove unideal page table setting from LoadFromMetadata() 2019-04-11 22:11:41 -04:00
process.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
process_capability.cpp kernel/handle_table: Allow process capabilities to limit the handle table size 2019-02-25 11:12:32 -05:00
process_capability.h kernel/handle_table: Allow process capabilities to limit the handle table size 2019-02-25 11:12:32 -05:00
readable_event.cpp kernel/wait_object: Make ShouldWait() take thread members by pointer-to-const 2019-04-01 18:19:45 -04:00
readable_event.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
resource_limit.cpp kernel/resource_limit: Remove the name member from resource limits 2019-04-01 16:49:28 -04:00
resource_limit.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
scheduler.cpp kernel: Handle page table switching within MakeCurrentProcess() 2019-04-07 01:12:54 -04:00
scheduler.h kernel/scheduler: Remove unused parameter to AddThread() 2019-03-30 05:29:33 -04:00
server_port.cpp kernel/server_port: Return a std::pair from CreatePortPair() 2019-04-06 01:36:53 -04:00
server_port.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
server_session.cpp kernel/server_session: Remove obsolete TODOs 2019-04-09 23:34:49 -04:00
server_session.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
session.cpp Format: Run the new clang format on everything 2018-01-20 16:45:11 -07:00
session.h kernel: Move object class to its own source files 2018-08-01 23:34:42 -04:00
shared_memory.cpp kernel/shared_memory: Remove unused core/memory.h include 2019-03-29 18:16:22 -04:00
shared_memory.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
svc.cpp kernel/svc: Deglobalize the supervisor call handlers 2019-04-07 20:30:05 -04:00
svc.h kernel/svc: Deglobalize the supervisor call handlers 2019-04-07 20:30:05 -04:00
svc_wrap.h kernel/svc: Deglobalize the supervisor call handlers 2019-04-07 20:30:05 -04:00
thread.cpp Merge pull request #2314 from lioncash/const 2019-04-03 11:46:17 -04:00
thread.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00
transfer_memory.cpp kernel/transfer_memory: Add accessors to data and sizes 2019-04-03 17:49:16 -04:00
transfer_memory.h kernel/transfer_memory: Add accessors to data and sizes 2019-04-03 17:49:16 -04:00
vm_manager.cpp kernel/vm_manager: Handle shrinking of the heap size within SetHeapSize() 2019-03-24 17:08:30 -04:00
vm_manager.h kernel/vm_manager: Handle shrinking of the heap size within SetHeapSize() 2019-03-24 17:08:30 -04:00
wait_object.cpp core/kernel: Remove unnecessary inclusions 2018-12-31 19:04:16 -05:00
wait_object.h kernel/wait_object: Make ShouldWait() take thread members by pointer-to-const 2019-04-01 18:19:45 -04:00
writable_event.cpp hle_ipc: Refactor SleepClientThread to avoid ReadableEvent 2018-11-29 09:14:20 -05:00
writable_event.h kernel: Make handle type declarations constexpr 2019-04-11 16:34:53 -04:00