mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 14:05:17 -04:00
kern: add SvcCreatePort, SvcConnectToPort
This commit is contained in:
parent
9f79710cb7
commit
93be2ffcba
10 changed files with 338 additions and 11 deletions
|
@ -50,6 +50,7 @@ namespace ams::kern {
|
|||
|
||||
/* TODO: More of KClientPort. */
|
||||
Result CreateSession(KClientSession **out);
|
||||
Result CreateLightSession(KLightClientSession **out);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -29,13 +29,12 @@ namespace ams::kern {
|
|||
constexpr KClientSession() : parent() { /* ... */ }
|
||||
virtual ~KClientSession() { /* ... */ }
|
||||
|
||||
virtual void Destroy() override;
|
||||
|
||||
void Initialize(KSession *parent) {
|
||||
/* Set member variables. */
|
||||
this->parent = parent;
|
||||
}
|
||||
|
||||
virtual void Destroy() override;
|
||||
static void PostDestroy(uintptr_t arg) { /* ... */ }
|
||||
|
||||
constexpr KSession *GetParent() const { return this->parent; }
|
||||
|
|
|
@ -34,11 +34,14 @@ namespace ams::kern {
|
|||
this->parent = parent;
|
||||
}
|
||||
|
||||
virtual void Destroy() override;
|
||||
static void PostDestroy(uintptr_t arg) { /* ... */ }
|
||||
|
||||
constexpr const KLightSession *GetParent() const { return this->parent; }
|
||||
|
||||
/* TODO: More of KLightClientSession. */
|
||||
Result SendSyncRequest(u32 *data);
|
||||
|
||||
void OnServerClosed();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -35,13 +35,22 @@ namespace ams::kern {
|
|||
constexpr KLightServerSession() : parent(), request_queue(), server_queue(), current_request(), server_thread() { /* ... */ }
|
||||
virtual ~KLightServerSession() { /* ... */ }
|
||||
|
||||
void Initialize(KLightSession *parent);
|
||||
void Initialize(KLightSession *parent) {
|
||||
/* Set member variables. */
|
||||
this->parent = parent;
|
||||
}
|
||||
|
||||
virtual void Destroy() override;
|
||||
static void PostDestroy(uintptr_t arg) { /* ... */ }
|
||||
|
||||
constexpr const KLightSession *GetParent() const { return this->parent; }
|
||||
|
||||
/* TODO: More of KLightServerSession. */
|
||||
Result OnRequest(KThread *request_thread);
|
||||
Result ReplyAndReceive(u32 *data);
|
||||
|
||||
void OnClientClosed();
|
||||
private:
|
||||
void CleanupRequests();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -51,12 +51,21 @@ namespace ams::kern {
|
|||
|
||||
virtual ~KLightSession() { /* ... */ }
|
||||
|
||||
void Initialize(KClientPort *client_port, uintptr_t name);
|
||||
virtual void Finalize() override;
|
||||
|
||||
virtual bool IsInitialized() const override { return this->initialized; }
|
||||
virtual uintptr_t GetPostDestroyArgument() const override { return reinterpret_cast<uintptr_t>(this->process); }
|
||||
|
||||
static void PostDestroy(uintptr_t arg);
|
||||
|
||||
/* TODO: This is a placeholder definition. */
|
||||
void OnServerClosed();
|
||||
void OnClientClosed();
|
||||
|
||||
bool IsServerClosed() const { return this->state != State::Normal; }
|
||||
bool IsClientClosed() const { return this->state != State::Normal; }
|
||||
|
||||
Result OnRequest(KThread *request_thread) { return this->server.OnRequest(request_thread); }
|
||||
|
||||
KLightClientSession &GetClientSession() { return this->client; }
|
||||
KLightServerSession &GetServerSession() { return this->server; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue