mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
kboot: Add md_addr to metadata
Save the address of where the metadata is loaded. Sponsored by: Netflix
This commit is contained in:
parent
0ea00e71a2
commit
9f7269677c
|
@ -201,6 +201,7 @@ struct file_metadata
|
||||||
{
|
{
|
||||||
size_t md_size;
|
size_t md_size;
|
||||||
uint16_t md_type;
|
uint16_t md_type;
|
||||||
|
vm_offset_t md_addr; /* Valid after copied to kernel space */
|
||||||
struct file_metadata *md_next;
|
struct file_metadata *md_next;
|
||||||
char md_data[1]; /* data are immediately appended */
|
char md_data[1]; /* data are immediately appended */
|
||||||
};
|
};
|
||||||
|
|
|
@ -95,8 +95,10 @@
|
||||||
#define MOD_METADATA(a, mm, c) { \
|
#define MOD_METADATA(a, mm, c) { \
|
||||||
COPY32(MODINFO_METADATA | mm->md_type, a, c);\
|
COPY32(MODINFO_METADATA | mm->md_type, a, c);\
|
||||||
COPY32(mm->md_size, a, c); \
|
COPY32(mm->md_size, a, c); \
|
||||||
if (c) \
|
if (c) { \
|
||||||
archsw.arch_copyin(mm->md_data, a, mm->md_size);\
|
archsw.arch_copyin(mm->md_data, a, mm->md_size);\
|
||||||
|
mm->md_addr = a; \
|
||||||
|
} \
|
||||||
a += MOD_ALIGN(mm->md_size); \
|
a += MOD_ALIGN(mm->md_size); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue