From fe5c850e69911d0916379af54f3b5cd67c2492c5 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 10 Feb 2021 02:57:22 -0800 Subject: [PATCH] psc: fix pm module init --- .../include/stratosphere/psc/psc_pm_module_id.hpp | 2 +- .../libstratosphere/source/psc/psc_pm_module.os.horizon.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/psc/psc_pm_module_id.hpp b/libraries/libstratosphere/include/stratosphere/psc/psc_pm_module_id.hpp index 61196a79c..079ceb73e 100644 --- a/libraries/libstratosphere/include/stratosphere/psc/psc_pm_module_id.hpp +++ b/libraries/libstratosphere/include/stratosphere/psc/psc_pm_module_id.hpp @@ -19,7 +19,7 @@ namespace ams::psc { - enum PmModuleId : u16 { + enum PmModuleId : u32 { PmModuleId_Usb = 4, PmModuleId_Ethernet = 5, PmModuleId_Fgm = 6, diff --git a/libraries/libstratosphere/source/psc/psc_pm_module.os.horizon.cpp b/libraries/libstratosphere/source/psc/psc_pm_module.os.horizon.cpp index e808dbf2b..89ee7d03f 100644 --- a/libraries/libstratosphere/source/psc/psc_pm_module.os.horizon.cpp +++ b/libraries/libstratosphere/source/psc/psc_pm_module.os.horizon.cpp @@ -46,9 +46,9 @@ namespace ams::psc { Result PmModule::Initialize(const PmModuleId mid, const PmModuleId *dependencies, u32 dependency_count, os::EventClearMode clear_mode) { R_UNLESS(!this->initialized, psc::ResultAlreadyInitialized()); - static_assert(sizeof(*dependencies) == sizeof(u16)); + static_assert(sizeof(*dependencies) == sizeof(u32)); ::PscPmModule module; - R_TRY(::pscmGetPmModule(std::addressof(module), static_cast<::PscPmModuleId>(mid), reinterpret_cast(dependencies), dependency_count, clear_mode == os::EventClearMode_AutoClear)); + R_TRY(::pscmGetPmModule(std::addressof(module), static_cast<::PscPmModuleId>(mid), reinterpret_cast(dependencies), dependency_count, clear_mode == os::EventClearMode_AutoClear)); this->intf = RemoteObjectFactory::CreateSharedEmplaced(module); this->system_event.AttachReadableHandle(module.event.revent, false, clear_mode);