mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-09 06:19:19 +00:00
Updated IPC
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include <filesystem.hpp>
|
||||
#include <vector.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <atomic.hpp>
|
||||
#include <lock.hpp>
|
||||
|
||||
namespace InterProcessCommunication
|
||||
@ -27,7 +28,7 @@ namespace InterProcessCommunication
|
||||
IPCSuccess,
|
||||
IPCNotListening,
|
||||
IPCTimeout,
|
||||
IPCInvalidPort,
|
||||
IPCInvalidCommand,
|
||||
IPCAlreadyAllocated,
|
||||
IPCNotAllocated,
|
||||
IPCIDInUse,
|
||||
@ -38,11 +39,10 @@ namespace InterProcessCommunication
|
||||
struct IPCHandle
|
||||
{
|
||||
IPCID ID;
|
||||
long Length;
|
||||
uint8_t *Buffer;
|
||||
bool Listening;
|
||||
VirtualFileSystem::Node *Node;
|
||||
IPCErrorCode Error;
|
||||
void *Buffer;
|
||||
long Length;
|
||||
Atomic<bool> Listening;
|
||||
};
|
||||
|
||||
class IPC
|
||||
@ -56,18 +56,19 @@ namespace InterProcessCommunication
|
||||
void *Process;
|
||||
|
||||
public:
|
||||
IPC(void *Process);
|
||||
~IPC();
|
||||
|
||||
int HandleSyscall(long Command, long Type, int ID, int Flags, void *Buffer, size_t Size);
|
||||
IPCHandle *Create(IPCType Type, char UniqueToken[16]);
|
||||
IPCErrorCode Destroy(IPCID ID);
|
||||
IPCErrorCode Read(IPCID ID, uint8_t *Buffer, long Size);
|
||||
IPCErrorCode Write(IPCID ID, uint8_t *Buffer, long Size);
|
||||
IPCErrorCode Listen(IPCID ID);
|
||||
IPCHandle *Wait(IPCID ID);
|
||||
IPCErrorCode Allocate(IPCID ID, long Size);
|
||||
IPCErrorCode Deallocate(IPCID ID);
|
||||
IPCErrorCode Read(IPCID ID, void *Buffer, long Size);
|
||||
IPCErrorCode Write(IPCID ID, void *Buffer, long Size);
|
||||
IPCErrorCode Listen(IPCID ID, bool Listen);
|
||||
IPCErrorCode Wait(IPCID ID);
|
||||
IPCHandle *SearchByToken(char UniqueToken[16]);
|
||||
int HandleSyscall(long Command, long Type, int ID, int Flags, void *Buffer, size_t Size);
|
||||
|
||||
IPC(void *Process);
|
||||
~IPC();
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user