i think it works
This commit is contained in:
commit
0e1479b168
167 files changed
+27008
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
// ke_queue.h - fixed-depth message queue
|
||||
// Processes share an address space, so a pointer in Param[] is valid
|
||||
// on both sides. The queue is only a synchronisation and ordering tool.
|
||||
#include "ob_object.h"
|
||||
#include "ke_spinlock.h"
|
||||
#include "ke_list.h"
|
||||
#include "ke_status.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define QUEUE_MESSAGE_SIZE 64 /* bytes, fixed */
|
||||
#define QUEUE_DEPTH 256
|
||||
|
||||
typedef struct QUEUE_MESSAGE {
|
||||
uint32_t Type;
|
||||
uint32_t Flags;
|
||||
uint64_t Param[6]; /* 48 bytes of payload */
|
||||
} QUEUE_MESSAGE; /* total: 64 bytes */
|
||||
|
||||
typedef struct QUEUE {
|
||||
OBJECT Header;
|
||||
SPINLOCK Lock;
|
||||
QUEUE_MESSAGE Ring[QUEUE_DEPTH];
|
||||
uint32_t Head, Tail, Count;
|
||||
LIST_ENTRY SendWaiters;
|
||||
LIST_ENTRY RecvWaiters;
|
||||
} QUEUE;
|
||||
|
||||
KSTATUS QueueCreate(QUEUE **out);
|
||||
KSTATUS KeSendMessage(QUEUE* queue, const QUEUE_MESSAGE* msg, bool blocking);
|
||||
KSTATUS KeReceiveMessage(QUEUE* queue, QUEUE_MESSAGE* msg, bool blocking);
|
||||
Reference in new issue
Block a user