152467047SWarner Losh.\" 2d49a5dddSWarner Losh.\" Copyright 2016 Netflix, Inc. 3d49a5dddSWarner Losh.\" All rights reserved. 4d49a5dddSWarner Losh.\" 5d49a5dddSWarner Losh.\" Redistribution and use in source and binary forms, with or without 6d49a5dddSWarner Losh.\" modification, are permitted provided that the following conditions 7d49a5dddSWarner Losh.\" are met: 8d49a5dddSWarner Losh.\" 1. Redistributions of source code must retain the above copyright 9d49a5dddSWarner Losh.\" notice, this list of conditions and the following disclaimer. 10d49a5dddSWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright 11d49a5dddSWarner Losh.\" notice, this list of conditions and the following disclaimer in the 12d49a5dddSWarner Losh.\" documentation and/or other materials provided with the distribution. 13d49a5dddSWarner Losh.\" 14d49a5dddSWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15d49a5dddSWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16d49a5dddSWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17d49a5dddSWarner Losh.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18d49a5dddSWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19d49a5dddSWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20d49a5dddSWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21d49a5dddSWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22d49a5dddSWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23d49a5dddSWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24d49a5dddSWarner Losh.\" SUCH DAMAGE. 25d49a5dddSWarner Losh.\" 264026e1ccSMateusz Piotrowski.Dd October 25, 2018 27d49a5dddSWarner Losh.Dt LIBEFIVAR 3 28d49a5dddSWarner Losh.Os 29d49a5dddSWarner Losh.Sh NAME 30d49a5dddSWarner Losh.Nm libefivar 314026e1ccSMateusz Piotrowski.Nd EFI Non Volatile Variable Support 32d49a5dddSWarner Losh.Sh SYNOPSIS 33d49a5dddSWarner Losh.In efivar.h 34d49a5dddSWarner Losh.Ft int 35d49a5dddSWarner Losh.Fn efi_append_variable "efi_guid_t guid" "const char *name" "void *data" "size_t data_size" "uint32_t attributes" 36d49a5dddSWarner Losh.Ft int 37d49a5dddSWarner Losh.Fn efi_del_variable "efi_guid_t guid" "const char *name" 38d49a5dddSWarner Losh.Ft int 39d49a5dddSWarner Losh.Fn efi_get_variable "efi_guid_t guid" "const char *name" "void **data" "ssize_t *data_size" "uint32_t *attributes" 40d49a5dddSWarner Losh.Ft int 41d49a5dddSWarner Losh.Fn efi_get_variable_attributes "efi_guid_t guid" "const char *name" "uint32_t *attributes" 42d49a5dddSWarner Losh.Ft int 43d49a5dddSWarner Losh.Fn efi_get_variable_size "efi_guid_t guid" "const char *name" "size_t *size" 44d49a5dddSWarner Losh.Ft int 45d49a5dddSWarner Losh.Fn efi_get_next_variable_name "efi_guid_t **guid" "char **name" 46d49a5dddSWarner Losh.Ft int 47d49a5dddSWarner Losh.Fn efi_guid_to_name "efi_guid_t *guid" "char **name" 48d49a5dddSWarner Losh.Ft int 49d49a5dddSWarner Losh.Fn efi_guid_to_symbol "efi_guid_t *guid" "char **symbol" 50d49a5dddSWarner Losh.Ft int 51d49a5dddSWarner Losh.Fn efi_guid_to_str "const efi_guid_t *guid" "char **sp" 52d49a5dddSWarner Losh.Ft int 53d49a5dddSWarner Losh.Fn efi_name_to_guid "const char *name" "efi_guid_t *guid" 54d49a5dddSWarner Losh.Ft int 55d49a5dddSWarner Losh.Fn efi_set_variable "efi_guid_t guid" "const char *name" "void *data" "size_t data_size" "uint32_t attributes" 56d49a5dddSWarner Losh.Ft int 574026e1ccSMateusz Piotrowski.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid" 58d49a5dddSWarner Losh.Ft int 594026e1ccSMateusz Piotrowski.Fn efi_variables_supported "void" 60d49a5dddSWarner Losh.Sh DESCRIPTION 61d49a5dddSWarner LoshThe 62d49a5dddSWarner Losh.Nm 63d49a5dddSWarner Loshlibrary implements access to EFI Variables via the EFI Runtime 644026e1ccSMateusz PiotrowskiServices. 654026e1ccSMateusz PiotrowskiAll 664026e1ccSMateusz Piotrowski.Vt "char *" 674026e1ccSMateusz Piotrowskistrings are converted to 16-bit UTF strings before passing 68d49a5dddSWarner Loshthem to EFI. 69d49a5dddSWarner Losh.Pp 70d49a5dddSWarner Losh.Fn efi_variables_supported 71d49a5dddSWarner Loshreturns non-zero if the current machine supports setting of EFI firmware 72d49a5dddSWarner Loshvariables and the kernel support for doing so is present. 73d49a5dddSWarner LoshOtherwise zero is returned. 74d49a5dddSWarner Losh.Pp 75d49a5dddSWarner Losh.Fn efi_del_variable 76d49a5dddSWarner Loshdeletes the EFI variable selected by 774026e1ccSMateusz Piotrowski.Va guid 78d49a5dddSWarner Loshand 794026e1ccSMateusz Piotrowski.Va name . 80d49a5dddSWarner Losh.Pp 814026e1ccSMateusz PiotrowskiThe following functions have not been implemented yet: 824026e1ccSMateusz Piotrowski.Bl -dash -offset indent -compact 834026e1ccSMateusz Piotrowski.It 84d49a5dddSWarner Losh.Fn efi_append_variable 854026e1ccSMateusz Piotrowski.It 86d49a5dddSWarner Losh.Fn efi_get_next_variable_name 874026e1ccSMateusz Piotrowski.It 884026e1ccSMateusz Piotrowski.Fn efi_get_variable 894026e1ccSMateusz Piotrowski.It 904026e1ccSMateusz Piotrowski.Fn efi_get_variable_attributes 914026e1ccSMateusz Piotrowski.It 924026e1ccSMateusz Piotrowski.Fn efi_get_variable_size 934026e1ccSMateusz Piotrowski.It 94d49a5dddSWarner Losh.Fn efi_guid_to_name 954026e1ccSMateusz Piotrowski.It 964026e1ccSMateusz Piotrowski.Fn efi_guid_to_str 974026e1ccSMateusz Piotrowski.It 98d49a5dddSWarner Losh.Fn efi_guid_to_symbol 994026e1ccSMateusz Piotrowski.It 1004026e1ccSMateusz Piotrowski.Fn efi_name_to_guid 1014026e1ccSMateusz Piotrowski.It 1024026e1ccSMateusz Piotrowski.Fn efi_set_variable 1034026e1ccSMateusz Piotrowski.It 1044026e1ccSMateusz Piotrowski.Fn efi_str_to_guid 1054026e1ccSMateusz Piotrowski.El 106503478afSKyle Evans.Sh SEE ALSO 107503478afSKyle Evans.Xr efidev 4 1084026e1ccSMateusz Piotrowski.Sh HISTORY 1094026e1ccSMateusz PiotrowskiThe 1104026e1ccSMateusz Piotrowski.Nm 1114026e1ccSMateusz Piotrowskilibrary first appeared in 1124026e1ccSMateusz Piotrowski.Fx 12.0 . 113d49a5dddSWarner Losh.Sh AUTHORS 114d49a5dddSWarner Losh.An -nosplit 115d49a5dddSWarner LoshThis software was originally written by 116d49a5dddSWarner Losh.An Warner Losh . 1174026e1ccSMateusz Piotrowski.Sh BUGS 1184026e1ccSMateusz PiotrowskiNo facilities exist to process the strings as native UTF. 1194026e1ccSMateusz PiotrowskiThis is a limitation in the Linux 1204026e1ccSMateusz Piotrowski.Nm 1214026e1ccSMateusz Piotrowskilibrary interface. 122