22 lines
484 B
C
22 lines
484 B
C
#ifndef IPC_PIPE_PIPE_H_
|
|
#define IPC_PIPE_PIPE_H_
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include "rbuf/rbuf.h"
|
|
#include "spinlock/spinlock.h"
|
|
|
|
#define IPC_PIPE_MAX 0x1000
|
|
|
|
typedef struct {
|
|
RBuf rbuf;
|
|
SpinLock spinlock;
|
|
} IpcPipe;
|
|
|
|
int32_t ipc_pipeinit(IpcPipe *pipe);
|
|
void ipc_pipefree(IpcPipe *pipe);
|
|
int32_t ipc_pipewrite(IpcPipe *pipe, const uint8_t *const buffer, size_t n);
|
|
int32_t ipc_piperead(IpcPipe *pipe, uint8_t *const buffer, size_t n);
|
|
|
|
#endif // IPC_PIPE_PIPE_H_
|