aboutsummaryrefslogtreecommitdiff
path: root/stand/common
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2022-12-04 20:52:22 +0000
committerWarner Losh <imp@FreeBSD.org>2022-12-04 20:52:22 +0000
commit9f7269677c5e70283a16887e1e4b4a1ed95a96fb (patch)
tree0f9fe07cbca3e360b0521f36dcef2303ee847212 /stand/common
parent0ea00e71a2734caeb166287873b697d917e5a92d (diff)
kboot: Add md_addr to metadata
Save the address of where the metadata is loaded. Sponsored by: Netflix
Diffstat (limited to 'stand/common')
-rw-r--r--stand/common/bootstrap.h1
-rw-r--r--stand/common/modinfo.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h
index cb1c96dc3b69..bbe97e80323b 100644
--- a/stand/common/bootstrap.h
+++ b/stand/common/bootstrap.h
@@ -201,6 +201,7 @@ struct file_metadata
{
size_t md_size;
uint16_t md_type;
+ vm_offset_t md_addr; /* Valid after copied to kernel space */
struct file_metadata *md_next;
char md_data[1]; /* data are immediately appended */
};
diff --git a/stand/common/modinfo.c b/stand/common/modinfo.c
index 0c00b2070274..381bd9dfd719 100644
--- a/stand/common/modinfo.c
+++ b/stand/common/modinfo.c
@@ -95,8 +95,10 @@
#define MOD_METADATA(a, mm, c) { \
COPY32(MODINFO_METADATA | mm->md_type, a, c);\
COPY32(mm->md_size, a, c); \
- if (c) \
+ if (c) { \
archsw.arch_copyin(mm->md_data, a, mm->md_size);\
+ mm->md_addr = a; \
+ } \
a += MOD_ALIGN(mm->md_size); \
}