diff options
author | emaste <emaste@FreeBSD.org> | 2014-04-27 15:14:59 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-04-27 15:14:59 +0000 |
commit | a864055badcada3890596517162b15398bd5c1c3 (patch) | |
tree | b5deedeb76dc48ec3cbff277cd4806de334c2e7b | |
parent | 9e36487c1922c7d545207751a3bd968ac36564d4 (diff) | |
download | FreeBSD-src-a864055badcada3890596517162b15398bd5c1c3.zip FreeBSD-src-a864055badcada3890596517162b15398bd5c1c3.tar.gz |
Report boot method (BIOS/UEFI) via sysctl machdep.bootmethod
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | sys/amd64/amd64/machdep.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 9675a04..cc2b581 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)); } } |