2019-02-04 21:28:25 +00:00
|
|
|
.\"
|
2016-10-11 22:30:41 +00:00
|
|
|
.\" Copyright 2016 Netflix, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2018-10-25 15:41:19 +00:00
|
|
|
.Dd October 25, 2018
|
2016-10-11 22:30:41 +00:00
|
|
|
.Dt LIBEFIVAR 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm libefivar
|
2018-10-25 15:41:19 +00:00
|
|
|
.Nd EFI Non Volatile Variable Support
|
2016-10-11 22:30:41 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In efivar.h
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_append_variable "efi_guid_t guid" "const char *name" "void *data" "size_t data_size" "uint32_t attributes"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_del_variable "efi_guid_t guid" "const char *name"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_get_variable "efi_guid_t guid" "const char *name" "void **data" "ssize_t *data_size" "uint32_t *attributes"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_get_variable_attributes "efi_guid_t guid" "const char *name" "uint32_t *attributes"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_get_variable_size "efi_guid_t guid" "const char *name" "size_t *size"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_get_next_variable_name "efi_guid_t **guid" "char **name"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_guid_to_name "efi_guid_t *guid" "char **name"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_guid_to_symbol "efi_guid_t *guid" "char **symbol"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_guid_to_str "const efi_guid_t *guid" "char **sp"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_name_to_guid "const char *name" "efi_guid_t *guid"
|
|
|
|
.Ft int
|
|
|
|
.Fn efi_set_variable "efi_guid_t guid" "const char *name" "void *data" "size_t data_size" "uint32_t attributes"
|
|
|
|
.Ft int
|
2018-10-25 15:41:19 +00:00
|
|
|
.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid"
|
2016-10-11 22:30:41 +00:00
|
|
|
.Ft int
|
2018-10-25 15:41:19 +00:00
|
|
|
.Fn efi_variables_supported "void"
|
2016-10-11 22:30:41 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
library implements access to EFI Variables via the EFI Runtime
|
2018-10-25 15:41:19 +00:00
|
|
|
Services.
|
|
|
|
All
|
|
|
|
.Vt "char *"
|
|
|
|
strings are converted to 16-bit UTF strings before passing
|
2016-10-11 22:30:41 +00:00
|
|
|
them to EFI.
|
|
|
|
.Pp
|
|
|
|
.Fn efi_variables_supported
|
|
|
|
returns non-zero if the current machine supports setting of EFI firmware
|
|
|
|
variables and the kernel support for doing so is present.
|
|
|
|
Otherwise zero is returned.
|
|
|
|
.Pp
|
|
|
|
.Fn efi_del_variable
|
|
|
|
deletes the EFI variable selected by
|
2018-10-25 15:41:19 +00:00
|
|
|
.Va guid
|
2016-10-11 22:30:41 +00:00
|
|
|
and
|
2018-10-25 15:41:19 +00:00
|
|
|
.Va name .
|
2016-10-11 22:30:41 +00:00
|
|
|
.Pp
|
2018-10-25 15:41:19 +00:00
|
|
|
The following functions have not been implemented yet:
|
|
|
|
.Bl -dash -offset indent -compact
|
|
|
|
.It
|
|
|
|
.Fn efi_append_variable
|
|
|
|
.It
|
|
|
|
.Fn efi_get_next_variable_name
|
|
|
|
.It
|
2016-10-11 22:30:41 +00:00
|
|
|
.Fn efi_get_variable
|
2018-10-25 15:41:19 +00:00
|
|
|
.It
|
2016-10-11 22:30:41 +00:00
|
|
|
.Fn efi_get_variable_attributes
|
2018-10-25 15:41:19 +00:00
|
|
|
.It
|
2016-10-11 22:30:41 +00:00
|
|
|
.Fn efi_get_variable_size
|
2018-10-25 15:41:19 +00:00
|
|
|
.It
|
2016-10-11 22:30:41 +00:00
|
|
|
.Fn efi_guid_to_name
|
2018-10-25 15:41:19 +00:00
|
|
|
.It
|
|
|
|
.Fn efi_guid_to_str
|
|
|
|
.It
|
2016-10-11 22:30:41 +00:00
|
|
|
.Fn efi_guid_to_symbol
|
2018-10-25 15:41:19 +00:00
|
|
|
.It
|
|
|
|
.Fn efi_name_to_guid
|
|
|
|
.It
|
|
|
|
.Fn efi_set_variable
|
|
|
|
.It
|
|
|
|
.Fn efi_str_to_guid
|
|
|
|
.El
|
2018-08-17 04:17:51 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr efidev 4
|
2018-10-25 15:41:19 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
library first appeared in
|
|
|
|
.Fx 12.0 .
|
2016-10-11 22:30:41 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An -nosplit
|
|
|
|
This software was originally written by
|
|
|
|
.An Warner Losh .
|
2018-10-25 15:41:19 +00:00
|
|
|
.Sh BUGS
|
|
|
|
No facilities exist to process the strings as native UTF.
|
|
|
|
This is a limitation in the Linux
|
|
|
|
.Nm
|
|
|
|
library interface.
|