RTEMS  5.0.0
Macros | Functions

FIFO/Pipe Support. More...

#include <sys/param.h>
#include <sys/filio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <rtems.h>
#include <rtems/libio_.h>
#include <rtems/pipe.h>
#include <rtems/rtems/barrierimpl.h>
#include <rtems/score/statesimpl.h>

Macros

#define LIBIO_ACCMODE(_iop)   (rtems_libio_iop_flags(_iop) & LIBIO_FLAGS_READ_WRITE)
 
#define LIBIO_NODELAY(_iop)   rtems_libio_iop_is_no_delay(_iop)
 
#define PIPE_EMPTY(_pipe)   (_pipe->Length == 0)
 
#define PIPE_FULL(_pipe)   (_pipe->Length == _pipe->Size)
 
#define PIPE_SPACE(_pipe)   (_pipe->Size - _pipe->Length)
 
#define PIPE_WSTART(_pipe)   ((_pipe->Start + _pipe->Length) % _pipe->Size)
 
#define PIPE_LOCK(_pipe)   rtems_mutex_lock(&(_pipe)->Mutex)
 
#define PIPE_UNLOCK(_pipe)   rtems_mutex_unlock(&(_pipe)->Mutex)
 
#define PIPE_READWAIT(_pipe)
 
#define PIPE_WRITEWAIT(_pipe)
 
#define PIPE_WAKEUPREADERS(_pipe)   do {uint32_t n; rtems_barrier_release(_pipe->readBarrier, &n); } while(0)
 
#define PIPE_WAKEUPWRITERS(_pipe)   do {uint32_t n; rtems_barrier_release(_pipe->writeBarrier, &n); } while(0)
 

Functions

void pipe_release (pipe_control_t **pipep, rtems_libio_t *iop)
 Release a pipe. More...
 
int fifo_open (pipe_control_t **pipep, rtems_libio_t *iop)
 File system open. Interface to file system open. More...
 
ssize_t pipe_read (pipe_control_t *pipe, void *buffer, size_t count, rtems_libio_t *iop)
 File system read. More...
 
ssize_t pipe_write (pipe_control_t *pipe, const void *buffer, size_t count, rtems_libio_t *iop)
 File system write. More...
 
int pipe_ioctl (pipe_control_t *pipe, ioctl_command_t cmd, void *buffer, rtems_libio_t *iop)
 File system Input/Output control. More...
 

Detailed Description

FIFO/Pipe Support.

Macro Definition Documentation

◆ PIPE_READWAIT

#define PIPE_READWAIT (   _pipe)
Value:
( rtems_barrier_wait(_pipe->readBarrier, RTEMS_NO_TIMEOUT) \
Definition: status.h:47
rtems_status_code rtems_barrier_wait(rtems_id id, rtems_interval timeout)
RTEMS Barrier Wait.
Definition: barrierwait.c:30
#define RTEMS_NO_TIMEOUT
Constant for indefinite wait.
Definition: rtems.h:170

◆ PIPE_WRITEWAIT

#define PIPE_WRITEWAIT (   _pipe)
Value:
( rtems_barrier_wait(_pipe->writeBarrier, RTEMS_NO_TIMEOUT) \
Definition: status.h:47
rtems_status_code rtems_barrier_wait(rtems_id id, rtems_interval timeout)
RTEMS Barrier Wait.
Definition: barrierwait.c:30
#define RTEMS_NO_TIMEOUT
Constant for indefinite wait.
Definition: rtems.h:170