[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
+8 -8
View File
@@ -669,8 +669,8 @@ static int qib7322_init_send ( struct qib7322 *qib7322 ) {
}
/* Allocate space for the SendBufAvail array */
qib7322->sendbufavail = malloc_dma ( sizeof ( *qib7322->sendbufavail ),
QIB7322_SENDBUFAVAIL_ALIGN );
qib7322->sendbufavail = malloc_phys ( sizeof ( *qib7322->sendbufavail ),
QIB7322_SENDBUFAVAIL_ALIGN );
if ( ! qib7322->sendbufavail ) {
rc = -ENOMEM;
goto err_alloc_sendbufavail;
@@ -697,7 +697,7 @@ static int qib7322_init_send ( struct qib7322 *qib7322 ) {
return 0;
free_dma ( qib7322->sendbufavail, sizeof ( *qib7322->sendbufavail ) );
free_phys ( qib7322->sendbufavail, sizeof ( *qib7322->sendbufavail ) );
err_alloc_sendbufavail:
qib7322_destroy_send_bufs ( qib7322, qib7322->send_bufs_vl15_port1 );
err_create_send_bufs_vl15_port1:
@@ -724,7 +724,7 @@ static void qib7322_fini_send ( struct qib7322 *qib7322 ) {
/* Ensure hardware has seen this disable */
qib7322_readq ( qib7322, &sendctrl, QIB_7322_SendCtrl_offset );
free_dma ( qib7322->sendbufavail, sizeof ( *qib7322->sendbufavail ) );
free_phys ( qib7322->sendbufavail, sizeof ( *qib7322->sendbufavail ) );
qib7322_destroy_send_bufs ( qib7322, qib7322->send_bufs_vl15_port1 );
qib7322_destroy_send_bufs ( qib7322, qib7322->send_bufs_vl15_port0 );
qib7322_destroy_send_bufs ( qib7322, qib7322->send_bufs_small );
@@ -767,8 +767,8 @@ static int qib7322_create_recv_wq ( struct ib_device *ibdev,
qib7322_wq->eager_cons = 0;
/* Allocate receive header buffer */
qib7322_wq->header = malloc_dma ( QIB7322_RECV_HEADERS_SIZE,
QIB7322_RECV_HEADERS_ALIGN );
qib7322_wq->header = malloc_phys ( QIB7322_RECV_HEADERS_SIZE,
QIB7322_RECV_HEADERS_ALIGN );
if ( ! qib7322_wq->header ) {
rc = -ENOMEM;
goto err_alloc_header;
@@ -810,7 +810,7 @@ static int qib7322_create_recv_wq ( struct ib_device *ibdev,
virt_to_bus ( &qib7322_wq->header_prod ) );
return 0;
free_dma ( qib7322_wq->header, QIB7322_RECV_HEADERS_SIZE );
free_phys ( qib7322_wq->header, QIB7322_RECV_HEADERS_SIZE );
err_alloc_header:
return rc;
}
@@ -846,7 +846,7 @@ static void qib7322_destroy_recv_wq ( struct ib_device *ibdev,
mb();
/* Free headers ring */
free_dma ( qib7322_wq->header, QIB7322_RECV_HEADERS_SIZE );
free_phys ( qib7322_wq->header, QIB7322_RECV_HEADERS_SIZE );
}
/**