kernel: pipes: add pipe flush routines
Adds two routines to flush pipe objects: k_pipe_flush() - This routine flushes the entire pipe. That includes both the pipe's buffer and all pended writers. It is equivalent to reading everything into a giant temporary buffer which is then discarded. k_pipe_buffer_flush() - This routine flushes only the pipe's buffer (if it exists). It is equivalent to reading a maximum of "buffer size" bytes into a temporary buffer which is then discarded. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
parent
da7fbad057
commit
d1353a4584
7 changed files with 193 additions and 30 deletions
|
@ -345,6 +345,15 @@
|
|||
#define sys_port_trace_k_pipe_alloc_init_enter(pipe) sys_trace_k_pipe_alloc_init_enter(pipe, size)
|
||||
#define sys_port_trace_k_pipe_alloc_init_exit(pipe, ret) \
|
||||
sys_trace_k_pipe_alloc_init_exit(pipe, size, ret)
|
||||
#define sys_port_trace_k_pipe_flush_enter(pipe) \
|
||||
sys_trace_k_pipe_flush_enter(pipe)
|
||||
#define sys_port_trace_k_pipe_flush_exit(pipe) \
|
||||
sys_trace_k_pipe_flush_exit(pipe)
|
||||
#define sys_port_trace_k_pipe_buffer_flush_enter(pipe) \
|
||||
sys_trace_k_pipe_buffer_flush_enter(pipe)
|
||||
#define sys_port_trace_k_pipe_buffer_flush_exit(pipe) \
|
||||
sys_trace_k_pipe_buffer_flush_exit(pipe)
|
||||
|
||||
#define sys_port_trace_k_pipe_put_enter(pipe, timeout) \
|
||||
sys_trace_k_pipe_put_enter(pipe, data, bytes_to_write, bytes_written, min_xfer, timeout)
|
||||
#define sys_port_trace_k_pipe_put_blocking(pipe, timeout) \
|
||||
|
@ -607,6 +616,10 @@ void sys_trace_k_pipe_cleanup_enter(struct k_pipe *pipe);
|
|||
void sys_trace_k_pipe_cleanup_exit(struct k_pipe *pipe, int ret);
|
||||
void sys_trace_k_pipe_alloc_init_enter(struct k_pipe *pipe, size_t size);
|
||||
void sys_trace_k_pipe_alloc_init_exit(struct k_pipe *pipe, size_t size, int ret);
|
||||
void sys_trace_k_pipe_flush_enter(struct k_pipe *pipe);
|
||||
void sys_trace_k_pipe_flush_exit(struct k_pipe *pipe);
|
||||
void sys_trace_k_pipe_buffer_flush_enter(struct k_pipe *pipe);
|
||||
void sys_trace_k_pipe_buffer_flush_exit(struct k_pipe *pipe);
|
||||
void sys_trace_k_pipe_put_enter(struct k_pipe *pipe, void *data, size_t bytes_to_write,
|
||||
size_t *bytes_written, size_t min_xfer, k_timeout_t timeout);
|
||||
void sys_trace_k_pipe_put_blocking(struct k_pipe *pipe, void *data, size_t bytes_to_write,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue