mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-27 14:22:17 +00:00
94ec9ae41b
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.
24 lines
864 B
C++
24 lines
864 B
C++
/*
|
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#include <stratosphere.hpp>
|
|
#include "os_resource_manager.hpp"
|
|
|
|
namespace ams::os::impl {
|
|
|
|
/* TODO: C++20 constinit */
|
|
TYPED_STORAGE(OsResourceManager) ResourceManagerHolder::s_resource_manager_storage = {};
|
|
|
|
}
|