Home | History | Annotate | Download | only in core

Lines Matching refs:iobuf

24 #include <gpxe/iobuf.h>
36 * @ret iobuf I/O buffer, or NULL if none available
42 struct io_buffer *iobuf = NULL;
50 len = ( len + __alignof__( *iobuf ) - 1 ) &
51 ~( __alignof__( *iobuf ) - 1 );
54 data = malloc_dma ( len + sizeof ( *iobuf ), IOB_ALIGN );
58 iobuf = ( struct io_buffer * ) ( data + len );
59 iobuf->head = iobuf->data = iobuf->tail = data;
60 iobuf->end = iobuf;
61 return iobuf;
67 * @v iobuf I/O buffer
69 void free_iob ( struct io_buffer *iobuf ) {
70 if ( iobuf ) {
71 assert ( iobuf->head <= iobuf->data );
72 assert ( iobuf->data <= iobuf->tail );
73 assert ( iobuf->tail <= iobuf->end );
74 free_dma ( iobuf->head,
75 ( iobuf->end - iobuf->head ) + sizeof ( *iobuf ) );
82 * @v iobuf I/O buffer
90 int iob_ensure_headroom ( struct io_buffer *iobuf, size_t len ) {
92 if ( iob_headroom ( iobuf ) >= len )