[zion] Move IPC objects to share code
This commit is contained in:
parent
58df2c0ed2
commit
9dd457391c
14 changed files with 125 additions and 196 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "lib/message_queue.h"
|
||||
#include "lib/mutex.h"
|
||||
#include "object/ipc_object.h"
|
||||
#include "object/kernel_object.h"
|
||||
|
||||
class ReplyPort;
|
||||
|
|
@ -13,21 +14,20 @@ struct KernelObjectTag<ReplyPort> {
|
|||
static const uint64_t type = KernelObject::REPLY_PORT;
|
||||
};
|
||||
|
||||
class ReplyPort : public KernelObject {
|
||||
class ReplyPort : public IpcObject {
|
||||
public:
|
||||
uint64_t TypeTag() override { return KernelObject::REPLY_PORT; }
|
||||
static glcr::RefPtr<ReplyPort> Create();
|
||||
|
||||
uint64_t Write(uint64_t num_bytes, const void* data, uint64_t num_caps,
|
||||
uint64_t* caps);
|
||||
uint64_t Read(uint64_t* num_bytes, void* data, uint64_t* num_caps,
|
||||
uint64_t* caps);
|
||||
virtual MessageQueue& GetSendMessageQueue() override {
|
||||
return message_holder_;
|
||||
}
|
||||
virtual MessageQueue& GetRecvMessageQueue() override {
|
||||
return message_holder_;
|
||||
}
|
||||
|
||||
private:
|
||||
Mutex mutex_{"reply_port"};
|
||||
SingleMessageQueue message_holder_;
|
||||
|
||||
glcr::RefPtr<Thread> blocked_thread_;
|
||||
|
||||
ReplyPort() {}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue