[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:13:52 +00:00
parent 36dde9b0bf
commit be1c87b722
48 changed files with 350 additions and 350 deletions
+4 -3
View File
@@ -465,7 +465,8 @@ static int vmxnet3_open ( struct net_device *netdev ) {
int rc;
/* Allocate DMA areas */
vmxnet->dma = malloc_dma ( sizeof ( *vmxnet->dma ), VMXNET3_DMA_ALIGN );
vmxnet->dma = malloc_phys ( sizeof ( *vmxnet->dma ),
VMXNET3_DMA_ALIGN );
if ( ! vmxnet->dma ) {
DBGC ( vmxnet, "VMXNET3 %p could not allocate DMA area\n",
vmxnet );
@@ -542,7 +543,7 @@ static int vmxnet3_open ( struct net_device *netdev ) {
err_activate:
vmxnet3_flush_tx ( netdev );
vmxnet3_flush_rx ( netdev );
free_dma ( vmxnet->dma, sizeof ( *vmxnet->dma ) );
free_phys ( vmxnet->dma, sizeof ( *vmxnet->dma ) );
err_alloc_dma:
return rc;
}
@@ -559,7 +560,7 @@ static void vmxnet3_close ( struct net_device *netdev ) {
vmxnet3_command ( vmxnet, VMXNET3_CMD_RESET_DEV );
vmxnet3_flush_tx ( netdev );
vmxnet3_flush_rx ( netdev );
free_dma ( vmxnet->dma, sizeof ( *vmxnet->dma ) );
free_phys ( vmxnet->dma, sizeof ( *vmxnet->dma ) );
}
/** vmxnet3 net device operations */