svn commit: r265014 - head/sys/amd64/amd64

Ed Maste emaste at FreeBSD.org
Sun Apr 27 15:15:00 UTC 2014


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


More information about the svn-src-all mailing list