MOS Source Code
Loading...
Searching...
No Matches
pipe.cpp File Reference
#include "mos/ipc/pipe.hpp"
#include "mos/platform/platform.hpp"
#include "mos/tasks/schedule.hpp"
#include "mos/tasks/signal.hpp"
#include "mos/tasks/wait.hpp"
#include <climits>
#include <mos/lib/sync/spinlock.hpp>
#include <mos_stdlib.hpp>
+ Include dependency graph for pipe.cpp:

Go to the source code of this file.

Macros

#define PIPE_MAGIC   MOS_FOURCC('P', 'I', 'P', 'E')
 
#define advance_buffer(buffer, bytes)
 

Functions

size_t pipe_write (pipe_t *p, const void *buf, size_t size)
 
size_t pipe_read (pipe_t *p, void *buf, size_t size)
 
bool pipe_close_one_end (pipe_t *pipe)
 Close one end of the pipe, so that the other end will get EOF.
 
PtrResult< pipe_tpipe_create (size_t bufsize)
 
pipeio_tpipeio_create (pipe_t *pipe)
 

Macro Definition Documentation

◆ PIPE_MAGIC

#define PIPE_MAGIC   MOS_FOURCC('P', 'I', 'P', 'E')

Definition at line 16 of file pipe.cpp.

Referenced by pipe_close_one_end(), pipe_create(), pipe_read(), and pipe_write().

◆ advance_buffer

#define advance_buffer ( buffer,
bytes )
Value:
((buffer) = (void *) ((char *) (buffer) + (bytes)))
static char buffer[2048]

Definition at line 18 of file pipe.cpp.

Referenced by pipe_read(), and pipe_write().

Function Documentation

◆ pipe_write()

size_t pipe_write ( pipe_t * p,
const void * buf,
size_t size )

Definition at line 20 of file pipe.cpp.

Referenced by ipc_client_write(), ipc_server_write(), and PipeIOImpl::on_write().

+ Here is the call graph for this function:

◆ pipe_read()

size_t pipe_read ( pipe_t * p,
void * buf,
size_t size )

Definition at line 80 of file pipe.cpp.

Referenced by ipc_client_read(), ipc_server_read(), and PipeIOImpl::on_read().

+ Here is the call graph for this function:

◆ pipe_close_one_end()

bool pipe_close_one_end ( pipe_t * pipe)

Close one end of the pipe, so that the other end will get EOF.

Note
The other end should also call this function to get the pipe correctly freed.
Parameters
pipeThe pipe to close one end of.
Returns
true if the pipe was fully closed, false if the other end is still open.

Definition at line 134 of file pipe.cpp.

Referenced by ipc_client_close_channel(), ipc_server_close_channel(), and PipeIOImpl::on_closed().

+ Here is the call graph for this function:

◆ pipe_create()

PtrResult< pipe_t > pipe_create ( size_t bufsize)

Definition at line 165 of file pipe.cpp.

Referenced by ipc_server_accept(), and MOS_STATIC_ASSERT().

+ Here is the call graph for this function:

◆ pipeio_create()

pipeio_t * pipeio_create ( pipe_t * pipe)

Definition at line 213 of file pipe.cpp.

Referenced by MOS_STATIC_ASSERT().

+ Here is the call graph for this function: