yuzu/src/core/hle/kernel
Lioncash f2331a804a core/cpu_core_manager: Create threads separately from initialization.
Our initialization process is a little wonky than one would expect when
it comes to code flow. We initialize the CPU last, as opposed to
hardware, where the CPU obviously needs to be first, otherwise nothing
else would work, and we have code that adds checks to get around this.

For example, in the page table setting code, we check to see if the
system is turned on before we even notify the CPU instances of a page
table switch. This results in dead code (at the moment), because the
only time a page table switch will occur is when the system is *not*
running, preventing the emulated CPU instances from being notified of a
page table switch in a convenient manner (technically the code path
could be taken, but we don't emulate the process creation svc handlers
yet).

This moves the threads creation into its own member function of the core
manager and restores a little order (and predictability) to our
initialization process.

Previously, in the multi-threaded cases, we'd kick off several threads
before even the main kernel process was created and ready to execute (gross!).
Now the initialization process is like so:

Initialization:
  1. Timers

  2. CPU

  3. Kernel

  4. Filesystem stuff (kind of gross, but can be amended trivially)

  5. Applet stuff (ditto in terms of being kind of gross)

  6. Main process (will be moved into the loading step in a following
                   change)

  7. Telemetry (this should be initialized last in the future).

  8. Services (4 and 5 should ideally be alongside this).

  9. GDB (gross. Uses namespace scope state. Needs to be refactored into a
          class or booted altogether).

  10. Renderer

  11. GPU (will also have its threads created in a separate step in a
           following change).

Which... isn't *ideal* per-se, however getting rid of the wonky
intertwining of CPU state initialization out of this mix gets rid of
most of the footguns when it comes to our initialization process.
2019-04-11 22:11:40 -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/cpu_core_manager: Create threads separately from initialization. 2019-04-11 22:11:40 -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