[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>
This commit is contained in:
Michael Brown
2025-04-21 16:16:01 +01:00
parent 4535548cba
commit 8c31270a21
48 changed files with 211 additions and 235 deletions

View File

@@ -50,7 +50,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*/
static int elf_load_segment ( struct image *image, Elf_Phdr *phdr,
physaddr_t dest ) {
userptr_t buffer = phys_to_user ( dest );
userptr_t buffer = phys_to_virt ( dest );
int rc;
DBGC ( image, "ELF %p loading segment [%x,%x) to [%lx,%lx,%lx)\n",

View File

@@ -59,9 +59,9 @@ struct errortab segment_errors[] __errortab = {
*/
int prep_segment ( userptr_t segment, size_t filesz, size_t memsz ) {
struct memory_map memmap;
physaddr_t start = user_to_phys ( segment, 0 );
physaddr_t mid = user_to_phys ( segment, filesz );
physaddr_t end = user_to_phys ( segment, memsz );
physaddr_t start = virt_to_phys ( segment );
physaddr_t mid = ( start + filesz );
physaddr_t end = ( start + memsz );
unsigned int i;
DBG ( "Preparing segment [%lx,%lx,%lx)\n", start, mid, end );