|
iPXE
|
Virtual offset memory model. More...
#include <bits/virt_offset.h>Go to the source code of this file.
Macros | |
| #define | UACCESS_PREFIX_offset __offset_ |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static __always_inline void * | UACCESS_INLINE (offset, phys_to_virt)(unsigned long phys) |
| Allow for architecture-specific overrides of virt_offset. More... | |
| static __always_inline physaddr_t | UACCESS_INLINE (offset, virt_to_phys)(volatile const void *virt) |
| Convert virtual address to physical address. More... | |
Variables | |
| const unsigned long | virt_offset |
| Virtual address offset. More... | |
Virtual offset memory model.
No currently supported machine provides a full 64 bits of physical address space. When we have ownership of the page tables (or segmentation mechanism), we can therefore use the following model:
In both cases, we can define "virt_offset" as "the value to be added to an address within iPXE's own image in order to obtain its physical address". With this definition:
For x86_64-pcbios, we identity-map the low 4GB of address space since the only accesses required above 4GB are for MMIO (typically PCI devices with large memory BARs).
For riscv64-sbi, we identity-map as much of the physical address space as can be mapped by the paging model (Sv39, Sv48, or Sv57) and create a coherent DMA mapping of the low 4GB.
Definition in file virt_offset.h.
| #define UACCESS_PREFIX_offset __offset_ |
Definition at line 54 of file virt_offset.h.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Allow for architecture-specific overrides of virt_offset.
Convert physical address to virtual address
| phys | Physical address |
| virt | Virtual address |
Definition at line 75 of file virt_offset.h.
References phys, and virt_offset.
|
inlinestatic |
Convert virtual address to physical address.
| virt | Virtual address |
| phys | Physical address |
Definition at line 95 of file virt_offset.h.
References addr, and virt_offset.
| const unsigned long virt_offset |
Virtual address offset.
This is defined to be the value to be added to an address within iPXE's own image in order to obtain its physical address, as described above.
Referenced by UACCESS_INLINE().
1.8.15