Changeset 666 for trunk/kernel/libk/remote_buf.h
- Timestamp:
- Oct 10, 2020, 5:27:12 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_buf.h
r657 r666 32 32 * This structure and the associated access functions define a remotely accessible, 33 33 * kernel buffer, handled as a single-reader & single-writer FIFO. 34 * Each buffer slot contains one byte, and the number of slots is dynamically35 * d efined by an argument of the "remote_buf_create()" function.36 * The "put()" and "get()" access functions defined below move another buffer,37 * (can be in kernel or in user space) to/from this circular kernel buffer.34 * This kernel buffer is implementes as an array of bytes, whose size is 35 * dynamically defined by an argument of the "remote_buf_init()" function. 36 * The "put()" and "get()" functions defined below move the content of another 37 * buffer (can be in kernel or in user space) to/from this circular kernel buffer. 38 38 * This structure is NOT protected by a lock, as the only shared variable is the 39 * "sts" variable, that is updated by hal_remote_atomic_add() access primitives.40 * It is used by to implement the socket receive buffer.39 * "sts" variable, that is updated by the hal_remote_atomic_add() primitive. 40 * It is used to implement the three socket buffers (rx_buf / r2tq / crqq). 41 41 * - the "ptw" field defines the first empty slot (for write). 42 42 * - the "ptr" field defines the first non empty slot (for read). … … 58 58 * argument. It allocates memory for the data, as defined by the <size> argument, 59 59 * and initializes the buffer as empty. It must be called by a local thread. 60 * No memory is allocated if <size> value is 0. 60 61 ************************************************************************************ 61 62 * @ buf_xp : [in] extended pointer on buffer descriptor. 62 * @ size : [in] number of bytes in buffer .63 * @ return 0 if success / return -1 if failure (no memory).63 * @ size : [in] number of bytes in buffer / no memory allocated when null. 64 * @ return 0 if success / return -1 if memory failure. 64 65 ***********************************************************************************/ 65 error_t remote_buf_ create( xptr_t buf_xp,66 66 error_t remote_buf_init( xptr_t buf_xp, 67 uint32_t size ); 67 68 68 69 /************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.