]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[riscv] Hold virtual address offset in the thread pointer register
authorMichael Brown <mcb30@ipxe.org>
Sun, 11 May 2025 12:04:51 +0000 (13:04 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 11 May 2025 12:46:21 +0000 (13:46 +0100)
commit95ede670bcfea5ea22965962fe764841243eb864
treeb7a18723d1b1ad6cf034e2478632471d2a9bf258
parentf988ec09e01b54d21d1b1fa0e2b3121d926ed7df
[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>
src/arch/riscv/include/bits/virt_offset.h [new file with mode: 0644]
src/arch/riscv/prefix/libprefix.S
src/arch/riscv/prefix/sbiprefix.S
src/core/fdt.c
src/core/uaccess.c
src/core/virt_offset.c [deleted file]
src/include/bits/virt_offset.h [new file with mode: 0644]
src/include/ipxe/virt_offset.h