Clean up PS/2 keyboard driver, new IPC mechanism MBus (message bus)
This commit is contained in:
39
kernel/ipc/mbus/mbus.h
Normal file
39
kernel/ipc/mbus/mbus.h
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef IPC_MBUS_MBUS_H_
|
||||
#define IPC_MBUS_MBUS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "proc/proc.h"
|
||||
#include "rbuf/rbuf.h"
|
||||
|
||||
typedef struct IpcMBusCons {
|
||||
struct IpcMBusCons *next;
|
||||
uint64_t pid;
|
||||
RBuf rbuf;
|
||||
} IpcMBusCons;
|
||||
|
||||
typedef struct {
|
||||
int _hshtbstate;
|
||||
char ident[0x100];
|
||||
SpinLock spinlock;
|
||||
IpcMBusCons *consumers;
|
||||
size_t objsize, objmax;
|
||||
} IpcMBus;
|
||||
|
||||
typedef struct {
|
||||
SpinLock spinlock;
|
||||
IpcMBus mbuses[0x100];
|
||||
} IpcMBuses;
|
||||
|
||||
extern IpcMBuses IPC_MBUSES;
|
||||
|
||||
void ipc_mbusinit(void);
|
||||
IpcMBus *ipc_mbusmake(const char *name, size_t objsize, size_t objmax);
|
||||
int32_t ipc_mbusdelete(const char *name);
|
||||
int32_t ipc_mbuspublish(const char *name, const uint8_t *const buffer);
|
||||
int32_t ipc_mbusconsume(const char *name, uint8_t *const buffer, uint64_t pid);
|
||||
int32_t ipc_mbusattchcons(const char *name, uint64_t pid);
|
||||
int32_t ipc_mbusdttchcons(const char *name, uint64_t pid);
|
||||
void ipc_mbustick(void);
|
||||
|
||||
#endif // IPC_MBUS_MBUS_H_
|
||||
Reference in New Issue
Block a user