kern: devirtualize remaining vcall for class token/dyncast
This commit is contained in:
@@ -487,7 +487,7 @@ namespace ams::kern::board::nintendo::nx {
|
||||
{
|
||||
/* Construct the resource limit object. */
|
||||
KResourceLimit &sys_res_limit = Kernel::GetSystemResourceLimit();
|
||||
KAutoObject::Create(std::addressof(sys_res_limit));
|
||||
KAutoObject::Create<KResourceLimit>(std::addressof(sys_res_limit));
|
||||
sys_res_limit.Initialize();
|
||||
|
||||
/* Set the initial limits. */
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 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 <mesosphere.hpp>
|
||||
|
||||
namespace ams::kern {
|
||||
|
||||
KAutoObject *KAutoObject::Create(KAutoObject *obj) {
|
||||
obj->m_ref_count = 1;
|
||||
|
||||
#if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
|
||||
obj->m_class_token = obj->GetTypeObj().GetClassToken();
|
||||
#endif
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace ams::kern {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
|
||||
/* Create our readable event. */
|
||||
KAutoObject::Create(std::addressof(m_readable_event));
|
||||
KAutoObject::Create<KReadableEvent>(std::addressof(m_readable_event));
|
||||
|
||||
/* Initialize our readable event. */
|
||||
m_readable_event.Initialize(this);
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace ams::kern {
|
||||
this->Open();
|
||||
|
||||
/* Create our sub sessions. */
|
||||
KAutoObject::Create(std::addressof(m_server));
|
||||
KAutoObject::Create(std::addressof(m_client));
|
||||
KAutoObject::Create<KLightServerSession>(std::addressof(m_server));
|
||||
KAutoObject::Create<KLightClientSession>(std::addressof(m_client));
|
||||
|
||||
/* Initialize our sub sessions. */
|
||||
m_server.Initialize(this);
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace ams::kern {
|
||||
this->Open();
|
||||
|
||||
/* Create and initialize our server/client pair. */
|
||||
KAutoObject::Create(std::addressof(m_server));
|
||||
KAutoObject::Create(std::addressof(m_client));
|
||||
KAutoObject::Create<KServerPort>(std::addressof(m_server));
|
||||
KAutoObject::Create<KClientPort>(std::addressof(m_client));
|
||||
m_server.Initialize(this);
|
||||
m_client.Initialize(this, max_sessions);
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace ams::kern {
|
||||
this->Open();
|
||||
|
||||
/* Create our sub sessions. */
|
||||
KAutoObject::Create(std::addressof(m_server));
|
||||
KAutoObject::Create(std::addressof(m_client));
|
||||
KAutoObject::Create<KServerSession>(std::addressof(m_server));
|
||||
KAutoObject::Create<KClientSession>(std::addressof(m_client));
|
||||
|
||||
/* Initialize our sub sessions. */
|
||||
m_server.Initialize(this);
|
||||
|
||||
@@ -50,8 +50,8 @@ namespace ams::kern {
|
||||
void *main_thread_stack = GetVoidPointer(KMemoryLayout::GetMainStackTopAddress(core_id));
|
||||
KThread *idle_thread = std::addressof(Kernel::GetIdleThread(core_id));
|
||||
void *idle_thread_stack = GetVoidPointer(KMemoryLayout::GetIdleStackTopAddress(core_id));
|
||||
KAutoObject::Create(main_thread);
|
||||
KAutoObject::Create(idle_thread);
|
||||
KAutoObject::Create<KThread>(main_thread);
|
||||
KAutoObject::Create<KThread>(idle_thread);
|
||||
main_thread->Initialize(nullptr, 0, main_thread_stack, 0, KThread::MainThreadPriority, core_id, nullptr, KThread::ThreadType_Main);
|
||||
idle_thread->Initialize(nullptr, 0, idle_thread_stack, 0, KThread::IdleThreadPriority, core_id, nullptr, KThread::ThreadType_Main);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user