Date: Sun, 27 Apr 2014 15:15:00 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265014 - head/sys/amd64/amd64 Message-ID: <201404271515.s3RFF0OJ097198@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Sun Apr 27 15:14:59 2014 New Revision: 265014 URL: http://svnweb.freebsd.org/changeset/base/265014 Log: Report boot method (BIOS/UEFI) via sysctl machdep.bootmethod Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sun Apr 27 13:10:51 2014 (r265013) +++ head/sys/amd64/amd64/machdep.c Sun Apr 27 15:14:59 2014 (r265014) @@ -1526,6 +1526,10 @@ add_efi_map_entries(struct efi_map_heade } } +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_pad 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)); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404271515.s3RFF0OJ097198>