@ -51,6 +51,8 @@ public:
*/
void ConnectionClosed();
void Finalize() override {}
private:
std::shared_ptr<ServerPort> server_port; ///< ServerPort associated with this client port.
u32 max_sessions = 0; ///< Maximum number of simultaneous sessions the port can have
bool IsSignaled() const override;
static ResultVal<std::shared_ptr<ClientSession>> Create(KernelCore& kernel,
std::shared_ptr<Session> parent,
@ -89,6 +89,10 @@ ResultCode HandleTable::Close(Handle handle) {
const u16 slot = GetSlot(handle);
if (objects[slot].use_count() == 1) {
objects[slot]->Finalize();
}
objects[slot] = nullptr;
generations[slot] = next_free_slot;
@ -61,6 +61,8 @@ public:
bool IsWaitable() const;
virtual void Finalize() = 0;
protected:
/// The kernel instance this object was created under.
KernelCore& kernel;
@ -308,6 +308,8 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////
// Thread-local storage management
@ -47,6 +47,8 @@ public:
explicit ReadableEvent(KernelCore& kernel);
@ -85,6 +85,8 @@ public:
ResultCode SetLimitValue(ResourceType resource, s64 value);
// TODO(Subv): Increment resource limit current values in their respective Kernel::T::Create
// functions
@ -81,6 +81,8 @@ public:
/// ServerSessions waiting to be accepted by the port
std::vector<std::shared_ptr<ServerSession>> pending_sessions;
@ -126,6 +126,8 @@ public:
/// Queues a sync request from the emulated application.
ResultCode QueueSyncRequest(std::shared_ptr<KThread> thread, Core::Memory::Memory& memory);
@ -39,6 +39,8 @@ public:
std::shared_ptr<ClientSession> Client() {
if (auto result{client.lock()}) {
return result;
@ -71,6 +71,8 @@ public:
return device_memory.GetPointer(physical_address + offset);
Core::DeviceMemory& device_memory;
Process* owner_process{};
@ -72,6 +72,8 @@ public:
/// is closed.
ResultCode Reset();
/// The base address for the memory managed by this instance.
VAddr base_address{};
@ -38,8 +38,4 @@ void WritableEvent::Clear() {
readable->Clear();
bool WritableEvent::IsSignaled() const {
return readable->IsSignaled();
} // namespace Kernel
@ -46,7 +46,8 @@ public:
void Signal();
void Clear();
bool IsSignaled() const;
explicit WritableEvent(KernelCore& kernel);