summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/dma.h11
-rw-r--r--src/include/ipxe/iobuf.h2
2 files changed, 9 insertions, 4 deletions
diff --git a/src/include/ipxe/dma.h b/src/include/ipxe/dma.h
index b675df212..a6e41c1ab 100644
--- a/src/include/ipxe/dma.h
+++ b/src/include/ipxe/dma.h
@@ -74,8 +74,10 @@ struct dma_operations {
*
* @v dma DMA device
* @v map DMA mapping
+ * @v len Used length
*/
- void ( * unmap ) ( struct dma_device *dma, struct dma_mapping *map );
+ void ( * unmap ) ( struct dma_device *dma, struct dma_mapping *map,
+ size_t len );
/**
* Allocate and map DMA-coherent buffer
*
@@ -194,9 +196,11 @@ DMAAPI_INLINE ( flat, dma_map ) ( struct dma_device *dma,
* Unmap buffer
*
* @v map DMA mapping
+ * @v len Used length
*/
static inline __always_inline void
-DMAAPI_INLINE ( flat, dma_unmap ) ( struct dma_mapping *map ) {
+DMAAPI_INLINE ( flat, dma_unmap ) ( struct dma_mapping *map,
+ size_t len __unused ) {
/* Decrement mapping count (for debugging) */
if ( DBG_LOG ) {
@@ -365,8 +369,9 @@ int dma_map ( struct dma_device *dma, struct dma_mapping *map,
* Unmap buffer
*
* @v map DMA mapping
+ * @v len Used length
*/
-void dma_unmap ( struct dma_mapping *map );
+void dma_unmap ( struct dma_mapping *map, size_t len );
/**
* Allocate and map DMA-coherent buffer
diff --git a/src/include/ipxe/iobuf.h b/src/include/ipxe/iobuf.h
index df8d0b854..46b350458 100644
--- a/src/include/ipxe/iobuf.h
+++ b/src/include/ipxe/iobuf.h
@@ -276,7 +276,7 @@ static inline __always_inline physaddr_t iob_dma ( struct io_buffer *iobuf ) {
* @ret rc Return status code
*/
static inline __always_inline void iob_unmap ( struct io_buffer *iobuf ) {
- dma_unmap ( &iobuf->map );
+ dma_unmap ( &iobuf->map, iob_len ( iobuf ) );
}
extern struct io_buffer * __malloc alloc_iob_raw ( size_t len, size_t align,