diff options
| author | Michael Brown | 2025-04-21 17:16:01 +0200 |
|---|---|---|
| committer | Michael Brown | 2025-04-21 17:17:19 +0200 |
| commit | 8c31270a21a85cc87bce0e07e19e2041d2510a4c (patch) | |
| tree | 66255f4f34f30650bf2dbda212e551104fbd9ef0 /src/interface/efi/efi_umalloc.c | |
| parent | [uaccess] Remove redundant user_to_virt() (diff) | |
| download | ipxe-8c31270a21a85cc87bce0e07e19e2041d2510a4c.tar.gz ipxe-8c31270a21a85cc87bce0e07e19e2041d2510a4c.tar.xz ipxe-8c31270a21a85cc87bce0e07e19e2041d2510a4c.zip | |
[uaccess] Remove user_to_phys() and phys_to_user()
Remove the intermediate concept of a user pointer from physical
address conversions, leaving virt_to_phys() and phys_to_virt() as the
directly implemented functions.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_umalloc.c')
| -rw-r--r-- | src/interface/efi/efi_umalloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interface/efi/efi_umalloc.c b/src/interface/efi/efi_umalloc.c index 488c53f3d..0636cb7fd 100644 --- a/src/interface/efi/efi_umalloc.c +++ b/src/interface/efi/efi_umalloc.c @@ -72,7 +72,7 @@ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) { return UNULL; } assert ( phys_addr != 0 ); - new_ptr = phys_to_user ( phys_addr + EFI_PAGE_SIZE ); + new_ptr = phys_to_virt ( phys_addr + EFI_PAGE_SIZE ); copy_to_user ( new_ptr, -EFI_PAGE_SIZE, &new_size, sizeof ( new_size ) ); DBG ( "EFI allocated %d pages at %llx\n", @@ -90,7 +90,7 @@ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) { memcpy ( new_ptr, old_ptr, ( (old_size < new_size) ? old_size : new_size ) ); old_pages = ( EFI_SIZE_TO_PAGES ( old_size ) + 1 ); - phys_addr = user_to_phys ( old_ptr, -EFI_PAGE_SIZE ); + phys_addr = virt_to_phys ( old_ptr - EFI_PAGE_SIZE ); if ( ( efirc = bs->FreePages ( phys_addr, old_pages ) ) != 0 ){ rc = -EEFI ( efirc ); DBG ( "EFI could not free %d pages at %llx: %s\n", |
