RTEMS CPU Kit with SuperCore
Macros | Functions

FIFO/Pipe Support. More...

#include <sys/param.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <rtems.h>
#include <rtems/libio_.h>
#include <rtems/rtems/barrierimpl.h>
#include <rtems/score/statesimpl.h>
#include "pipe.h"
Include dependency graph for fifo.c:

Macros

#define LIBIO_ACCMODE(_iop)   ((_iop)->flags & LIBIO_FLAGS_READ_WRITE)
 
#define LIBIO_NODELAY(_iop)   ((_iop)->flags & LIBIO_FLAGS_NO_DELAY)
 
#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)
 
#define PIPE_UNLOCK(_pipe)   rtems_semaphore_release(_pipe->Semaphore)
 
#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. 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_LOCK

#define PIPE_LOCK (   _pipe)
Value:
This is the status to indicate successful completion.
Definition: status.h:50
rtems_status_code rtems_semaphore_obtain(rtems_id id, rtems_option option_set, rtems_interval timeout)
RTEMS Obtain Semaphore.
Definition: semobtain.c:34
#define RTEMS_NO_TIMEOUT
Constant for indefinite wait.
Definition: rtems.h:170
#define RTEMS_WAIT
This option constants indicates that the task is to wait on resource.
Definition: options.h:56

◆ PIPE_READWAIT

#define PIPE_READWAIT (   _pipe)
Value:
( rtems_barrier_wait(_pipe->readBarrier, RTEMS_NO_TIMEOUT) \
This is the status to indicate successful completion.
Definition: status.h:50
rtems_status_code rtems_barrier_wait(rtems_id id, rtems_interval timeout)
RTEMS Barrier Wait.
Definition: barrierwait.c:27
#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) \
This is the status to indicate successful completion.
Definition: status.h:50
rtems_status_code rtems_barrier_wait(rtems_id id, rtems_interval timeout)
RTEMS Barrier Wait.
Definition: barrierwait.c:27
#define RTEMS_NO_TIMEOUT
Constant for indefinite wait.
Definition: rtems.h:170