2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Nd user-mode access to UEFI runtime services
37 To compile this driver into the kernel, place the following lines in your
38 kernel configuration file:
39 .Bd -ragged -offset -indent
43 Alternatively, to load the driver as a module at boot time, place the following
46 .Bd -literal -offset indent
51 may be disabled by setting the
58 is currently only available on amd64 and arm64.
62 device provides user-mode access to UEFI runtime services.
64 also includes a driver to provide a time-of-day clock using the UEFI
65 real time clock (RTC).
66 However, the RTC may not always be available, based on the UEFI firmware.
67 If the RTC is not available, it will not be registered as a time-of-day clock
68 and the time related ioctls below will not be functional.
71 provides the following ioctls defined in
73 with supplemental structures and constants defined in
75 .Bl -tag -width ".Dv EFIIOC_GET_TABLE"
76 .It Dv EFIIOC_GET_TABLE Pq Vt "struct efi_get_table_ioc"
77 Get a table by uuid from the UEFI system table.
79 struct efi_get_table_ioc {
84 .It Dv EFIIOC_GET_TIME Pq Vt "struct efi_tm"
85 Get the time from the RTC, if the RTC is available.
88 passed is populated with the current time, unless an error occurs.
104 .It Dv EFIIOC_SET_TIME Pq Vt "struct efi_tm"
105 Sets the time stored by the RTC, if the RTC is available.
106 .It Dv EFIIOC_VAR_GET Pq Vt "struct efi_var_ioc"
107 Gets data from the variable described by the vendor and name fields of the
108 .Vt struct efi_var_ioc
110 .Dv EFIIOC_VAR_GET Pq Vt "struct efi_var_ioc"
111 will also populate the attrib field.
122 .It Dv EFIIOC_VAR_NEXT Pq Vt "struct efi_var_ioc"
123 Used for enumerating all UEFI variables.
124 The initial call should use an empty string for the name attribute.
125 Subsequent calls should supply the vendor uuid and name of the last variable
127 .It Dv EFIIOC_VAR_SET Pq Vt "struct efi_var_ioc"
128 Sets data and attributes for the variable described by the name and vendor in
130 .Vt struct efi_var_ioc .
133 .Bl -tag -width /dev/efi
142 device first appeared in