mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
kern: KObjectContainer::Register -> void
This commit is contained in:
parent
b0debd72a7
commit
783f1077be
15 changed files with 19 additions and 23 deletions
|
@ -56,8 +56,8 @@ namespace ams::kern {
|
|||
void Initialize() { MESOSPHERE_ASSERT_THIS(); }
|
||||
void Finalize() { MESOSPHERE_ASSERT_THIS(); }
|
||||
|
||||
Result Register(KAutoObjectWithList *obj);
|
||||
Result Unregister(KAutoObjectWithList *obj);
|
||||
void Register(KAutoObjectWithList *obj);
|
||||
void Unregister(KAutoObjectWithList *obj);
|
||||
size_t GetOwnedCount(KProcess *owner);
|
||||
};
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace ams::kern {
|
|||
return obj;
|
||||
}
|
||||
|
||||
static Result Register(Derived *obj) {
|
||||
static void Register(Derived *obj) {
|
||||
return s_container.Register(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,24 +18,20 @@
|
|||
namespace ams::kern {
|
||||
|
||||
|
||||
Result KAutoObjectWithListContainer::Register(KAutoObjectWithList *obj) {
|
||||
void KAutoObjectWithListContainer::Register(KAutoObjectWithList *obj) {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
|
||||
KScopedLightLock lk(this->lock);
|
||||
|
||||
this->object_list.insert(*obj);
|
||||
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
Result KAutoObjectWithListContainer::Unregister(KAutoObjectWithList *obj) {
|
||||
void KAutoObjectWithListContainer::Unregister(KAutoObjectWithList *obj) {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
|
||||
KScopedLightLock lk(this->lock);
|
||||
|
||||
this->object_list.erase(this->object_list.iterator_to(*obj));
|
||||
|
||||
return ams::svc::ResultNotFound();
|
||||
}
|
||||
|
||||
size_t KAutoObjectWithListContainer::GetOwnedCount(KProcess *owner) {
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace ams::kern::svc {
|
|||
R_TRY(code_mem->Initialize(address, size));
|
||||
|
||||
/* Register the code memory. */
|
||||
R_TRY(KCodeMemory::Register(code_mem));
|
||||
KCodeMemory::Register(code_mem);
|
||||
|
||||
/* Add the code memory to the handle table. */
|
||||
R_TRY(GetCurrentProcess().GetHandleTable().Add(out, code_mem));
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace ams::kern::svc {
|
|||
R_TRY(das->Initialize(das_address, das_size));
|
||||
|
||||
/* Register the device address space. */
|
||||
R_TRY(KDeviceAddressSpace::Register(das));
|
||||
KDeviceAddressSpace::Register(das);
|
||||
|
||||
/* Add to the handle table. */
|
||||
R_TRY(GetCurrentProcess().GetHandleTable().Add(out, das));
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace ams::kern::svc {
|
|||
};
|
||||
|
||||
/* Register the event. */
|
||||
R_TRY(KEvent::Register(event));
|
||||
KEvent::Register(event);
|
||||
|
||||
/* Add the writable event to the handle table. */
|
||||
R_TRY(handle_table.Add(out_write, std::addressof(event->GetWritableEvent())));
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace ams::kern::svc {
|
|||
R_TRY(event->Initialize(interrupt_id, type));
|
||||
|
||||
/* Register the event. */
|
||||
R_TRY(KInterruptEvent::Register(event));
|
||||
KInterruptEvent::Register(event);
|
||||
|
||||
/* Add the event to the handle table. */
|
||||
R_TRY(handle_table.Add(out, event));
|
||||
|
|
|
@ -187,7 +187,7 @@ namespace ams::kern::svc {
|
|||
};
|
||||
|
||||
/* Register the event. */
|
||||
R_TRY(KEvent::Register(event));
|
||||
KEvent::Register(event);
|
||||
|
||||
/* Add the readable event to the handle table. */
|
||||
R_TRY(handle_table.Add(out_event_handle, std::addressof(event->GetReadableEvent())));
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace ams::kern::svc {
|
|||
port->Initialize(max_sessions, false, 0);
|
||||
|
||||
/* Register the port. */
|
||||
R_TRY(KPort::Register(port));
|
||||
KPort::Register(port);
|
||||
|
||||
/* Register the handle in the table. */
|
||||
handle_table.Register(*out_server_handle, std::addressof(port->GetServerPort()));
|
||||
|
@ -95,7 +95,7 @@ namespace ams::kern::svc {
|
|||
};
|
||||
|
||||
/* Register the port. */
|
||||
R_TRY(KPort::Register(port));
|
||||
KPort::Register(port);
|
||||
|
||||
/* Add the client to the handle table. */
|
||||
R_TRY(handle_table.Add(out_client, std::addressof(port->GetClientPort())));
|
||||
|
|
|
@ -230,7 +230,7 @@ namespace ams::kern::svc {
|
|||
R_TRY(process->Initialize(params, user_caps, num_caps, process_resource_limit, pool));
|
||||
|
||||
/* Register the process. */
|
||||
R_TRY(KProcess::Register(process));
|
||||
KProcess::Register(process);
|
||||
|
||||
/* Add the process to the handle table. */
|
||||
R_TRY(handle_table.Add(out, process));
|
||||
|
|
|
@ -78,8 +78,8 @@ namespace ams::kern::svc {
|
|||
/* Initialize the resource limit. */
|
||||
resource_limit->Initialize();
|
||||
|
||||
/* Try to register the limit. */
|
||||
R_TRY(KResourceLimit::Register(resource_limit));
|
||||
/* Register the limit. */
|
||||
KResourceLimit::Register(resource_limit);
|
||||
|
||||
/* Add the limit to the handle table. */
|
||||
R_TRY(GetCurrentProcess().GetHandleTable().Add(out_handle, resource_limit));
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace ams::kern::svc {
|
|||
};
|
||||
|
||||
/* Register the session. */
|
||||
R_TRY(T::Register(session));
|
||||
T::Register(session);
|
||||
|
||||
/* Add the server session to the handle table. */
|
||||
R_TRY(handle_table.Add(out_server, std::addressof(session->GetServerSession())));
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace ams::kern::svc {
|
|||
R_TRY(shmem->Initialize(GetCurrentProcessPointer(), size, owner_perm, remote_perm));
|
||||
|
||||
/* Register the shared memory. */
|
||||
R_TRY(KSharedMemory::Register(shmem));
|
||||
KSharedMemory::Register(shmem);
|
||||
|
||||
/* Add the shared memory to the handle table. */
|
||||
R_TRY(GetCurrentProcess().GetHandleTable().Add(out, shmem));
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace ams::kern::svc {
|
|||
thread->GetContext().CloneFpuStatus();
|
||||
|
||||
/* Register the new thread. */
|
||||
R_TRY(KThread::Register(thread));
|
||||
KThread::Register(thread);
|
||||
|
||||
/* Add the thread to the handle table. */
|
||||
R_TRY(process.GetHandleTable().Add(out, thread));
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace ams::kern::svc {
|
|||
trmem_reservation.Commit();
|
||||
|
||||
/* Register the transfer memory. */
|
||||
R_TRY(KTransferMemory::Register(trmem));
|
||||
KTransferMemory::Register(trmem);
|
||||
|
||||
/* Add the transfer memory to the handle table. */
|
||||
R_TRY(handle_table.Add(out, trmem));
|
||||
|
|
Loading…
Reference in a new issue