mirror of
https://github.com/ipxe/ipxe
synced 2025-12-15 09:04:37 +03:00
[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:
@@ -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",
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user