Add an 'smap' command that dumps out the BIOS SMAP.
MFC after: 1 week
This commit is contained in:
parent
1817594458
commit
7a85c13bc9
@ -95,6 +95,7 @@ bios_getsmap(void)
|
||||
break;
|
||||
} while (v86.ebx != 0 && smaplen < n);
|
||||
}
|
||||
|
||||
void
|
||||
bios_addsmapdata(struct preloaded_file *kfp)
|
||||
{
|
||||
@ -105,3 +106,17 @@ bios_addsmapdata(struct preloaded_file *kfp)
|
||||
len = smaplen * sizeof(*smapbase);
|
||||
file_addmetadata(kfp, MODINFOMD_SMAP, len, smapbase);
|
||||
}
|
||||
|
||||
COMMAND_SET(smap, "smap", "show BIOS SMAP", command_smap);
|
||||
|
||||
static int
|
||||
command_smap(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
if (smapbase == 0 || smaplen == 0)
|
||||
return;
|
||||
for (i = 0; i < smaplen; i++)
|
||||
printf("SMAP type=%02x base=%016llx len=%016llx\n",
|
||||
smapbase[i].type, smapbase[i].base, smapbase[i].length);
|
||||
}
|
||||
|
@ -54,3 +54,10 @@
|
||||
forced by setting this variable.
|
||||
|
||||
################################################################################
|
||||
# Tsmap DDisplay BIOS SMAP table
|
||||
|
||||
smap
|
||||
|
||||
Displays the BIOS SMAP (system memory map) table.
|
||||
|
||||
################################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user