summaryrefslogtreecommitdiffstats
path: root/src/include/bits/virt_offset.h
diff options
context:
space:
mode:
authorMichael Brown2025-05-11 14:04:51 +0200
committerMichael Brown2025-05-11 14:46:21 +0200
commit95ede670bcfea5ea22965962fe764841243eb864 (patch)
treeb7a18723d1b1ad6cf034e2478632471d2a9bf258 /src/include/bits/virt_offset.h
parent[fdt] Generalise access to "reg" property (diff)
downloadipxe-95ede670bcfea5ea22965962fe764841243eb864.tar.gz
ipxe-95ede670bcfea5ea22965962fe764841243eb864.tar.xz
ipxe-95ede670bcfea5ea22965962fe764841243eb864.zip
[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>
Diffstat (limited to 'src/include/bits/virt_offset.h')
-rw-r--r--src/include/bits/virt_offset.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/bits/virt_offset.h b/src/include/bits/virt_offset.h
new file mode 100644
index 000000000..5f026284c
--- /dev/null
+++ b/src/include/bits/virt_offset.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_VIRT_OFFSET_H
+#define _BITS_VIRT_OFFSET_H
+
+/** @file
+ *
+ * Dummy architecture-specific virtual address offset
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_VIRT_OFFSET_H */