hos: change initialization API
This was needed to make stratosphere buildable with debugging on.

os:: assertions rely on GetCurrentThread() working, and this requires
the global os resource manager to be constructed. However, __appInit executes
before global constructors. We now require that hos::InitializeForStratosphere()
be called before anything else is done. This initializes the os resource manager,
sets the hos version for libnx, and may do more things in the future.

TODO: Consider replacing __appInit/__appExit with ams:: namespace functions in general,
and wrap them so that we guarantee hos::InitializeForStratosphere is called first, and
generally ensure a consistent stratosphere environment.
1 parent 332dbdd commit 94ec9ae41b652ec7e47bcde0d307b37068e2eaf3
@Michael Scire Michael Scire authored on 17 Apr 2020
Showing 23 changed files
View
libraries/libstratosphere/include/stratosphere/hos.hpp
View
libraries/libstratosphere/include/stratosphere/hos/hos_stratosphere_api.hpp 0 → 100644
View
libraries/libstratosphere/include/stratosphere/hos/hos_version_api.hpp
View
libraries/libstratosphere/source/hos/hos_stratosphere_api.cpp 0 → 100644
View
libraries/libstratosphere/source/hos/hos_version_api.cpp
View
libraries/libstratosphere/source/hos/hos_version_api_private.hpp 0 → 100644
View
libraries/libstratosphere/source/os/impl/os_resource_manager.cpp
View
libraries/libstratosphere/source/os/impl/os_resource_manager.hpp
View
libraries/libstratosphere/source/os/os_stratosphere_api.cpp 0 → 100644
View
stratosphere/ams_mitm/source/amsmitm_main.cpp
View
stratosphere/boot/source/boot_main.cpp
View
stratosphere/boot2/source/boot2_main.cpp
View
stratosphere/creport/source/creport_main.cpp
View
stratosphere/dmnt/source/dmnt_main.cpp
View
stratosphere/erpt/source/erpt_main.cpp
View
stratosphere/fatal/source/fatal_main.cpp
View
stratosphere/loader/source/ldr_main.cpp
View
stratosphere/ncm/source/ncm_main.cpp
View
stratosphere/pgl/source/pgl_main.cpp
View
stratosphere/pm/source/pm_main.cpp
View
stratosphere/ro/source/ro_main.cpp
View
stratosphere/sm/source/sm_main.cpp
View
stratosphere/spl/source/spl_main.cpp