diff options
author | Liam <byteslice@airmail.cc> | 2023-03-07 02:34:25 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-13 03:06:53 +0100 |
commit | 097c25b164ba830b8d4a89926a3e90d297d06d8f (patch) | |
tree | 646caab83e97e60249ed102596a968be10acfec8 /src/core/hle/kernel/k_port.cpp | |
parent | kernel: convert GlobalSchedulerContext, KAddressArbiter, KScopedSchedulerLockAndSleep, KThreadQueue to new style (diff) | |
download | yuzu-097c25b164ba830b8d4a89926a3e90d297d06d8f.tar yuzu-097c25b164ba830b8d4a89926a3e90d297d06d8f.tar.gz yuzu-097c25b164ba830b8d4a89926a3e90d297d06d8f.tar.bz2 yuzu-097c25b164ba830b8d4a89926a3e90d297d06d8f.tar.lz yuzu-097c25b164ba830b8d4a89926a3e90d297d06d8f.tar.xz yuzu-097c25b164ba830b8d4a89926a3e90d297d06d8f.tar.zst yuzu-097c25b164ba830b8d4a89926a3e90d297d06d8f.zip |
Diffstat (limited to 'src/core/hle/kernel/k_port.cpp')
-rw-r--r-- | src/core/hle/kernel/k_port.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/core/hle/kernel/k_port.cpp b/src/core/hle/kernel/k_port.cpp index 0a45ffd57..f73bc34d4 100644 --- a/src/core/hle/kernel/k_port.cpp +++ b/src/core/hle/kernel/k_port.cpp @@ -8,55 +8,54 @@ namespace Kernel { KPort::KPort(KernelCore& kernel_) - : KAutoObjectWithSlabHeapAndContainer{kernel_}, server{kernel_}, client{kernel_} {} + : KAutoObjectWithSlabHeapAndContainer{kernel_}, m_server{kernel_}, m_client{kernel_} {} KPort::~KPort() = default; -void KPort::Initialize(s32 max_sessions_, bool is_light_, const std::string& name_) { +void KPort::Initialize(s32 max_sessions, bool is_light, uintptr_t name) { // Open a new reference count to the initialized port. - Open(); + this->Open(); // Create and initialize our server/client pair. - KAutoObject::Create(std::addressof(server)); - KAutoObject::Create(std::addressof(client)); - server.Initialize(this, name_ + ":Server"); - client.Initialize(this, max_sessions_, name_ + ":Client"); + KAutoObject::Create(std::addressof(m_server)); + KAutoObject::Create(std::addressof(m_client)); + m_server.Initialize(this); + m_client.Initialize(this, max_sessions); // Set our member variables. - is_light = is_light_; - name = name_; - state = State::Normal; + m_is_light = is_light; + m_name = name; + m_state = State::Normal; } void KPort::OnClientClosed() { KScopedSchedulerLock sl{kernel}; - if (state == State::Normal) { - state = State::ClientClosed; + if (m_state == State::Normal) { + m_state = State::ClientClosed; } } void KPort::OnServerClosed() { KScopedSchedulerLock sl{kernel}; - if (state == State::Normal) { - state = State::ServerClosed; + if (m_state == State::Normal) { + m_state = State::ServerClosed; } } bool KPort::IsServerClosed() const { KScopedSchedulerLock sl{kernel}; - return state == State::ServerClosed; + return m_state == State::ServerClosed; } Result KPort::EnqueueSession(KServerSession* session) { KScopedSchedulerLock sl{kernel}; - R_UNLESS(state == State::Normal, ResultPortClosed); + R_UNLESS(m_state == State::Normal, ResultPortClosed); - server.EnqueueSession(session); - - return ResultSuccess; + m_server.EnqueueSession(session); + R_SUCCEED(); } } // namespace Kernel |