svn commit: r314615 - head/lib/libefivar

Warner Losh imp at FreeBSD.org
Fri Mar 3 20:22:49 UTC 2017


Author: imp
Date: Fri Mar  3 20:22:47 2017
New Revision: 314615
URL: https://svnweb.freebsd.org/changeset/base/314615

Log:
  Move uuid_table definition to efivar.h.
  Create new function efi_known_guid() to return list of guids.
  
  Sponsored by: Netflix

Modified:
  head/lib/libefivar/efivar.c
  head/lib/libefivar/efivar.h

Modified: head/lib/libefivar/efivar.c
==============================================================================
--- head/lib/libefivar/efivar.c	Fri Mar  3 20:22:42 2017	(r314614)
+++ head/lib/libefivar/efivar.c	Fri Mar  3 20:22:47 2017	(r314615)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include <stdlib.h>
 #include <string.h>
 
+#include "efivar.h"
 #include "libefivar_int.h"
 
 static int efi_fd = -2;
@@ -44,12 +45,7 @@ static int efi_fd = -2;
 
 const efi_guid_t efi_guid_empty = Z;
 
-static struct uuid_table
-{
-	const char *uuid_str;
-	const char *name;
-	efi_guid_t guid;
-} guid_tbl [] =
+static struct uuid_table guid_tbl [] =
 {
 	{ "00000000-0000-0000-0000-000000000000", "zero", Z },
 	{ "093e0fae-a6c4-4f50-9f1b-d41e2b89c19a", "sha512", Z },
@@ -103,6 +99,14 @@ efi_guid_tbl_compile(void)
 	}
 }
 
+int
+efi_known_guid(struct uuid_table **tbl)
+{
+
+	*tbl = guid_tbl;
+	return (nitems(guid_tbl));
+}
+
 static int
 efi_open_dev(void)
 {

Modified: head/lib/libefivar/efivar.h
==============================================================================
--- head/lib/libefivar/efivar.h	Fri Mar  3 20:22:42 2017	(r314614)
+++ head/lib/libefivar/efivar.h	Fri Mar  3 20:22:47 2017	(r314615)
@@ -83,6 +83,16 @@ int efi_set_variable(efi_guid_t guid, co
 int efi_str_to_guid(const char *s, efi_guid_t *guid);
 int efi_variables_supported(void);
 
+/* FreeBSD extensions */
+struct uuid_table
+{
+	const char *uuid_str;
+	const char *name;
+	efi_guid_t guid;
+};
+
+int efi_known_guid(struct uuid_table **);
+
 extern const efi_guid_t efi_guid_empty;
 
 /* Stubs that are expected, but aren't really used */


More information about the svn-src-all mailing list