mirror of
https://github.com/ipxe/ipxe
synced 2026-02-04 15:09:29 +03:00
[riscv] Hold virtual address offset in the thread pointer register
iPXE does not make use of any thread-local storage. Use the otherwise
unused thread pointer register ("tp") to hold the current value of
the virtual address offset, rather than using a global variable.
This ensures that virt_offset can be made valid even during very early
initialisation (when iPXE may be executing directly from read-only
memory and so cannot update a global variable).
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -34,3 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
/* Flat address space user access API */
|
||||
PROVIDE_UACCESS_INLINE ( flat, phys_to_virt );
|
||||
PROVIDE_UACCESS_INLINE ( flat, virt_to_phys );
|
||||
|
||||
/* Virtual address offset user access API */
|
||||
PROVIDE_UACCESS_INLINE ( offset, phys_to_virt );
|
||||
PROVIDE_UACCESS_INLINE ( offset, virt_to_phys );
|
||||
|
||||
Reference in New Issue
Block a user