[malloc] Rename malloc_dma() to malloc_phys()
The malloc_dma() function allocates memory with specified physical alignment, and is typically (though not exclusively) used to allocate memory for DMA. Rename to malloc_phys() to more closely match the functionality, and to create name space for functions that specifically allocate and map DMA-capable buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -338,7 +338,7 @@ static int netfront_create_ring ( struct netfront_nic *netfront,
|
||||
ring->id_cons = 0;
|
||||
|
||||
/* Allocate and initialise shared ring */
|
||||
ring->sring.raw = malloc_dma ( PAGE_SIZE, PAGE_SIZE );
|
||||
ring->sring.raw = malloc_phys ( PAGE_SIZE, PAGE_SIZE );
|
||||
if ( ! ring->sring.raw ) {
|
||||
rc = -ENOMEM;
|
||||
goto err_alloc;
|
||||
@@ -368,7 +368,7 @@ static int netfront_create_ring ( struct netfront_nic *netfront,
|
||||
err_write_num:
|
||||
xengrant_invalidate ( xen, ring->ref );
|
||||
err_permit_access:
|
||||
free_dma ( ring->sring.raw, PAGE_SIZE );
|
||||
free_phys ( ring->sring.raw, PAGE_SIZE );
|
||||
err_alloc:
|
||||
return rc;
|
||||
}
|
||||
@@ -490,7 +490,7 @@ static void netfront_destroy_ring ( struct netfront_nic *netfront,
|
||||
xengrant_invalidate ( xen, ring->ref );
|
||||
|
||||
/* Free page */
|
||||
free_dma ( ring->sring.raw, PAGE_SIZE );
|
||||
free_phys ( ring->sring.raw, PAGE_SIZE );
|
||||
ring->sring.raw = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user