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

MFC after:	1 week
This commit is contained in:
John Baldwin
2006-09-28 19:07:13 +00:00
parent 64786948cc
commit c4f7c44bb3
2 changed files with 22 additions and 0 deletions
+15
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);
}
+7
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.
################################################################################