Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/pipe.h
Show All 18 Lines | |||||
* are met. | * are met. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _SYS_PIPE_H_ | #ifndef _SYS_PIPE_H_ | ||||
#define _SYS_PIPE_H_ | #define _SYS_PIPE_H_ | ||||
#ifndef _KERNEL | |||||
#error "no user-serviceable parts inside" | |||||
#endif | |||||
/* | /* | ||||
* Pipe buffer size, keep moderate in value, pipes take kva space. | * Pipe buffer size, keep moderate in value, pipes take kva space. | ||||
*/ | */ | ||||
#ifndef PIPE_SIZE | #ifndef PIPE_SIZE | ||||
#define PIPE_SIZE 16384 | #define PIPE_SIZE 16384 | ||||
#endif | #endif | ||||
#ifndef BIG_PIPE_SIZE | #ifndef BIG_PIPE_SIZE | ||||
Show All 9 Lines | |||||
* than PIPE_BUF. | * than PIPE_BUF. | ||||
*/ | */ | ||||
#ifndef PIPE_MINDIRECT | #ifndef PIPE_MINDIRECT | ||||
#define PIPE_MINDIRECT 8192 | #define PIPE_MINDIRECT 8192 | ||||
#endif | #endif | ||||
#define PIPENPAGES (BIG_PIPE_SIZE / PAGE_SIZE + 1) | #define PIPENPAGES (BIG_PIPE_SIZE / PAGE_SIZE + 1) | ||||
#ifdef _KERNEL | |||||
/* | /* | ||||
* See sys_pipe.c for info on what these limits mean. | * See sys_pipe.c for info on what these limits mean. | ||||
*/ | */ | ||||
extern long maxpipekva; | extern long maxpipekva; | ||||
extern struct fileops pipeops; | extern struct fileops pipeops; | ||||
#endif | |||||
/* | /* | ||||
* Pipe buffer information. | * Pipe buffer information. | ||||
* Separate in, out, cnt are used to simplify calculations. | * Separate in, out, cnt are used to simplify calculations. | ||||
* Buffered write is active when the buffer.cnt field is set. | * Buffered write is active when the buffer.cnt field is set. | ||||
*/ | */ | ||||
struct pipebuf { | struct pipebuf { | ||||
u_int cnt; /* number of chars currently in buffer */ | u_int cnt; /* number of chars currently in buffer */ | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | struct pipepair { | ||||
struct label *pp_label; | struct label *pp_label; | ||||
}; | }; | ||||
#define PIPE_MTX(pipe) (&(pipe)->pipe_pair->pp_mtx) | #define PIPE_MTX(pipe) (&(pipe)->pipe_pair->pp_mtx) | ||||
#define PIPE_LOCK(pipe) mtx_lock(PIPE_MTX(pipe)) | #define PIPE_LOCK(pipe) mtx_lock(PIPE_MTX(pipe)) | ||||
#define PIPE_UNLOCK(pipe) mtx_unlock(PIPE_MTX(pipe)) | #define PIPE_UNLOCK(pipe) mtx_unlock(PIPE_MTX(pipe)) | ||||
#define PIPE_LOCK_ASSERT(pipe, type) mtx_assert(PIPE_MTX(pipe), (type)) | #define PIPE_LOCK_ASSERT(pipe, type) mtx_assert(PIPE_MTX(pipe), (type)) | ||||
#ifdef _KERNEL | |||||
void pipe_dtor(struct pipe *dpipe); | void pipe_dtor(struct pipe *dpipe); | ||||
int pipe_named_ctor(struct pipe **ppipe, struct thread *td); | int pipe_named_ctor(struct pipe **ppipe, struct thread *td); | ||||
void pipeselwakeup(struct pipe *cpipe); | void pipeselwakeup(struct pipe *cpipe); | ||||
#endif | |||||
#endif /* !_SYS_PIPE_H_ */ | #endif /* !_SYS_PIPE_H_ */ |