aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2014-04-27 15:14:59 +0000
committerEd Maste <emaste@FreeBSD.org>2014-04-27 15:14:59 +0000
commitb6a0a32b5841a6947dd4698e9d89110eda010a50 (patch)
treeb5deedeb76dc48ec3cbff277cd4806de334c2e7b /sys/amd64
parent8376edae84ecef921c235a8dcb934de5098b92b4 (diff)
downloadsrc-b6a0a32b5841a6947dd4698e9d89110eda010a50.tar.gz
src-b6a0a32b5841a6947dd4698e9d89110eda010a50.zip
Report boot method (BIOS/UEFI) via sysctl machdep.bootmethod
Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=265014
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/machdep.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 9675a045cce6..cc2b581b6249 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1526,6 +1526,10 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
}
}
+static char bootmethod[16] = "";
+SYSCTL_STRING(_machdep, OID_AUTO, bootmethod, CTLFLAG_RD, bootmethod, 0,
+ "System firmware boot method");
+
static void
native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx)
{
@@ -1550,9 +1554,11 @@ native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx)
if (efihdr != NULL) {
add_efi_map_entries(efihdr, physmap, physmap_idx);
+ strlcpy(bootmethod, "UEFI", sizeof(bootmethod));
} else {
size = *((u_int32_t *)smap - 1);
bios_add_smap_entries(smap, size, physmap, physmap_idx);
+ strlcpy(bootmethod, "BIOS", sizeof(bootmethod));
}
}