aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-11-05 19:08:48 +0000
committerMichael Brown <mcb30@ipxe.org>2020-11-05 19:13:52 +0000
commitbe1c87b72237f633c4f4b05bcb133acf2967d788 (patch)
treeadc9bc36da62d55f0f1f5708af7c66d1cc3af949 /src/arch/x86
parent36dde9b0bf27ae411af677ca1fa3075113133cfe (diff)
downloadipxe-be1c87b72237f633c4f4b05bcb133acf2967d788.zip
ipxe-be1c87b72237f633c4f4b05bcb133acf2967d788.tar.gz
ipxe-be1c87b72237f633c4f4b05bcb133acf2967d788.tar.bz2
[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>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/drivers/hyperv/hyperv.c12
-rw-r--r--src/arch/x86/drivers/xen/hvm.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/arch/x86/drivers/hyperv/hyperv.c b/src/arch/x86/drivers/hyperv/hyperv.c
index 1903d1d..9d3a42d 100644
--- a/src/arch/x86/drivers/hyperv/hyperv.c
+++ b/src/arch/x86/drivers/hyperv/hyperv.c
@@ -83,7 +83,7 @@ hv_alloc_pages ( struct hv_hypervisor *hv, ... ) {
/* Allocate and zero pages */
va_start ( args, hv );
for ( i = 0 ; ( ( page = va_arg ( args, void ** ) ) != NULL ); i++ ) {
- *page = malloc_dma ( PAGE_SIZE, PAGE_SIZE );
+ *page = malloc_phys ( PAGE_SIZE, PAGE_SIZE );
if ( ! *page )
goto err_alloc;
memset ( *page, 0, PAGE_SIZE );
@@ -97,7 +97,7 @@ hv_alloc_pages ( struct hv_hypervisor *hv, ... ) {
va_start ( args, hv );
for ( ; i >= 0 ; i-- ) {
page = va_arg ( args, void ** );
- free_dma ( *page, PAGE_SIZE );
+ free_phys ( *page, PAGE_SIZE );
}
va_end ( args );
return -ENOMEM;
@@ -116,7 +116,7 @@ hv_free_pages ( struct hv_hypervisor *hv, ... ) {
va_start ( args, hv );
while ( ( page = va_arg ( args, void * ) ) != NULL )
- free_dma ( page, PAGE_SIZE );
+ free_phys ( page, PAGE_SIZE );
va_end ( args );
}
@@ -131,8 +131,8 @@ static int hv_alloc_message ( struct hv_hypervisor *hv ) {
/* Allocate buffer. Must be aligned to at least 8 bytes and
* must not cross a page boundary, so align on its own size.
*/
- hv->message = malloc_dma ( sizeof ( *hv->message ),
- sizeof ( *hv->message ) );
+ hv->message = malloc_phys ( sizeof ( *hv->message ),
+ sizeof ( *hv->message ) );
if ( ! hv->message )
return -ENOMEM;
@@ -147,7 +147,7 @@ static int hv_alloc_message ( struct hv_hypervisor *hv ) {
static void hv_free_message ( struct hv_hypervisor *hv ) {
/* Free buffer */
- free_dma ( hv->message, sizeof ( *hv->message ) );
+ free_phys ( hv->message, sizeof ( *hv->message ) );
}
/**
diff --git a/src/arch/x86/drivers/xen/hvm.c b/src/arch/x86/drivers/xen/hvm.c
index 311f343..b77cdd1 100644
--- a/src/arch/x86/drivers/xen/hvm.c
+++ b/src/arch/x86/drivers/xen/hvm.c
@@ -106,7 +106,7 @@ static int hvm_map_hypercall ( struct hvm_device *hvm ) {
/* Allocate pages */
hvm->hypercall_len = ( pages * PAGE_SIZE );
- hvm->xen.hypercall = malloc_dma ( hvm->hypercall_len, PAGE_SIZE );
+ hvm->xen.hypercall = malloc_phys ( hvm->hypercall_len, PAGE_SIZE );
if ( ! hvm->xen.hypercall ) {
DBGC ( hvm, "HVM could not allocate %d hypercall page(s)\n",
pages );
@@ -141,7 +141,7 @@ static int hvm_map_hypercall ( struct hvm_device *hvm ) {
static void hvm_unmap_hypercall ( struct hvm_device *hvm ) {
/* Free pages */
- free_dma ( hvm->xen.hypercall, hvm->hypercall_len );
+ free_phys ( hvm->xen.hypercall, hvm->hypercall_len );
}
/**