iPXE
Macros | Functions | Variables
efi_uaccess.h File Reference

iPXE user access API for EFI More...

Go to the source code of this file.

Macros

#define UACCESS_PREFIX_efi   __efi_
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static __always_inline userptr_t UACCESS_INLINE (efi, phys_to_user)(unsigned long phys_addr)
 Convert physical address to user pointer. More...
 
static __always_inline unsigned long UACCESS_INLINE (efi, user_to_phys)(userptr_t userptr
 Convert user buffer to physical address. More...
 
static __always_inline userptr_t UACCESS_INLINE (efi, virt_to_user)(volatile const void *addr)
 
static __always_inline void * UACCESS_INLINE (efi, user_to_virt)(userptr_t userptr
 
static __always_inline userptr_t UACCESS_INLINE (efi, userptr_add)(userptr_t userptr
 
static __always_inline off_t UACCESS_INLINE (efi, userptr_sub)(userptr_t userptr
 
static __always_inline void UACCESS_INLINE (efi, memcpy_user)(userptr_t dest
 
static __always_inline void UACCESS_INLINE (efi, memmove_user)(userptr_t dest
 
static __always_inline int UACCESS_INLINE (efi, memcmp_user)(userptr_t first
 
static __always_inline void UACCESS_INLINE (efi, memset_user)(userptr_t buffer
 
static __always_inline size_t UACCESS_INLINE (efi, strlen_user)(userptr_t buffer
 
static __always_inline off_t UACCESS_INLINE (efi, memchr_user)(userptr_t buffer
 

Variables

static __always_inline unsigned long off_t offset
 
static __always_inline off_t userptr_t subtrahend
 
static __always_inline void off_t dest_off
 
static __always_inline void off_t userptr_t src
 
static __always_inline void off_t userptr_t off_t src_off
 
static __always_inline void off_t userptr_t off_t size_t len
 
static __always_inline int off_t first_off
 
static __always_inline int off_t userptr_t second
 
static __always_inline int off_t userptr_t off_t second_off
 
static __always_inline void off_t int c
 

Detailed Description

iPXE user access API for EFI

EFI runs with flat physical addressing, so the various mappings between virtual addresses, I/O addresses and bus addresses are all no-ops.

Definition in file efi_uaccess.h.

Macro Definition Documentation

◆ UACCESS_PREFIX_efi

#define UACCESS_PREFIX_efi   __efi_

Definition at line 18 of file efi_uaccess.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ UACCESS_INLINE() [1/12]

static __always_inline userptr_t UACCESS_INLINE ( efi  ,
phys_to_user   
)
inlinestatic

Convert physical address to user pointer.

Parameters
phys_addrPhysical address
Return values
userptrUser pointer

Definition at line 28 of file efi_uaccess.h.

28  {
29  return phys_addr;
30 }

◆ UACCESS_INLINE() [2/12]

static __always_inline unsigned long UACCESS_INLINE ( efi  ,
user_to_phys   
)
inlinestatic

Convert user buffer to physical address.

Parameters
userptrUser pointer
offsetOffset from user pointer
Return values
phys_addrPhysical address

◆ UACCESS_INLINE() [3/12]

static __always_inline userptr_t UACCESS_INLINE ( efi  ,
virt_to_user   
) const volatile
inlinestatic

Definition at line 45 of file efi_uaccess.h.

45  {
46  return trivial_virt_to_user ( addr );
47 }
u32 addr
Definition: sky2.h:8
static __always_inline userptr_t trivial_virt_to_user(volatile const void *addr)
Convert virtual address to user pointer.
Definition: uaccess.h:55

References addr, and trivial_virt_to_user().

◆ UACCESS_INLINE() [4/12]

static __always_inline void* UACCESS_INLINE ( efi  ,
user_to_virt   
)
inlinestatic

◆ UACCESS_INLINE() [5/12]

static __always_inline userptr_t UACCESS_INLINE ( efi  ,
userptr_add   
)
inlinestatic

◆ UACCESS_INLINE() [6/12]

static __always_inline off_t UACCESS_INLINE ( efi  ,
userptr_sub   
)
inlinestatic

◆ UACCESS_INLINE() [7/12]

static __always_inline void UACCESS_INLINE ( efi  ,
memcpy_user   
)
inlinestatic

◆ UACCESS_INLINE() [8/12]

static __always_inline void UACCESS_INLINE ( efi  ,
memmove_user   
)
inlinestatic

◆ UACCESS_INLINE() [9/12]

static __always_inline int UACCESS_INLINE ( efi  ,
memcmp_user   
)
inlinestatic

◆ UACCESS_INLINE() [10/12]

static __always_inline void UACCESS_INLINE ( efi  ,
memset_user   
)
inlinestatic

◆ UACCESS_INLINE() [11/12]

static __always_inline size_t UACCESS_INLINE ( efi  ,
strlen_user   
)
inlinestatic

◆ UACCESS_INLINE() [12/12]

static __always_inline off_t UACCESS_INLINE ( efi  ,
memchr_user   
)
inlinestatic

Variable Documentation

◆ offset

Initial value:
{
return ( userptr + offset )
static __always_inline unsigned long off_t offset
Definition: efi_uaccess.h:40

Definition at line 40 of file efi_uaccess.h.

◆ subtrahend

Initial value:
{
return trivial_userptr_sub ( userptr, subtrahend )
static __always_inline off_t userptr_t subtrahend
Definition: efi_uaccess.h:61
static __always_inline off_t trivial_userptr_sub(userptr_t userptr, userptr_t subtrahend)
Subtract user pointers.
Definition: uaccess.h:93

Definition at line 61 of file efi_uaccess.h.

Referenced by bigint_subtract_sample(), and trivial_userptr_sub().

◆ dest_off

static __always_inline void off_t dest_off

◆ src

static __always_inline void off_t userptr_t src

◆ src_off

static __always_inline void off_t userptr_t off_t src_off

◆ len

Initial value:
{
static __always_inline void off_t userptr_t off_t src_off
Definition: efi_uaccess.h:66
static __always_inline void off_t dest_off
Definition: efi_uaccess.h:66
static __always_inline void off_t userptr_t off_t size_t len
Definition: efi_uaccess.h:68
static void * dest
Definition: strings.h:176
static __always_inline void off_t userptr_t src
Definition: efi_uaccess.h:66
static __always_inline void trivial_memcpy_user(userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, size_t len)
Copy data between user buffers.
Definition: uaccess.h:107

Definition at line 68 of file efi_uaccess.h.

◆ first_off

__always_inline int off_t first_off

Definition at line 80 of file efi_uaccess.h.

Referenced by trivial_memcmp_user().

◆ second

◆ second_off

Definition at line 80 of file efi_uaccess.h.

Referenced by trivial_memcmp_user().

◆ c

static __always_inline off_t off_t int c