kboot: bi_loadsmap for amd64
Copy the EFI memory tables we were able to get into the MODINFOMD_SMAP metadata area for the kernel. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D38254
This commit is contained in:
parent
6e99dc1375
commit
b6755eabcc
@ -160,3 +160,22 @@ kboot_get_phys_load_segment(void)
|
||||
}
|
||||
return (base_seg);
|
||||
}
|
||||
|
||||
void
|
||||
bi_loadsmap(struct preloaded_file *kfp)
|
||||
{
|
||||
struct bios_smap smap[32], *sm;
|
||||
struct memory_segments *s;
|
||||
int smapnum, len;
|
||||
|
||||
for (smapnum = 0; smapnum < min(32, nr_seg); smapnum++) {
|
||||
sm = &smap[smapnum];
|
||||
s = &segs[smapnum];
|
||||
sm->base = s->start;
|
||||
sm->length = s->end - s->start + 1;
|
||||
sm->type = SMAP_TYPE_MEMORY;
|
||||
}
|
||||
|
||||
len = smapnum * sizeof(struct bios_smap);
|
||||
file_addmetadata(kfp, MODINFOMD_SMAP, len, &smap[0]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user