kboot: Add md_addr to metadata

Save the address of where the metadata is loaded.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2022-12-04 13:52:22 -07:00
parent 0ea00e71a2
commit 9f7269677c
2 changed files with 4 additions and 1 deletions

View File

@ -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 */
};

View File

@ -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); \
}