[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:
Michael Brown
2020-11-05 19:08:48 +00:00
parent 36dde9b0bf
commit be1c87b722
48 changed files with 350 additions and 350 deletions

View File

@@ -434,7 +434,7 @@ int vmbus_open ( struct vmbus_device *vmdev,
len = ( sizeof ( *vmdev->out ) + out_len +
sizeof ( *vmdev->in ) + in_len );
assert ( ( len % PAGE_SIZE ) == 0 );
ring = malloc_dma ( len, PAGE_SIZE );
ring = malloc_phys ( len, PAGE_SIZE );
if ( ! ring ) {
rc = -ENOMEM;
goto err_alloc_ring;
@@ -509,7 +509,7 @@ int vmbus_open ( struct vmbus_device *vmdev,
err_post_message:
vmbus_gpadl_teardown ( vmdev, vmdev->gpadl );
err_establish:
free_dma ( ring, len );
free_phys ( ring, len );
err_alloc_ring:
free ( packet );
err_alloc_packet:
@@ -555,7 +555,7 @@ void vmbus_close ( struct vmbus_device *vmdev ) {
/* Free ring buffer */
len = ( sizeof ( *vmdev->out ) + vmdev->out_len +
sizeof ( *vmdev->in ) + vmdev->in_len );
free_dma ( vmdev->out, len );
free_phys ( vmdev->out, len );
vmdev->out = NULL;
vmdev->in = NULL;