mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 03:06:52 -04:00
erpt: update for new sf semantics
This commit is contained in:
parent
5191f0e305
commit
dc4ee1a5bc
2 changed files with 50 additions and 3 deletions
|
@ -18,6 +18,22 @@
|
|||
|
||||
namespace ams::psc {
|
||||
|
||||
/* TODO: Nintendo uses sf::ShimLobraryObjectHolder here, we should similarly consider switching. */
|
||||
namespace {
|
||||
|
||||
struct PscRemotePmModuleTag;
|
||||
using RemoteAllocator = ams::sf::ExpHeapStaticAllocator<2_KB, PscRemotePmModuleTag>;
|
||||
using RemoteObjectFactory = ams::sf::ObjectFactory<typename RemoteAllocator::Policy>;
|
||||
|
||||
class StaticAllocatorInitializer {
|
||||
public:
|
||||
StaticAllocatorInitializer() {
|
||||
RemoteAllocator::Initialize(lmem::CreateOption_None);
|
||||
}
|
||||
} g_static_allocator_initializer;
|
||||
|
||||
}
|
||||
|
||||
PmModule::PmModule() : intf(nullptr), initialized(false), reserved(0) { /* ... */ }
|
||||
|
||||
PmModule::~PmModule() {
|
||||
|
@ -34,8 +50,7 @@ namespace ams::psc {
|
|||
::PscPmModule module;
|
||||
R_TRY(::pscmGetPmModule(std::addressof(module), static_cast<::PscPmModuleId>(mid), reinterpret_cast<const u16 *>(dependencies), dependency_count, clear_mode == os::EventClearMode_AutoClear));
|
||||
|
||||
/* TODO: Proper allocator */
|
||||
this->intf = ams::sf::CreateSharedObjectEmplaced<psc::sf::IPmModule, RemotePmModule>(module);
|
||||
this->intf = RemoteObjectFactory::CreateSharedEmplaced<psc::sf::IPmModule, RemotePmModule>(module);
|
||||
this->system_event.AttachReadableHandle(module.event.revent, false, clear_mode);
|
||||
this->initialized = true;
|
||||
return ResultSuccess();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue