Add an 'smap' command that dumps out the BIOS SMAP.

MFC after:	1 week
This commit is contained in:
jhb 2006-09-28 19:07:13 +00:00
parent 1817594458
commit 7a85c13bc9
2 changed files with 22 additions and 0 deletions

View File

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

View File

@ -54,3 +54,10 @@
forced by setting this variable.
################################################################################
# Tsmap DDisplay BIOS SMAP table
smap
Displays the BIOS SMAP (system memory map) table.
################################################################################