user_to_phys ( address, ( offset + initrd->len ) ),
( filename ? " " : "" ), ( filename ? filename : "" ) );
DBGC2_MD5A ( image, user_to_phys ( address, offset ),
- user_to_virt ( address, offset ), initrd->len );
+ ( address + offset ), initrd->len );
}
len += initrd->len;
( initrd->cmdline ? " " : "" ),
( initrd->cmdline ? initrd->cmdline : "" ) );
DBGC2_MD5A ( image, user_to_phys ( initrd->data, 0 ),
- user_to_virt ( initrd->data, 0 ), initrd->len );
+ initrd->data, initrd->len );
}
/* Calculate lowest usable address */
initrd->name, user_to_phys ( initrd->data, 0 ),
user_to_phys ( initrd->data, initrd->len ) );
DBGC2_MD5A ( &images, user_to_phys ( initrd->data, 0 ),
- user_to_virt ( initrd->data, 0 ), initrd->len );
+ initrd->data, initrd->len );
}
}
return trivial_virt_to_user ( addr );
}
-static inline __always_inline void *
-UACCESS_INLINE ( librm, user_to_virt ) ( userptr_t userptr, off_t offset ) {
- return trivial_user_to_virt ( userptr, offset );
-}
-
static inline __always_inline off_t
UACCESS_INLINE ( librm, memchr_user ) ( userptr_t buffer, off_t offset,
int c, size_t len ) {
PROVIDE_UACCESS_INLINE ( librm, phys_to_user );
PROVIDE_UACCESS_INLINE ( librm, user_to_phys );
PROVIDE_UACCESS_INLINE ( librm, virt_to_user );
-PROVIDE_UACCESS_INLINE ( librm, user_to_virt );
PROVIDE_UACCESS_INLINE ( librm, memchr_user );
PROVIDE_IOMAP_INLINE ( pages, io_to_bus );
PROVIDE_IOMAP ( pages, ioremap, ioremap_pages );
int rc;
/* Parse image */
- if ( ( rc = fdt_parse ( fdt, user_to_virt ( image->data, 0 ),
- image->len ) ) != 0 ) {
+ if ( ( rc = fdt_parse ( fdt, image->data, image->len ) ) != 0 ) {
DBGC ( fdt, "FDT image \"%s\" is invalid: %s\n",
image->name, strerror ( rc ) );
return rc;
assert ( len >= fdt->used );
/* Attempt reallocation */
- new = user_to_virt ( urealloc ( virt_to_user ( fdt->raw ), len ), 0 );
+ new = urealloc ( virt_to_user ( fdt->raw ), len );
if ( ! new ) {
DBGC ( fdt, "FDT could not reallocate from +%#04zx to "
"+%#04zx\n", fdt->len, len );
}
/* Create modifiable copy */
- copy = user_to_virt ( umalloc ( fdt.len ), 0 );
+ copy = umalloc ( fdt.len );
if ( ! copy ) {
rc = -ENOMEM;
goto err_alloc;
PROVIDE_UACCESS_INLINE ( flat, phys_to_user );
PROVIDE_UACCESS_INLINE ( flat, user_to_phys );
PROVIDE_UACCESS_INLINE ( flat, virt_to_user );
-PROVIDE_UACCESS_INLINE ( flat, user_to_virt );
PROVIDE_UACCESS_INLINE ( flat, memchr_user );
/* Attempt loading image */
handle = NULL;
if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, path,
- user_to_virt ( exec->data, 0 ),
- exec->len, &handle ) ) != 0 ) {
+ exec->data, exec->len,
+ &handle ) ) != 0 ) {
/* Not an EFI image */
rc = -EEFI_LOAD ( efirc );
DBGC ( image, "EFIIMAGE %s could not load: %s\n",
/* Attempt loading image */
handle = NULL;
if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, &empty_path,
- user_to_virt ( image->data, 0 ),
- image->len, &handle ) ) != 0 ) {
+ image->data, image->len,
+ &handle ) ) != 0 ) {
/* Not an EFI image */
rc = -EEFI_LOAD ( efirc );
DBGC ( image, "EFIIMAGE %s could not load: %s\n",
return trivial_virt_to_user ( addr );
}
-static inline __always_inline void *
-UACCESS_INLINE ( linux, user_to_virt ) ( userptr_t userptr, off_t offset ) {
- return trivial_user_to_virt ( userptr, offset );
-}
-
static inline __always_inline off_t
UACCESS_INLINE ( linux, memchr_user ) ( userptr_t buffer, off_t offset,
int c, size_t len ) {
return ( ( userptr_t ) addr );
}
-/**
- * Convert user pointer to virtual address
- *
- * @v userptr User pointer
- * @v offset Offset from user pointer
- * @ret addr Virtual address
- *
- * This operation is not available under all memory models.
- */
-static inline __always_inline void *
-trivial_user_to_virt ( userptr_t userptr, off_t offset ) {
- return ( ( void * ) userptr + offset );
-}
-
/**
* Find character in user buffer
*
return trivial_virt_to_user ( addr );
}
-static inline __always_inline void *
-UACCESS_INLINE ( flat, user_to_virt ) ( userptr_t userptr, off_t offset ) {
- return trivial_user_to_virt ( userptr, offset );
-}
-
static inline __always_inline off_t
UACCESS_INLINE ( flat, memchr_user ) ( userptr_t buffer, off_t offset,
int c, size_t len ) {
*/
userptr_t virt_to_user ( volatile const void *addr );
-/**
- * Convert user pointer to virtual address
- *
- * @v userptr User pointer
- * @v offset Offset from user pointer
- * @ret addr Virtual address
- *
- * This operation is not available under all memory models.
- */
-void * user_to_virt ( userptr_t userptr, off_t offset );
-
/**
* Convert virtual address to a physical address
*
* This operation is not available under all memory models.
*/
static inline __always_inline void * phys_to_virt ( unsigned long phys_addr ) {
- return user_to_virt ( phys_to_user ( phys_addr ), 0 );
+ return ( phys_to_user ( phys_addr ) );
}
/**
static void efipci_dma_ufree ( struct dma_device *dma, struct dma_mapping *map,
userptr_t addr, size_t len ) {
- efipci_dma_free ( dma, map, user_to_virt ( addr, 0 ), len );
+ efipci_dma_free ( dma, map, addr, len );
}
/**
filename, strerror ( rc ) );
goto err_read;
}
- header = user_to_virt ( table->data, 0 );
+ header = table->data;
if ( ( ( ( size_t ) len ) < sizeof ( *header ) ) ||
( ( ( size_t ) len ) < le32_to_cpu ( header->length ) ) ) {
rc = -ENOENT;
smbios_entry_filename, strerror ( rc ) );
goto err_entry;
}
- data = user_to_virt ( entry, 0 );
+ data = entry;
smbios3_entry = data;
smbios_entry = data;
if ( ( len >= ( ( int ) sizeof ( *smbios3_entry ) ) ) &&
*data = tmp;
/* Read from file */
- read = linux_read ( fd, user_to_virt ( *data, len ),
- LINUX_SYSFS_BLKSIZE );
+ read = linux_read ( fd, ( *data + len ), LINUX_SYSFS_BLKSIZE );
if ( read == 0 )
break;
if ( read < 0 ) {
PROVIDE_UACCESS_INLINE(linux, user_to_phys);
PROVIDE_UACCESS_INLINE(linux, virt_to_user);
-PROVIDE_UACCESS_INLINE(linux, user_to_virt);
PROVIDE_UACCESS_INLINE(linux, memchr_user);