iPXE
Macros | Functions
linux_uaccess.h File Reference

iPXE user access API for Linux More...

Go to the source code of this file.

Macros

#define UACCESS_PREFIX_linux   __linux_
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static __always_inline physaddr_t UACCESS_INLINE (linux, virt_to_phys)(volatile const void *virt)
 Convert virtual address to physical address. More...
 
static __always_inline void * UACCESS_INLINE (linux, phys_to_virt)(physaddr_t phys)
 Convert physical address to virtual address. More...
 

Detailed Description

iPXE user access API for Linux

We have no concept of the underlying physical addresses, since these are not exposed to userspace. We provide a stub implementation of virt_to_phys() since this is required by the heap allocator to determine physical address alignment. We provide a matching stub implementation of phys_to_virt().

Definition in file linux_uaccess.h.

Macro Definition Documentation

◆ UACCESS_PREFIX_linux

#define UACCESS_PREFIX_linux   __linux_

Definition at line 20 of file linux_uaccess.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ UACCESS_INLINE() [1/2]

static __always_inline physaddr_t UACCESS_INLINE ( linux  ,
virt_to_phys   
) const volatile
inlinestatic

Convert virtual address to physical address.

Parameters
virtVirtual address
Return values
physPhysical address

Definition at line 30 of file linux_uaccess.h.

30  {
31 
32  /* We do not know the real underlying physical address. We
33  * provide this stub implementation only because it is
34  * required in order to allocate memory with a specified
35  * physical address alignment. We assume that the low-order
36  * bits of virtual addresses match the low-order bits of
37  * physical addresses, and so simply returning the virtual
38  * address will suffice for the purpose of determining
39  * alignment.
40  */
41  return ( ( physaddr_t ) virt );
42 }
unsigned long physaddr_t
Definition: stdint.h:20

◆ UACCESS_INLINE() [2/2]

static __always_inline void* UACCESS_INLINE ( linux  ,
phys_to_virt   
)
inlinestatic

Convert physical address to virtual address.

Parameters
physPhysical address
Return values
virtVirtual address

Definition at line 51 of file linux_uaccess.h.

51  {
52 
53  /* For symmetry with the stub virt_to_phys() */
54  return ( ( void * ) phys );
55 }
static signed char phys[4]
Definition: epic100.c:88

References phys.