From owner-svn-src-head@freebsd.org Fri Mar 3 20:22:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05120CF714C; Fri, 3 Mar 2017 20:22:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A94841CBE; Fri, 3 Mar 2017 20:22:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23KMlvO063022; Fri, 3 Mar 2017 20:22:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23KMlgN063020; Fri, 3 Mar 2017 20:22:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703032022.v23KMlgN063020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 Mar 2017 20:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314615 - head/lib/libefivar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 20:22:49 -0000 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 #include +#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 */