xref: /dragonfly/lib/libefivar/efivar.3 (revision 479ab7f0)
1.\" Copyright 2016 Netflix, Inc.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD: head/lib/libefivar/efivar.3 343755 2019-02-04 21:28:25Z imp $
26.\"
27.Dd July 3, 2020
28.Dt LIBEFIVAR 3
29.Os
30.Sh NAME
31.Nm libefivar
32.Nd EFI Non Volatile Variable Support
33.Sh LIBRARY
34.Lb libefivar
35.Sh SYNOPSIS
36.In efivar.h
37.Ft int
38.Fn efi_append_variable "efi_guid_t guid" "const char *name" "uint8_t *data" "size_t data_size" "uint32_t attributes"
39.Ft int
40.Fn efi_del_variable "efi_guid_t guid" "const char *name"
41.Ft int
42.Fn efi_get_variable "efi_guid_t guid" "const char *name" "uint8_t **data" "size_t *data_size" "uint32_t *attributes"
43.Ft int
44.Fn efi_get_variable_attributes "efi_guid_t guid" "const char *name" "uint32_t *attributes"
45.Ft int
46.Fn efi_get_variable_size "efi_guid_t guid" "const char *name" "size_t *size"
47.Ft int
48.Fn efi_get_next_variable_name "efi_guid_t **guid" "char **name"
49.Ft int
50.Fn efi_guid_to_name "efi_guid_t *guid" "char **name"
51.Ft int
52.Fn efi_guid_to_symbol "efi_guid_t *guid" "char **symbol"
53.Ft int
54.Fn efi_guid_to_str "const efi_guid_t *guid" "char **sp"
55.Ft int
56.Fn efi_name_to_guid "const char *name" "efi_guid_t *guid"
57.Ft int
58.Fn efi_set_variable "efi_guid_t guid" "const char *name" "uint8_t *data" "size_t data_size" "uint32_t attributes"
59.Ft int
60.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid"
61.Ft int
62.Fn efi_variables_supported "void"
63.Sh DESCRIPTION
64The
65.Nm
66library implements access to EFI Variables via the EFI Runtime
67Services.
68All
69.Vt "char *"
70strings are converted to 16-bit UTF strings before passing
71them to EFI.
72.Pp
73.Fn efi_variables_supported
74returns non-zero if the current machine supports setting of EFI firmware
75variables and the kernel support for doing so is present.
76Otherwise zero is returned.
77.Pp
78.Fn efi_del_variable
79deletes the EFI variable selected by
80.Fa guid
81and
82.Fa name .
83.Pp
84The following functions have not been implemented yet:
85.Bl -dash -offset indent -compact
86.It
87.Fn efi_append_variable
88.It
89.Fn efi_get_next_variable_name
90.It
91.Fn efi_get_variable
92.It
93.Fn efi_get_variable_attributes
94.It
95.Fn efi_get_variable_size
96.It
97.Fn efi_guid_to_name
98.It
99.Fn efi_guid_to_str
100.It
101.Fn efi_guid_to_symbol
102.It
103.Fn efi_name_to_guid
104.It
105.Fn efi_set_variable
106.It
107.Fn efi_str_to_guid
108.El
109.Sh SEE ALSO
110.Xr efidev 4 ,
111.Xr efidp 8 ,
112.Xr efivar 8
113.Sh HISTORY
114The
115.Nm
116library first appeared in
117.Fx 12.0 .
118.Sh AUTHORS
119.An -nosplit
120This software was originally written by
121.An Warner Losh .
122.Sh BUGS
123No facilities exist to process the strings as native UTF.
124This is a limitation in the Linux
125.Nm
126library interface.
127