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
37 .Nm efi_get_time_capabilities ,
38 .Nm efi_reset_system ,
41 .Nm efi_var_nextname ,
43 .Nd kernel access to UEFI runtime services
51 .Fn efi_get_table "struct uuid *uuid" "void **ptr"
53 .Fn efi_get_time "struct efi_tm *tm"
55 .Fn efi_get_time_capabilities "struct efi_tmcap *tmcap"
57 .Fn efi_reset_system "enum efi_reset type"
59 .Fn efi_set_time "struct efi_tm *tm"
61 .Fn efi_var_get "uint16_t *name" "struct uuid *vendor" "uint32_t *attrib" \
62 "size_t *datasize" "void *data"
64 .Fn efi_var_nextname "size_t *namesize" "uint16_t *name" "struct uuid *vendor"
66 .Fn efi_var_set "uint16_t *name" "struct uuid *vendor" "uint32_t *attrib" \
67 "size_t *datasize" "void *data"
69 All of the following calls will return
71 if UEFI runtime services are not available.
73 is currently only available on amd64 and arm64.
77 Returns 0 if UEFI runtime services are present and functional, or
83 function gets a table by uuid from the UEFI system table.
84 Returns 0 if the table was found and populates *ptr with the address.
87 if the configuration table or system table are unset.
90 if the requested table cannot be found.
94 function gets the current time from the RTC, if available.
95 Returns 0 and populates the
106 if the time could not be retrieved due to a hardware error.
109 .Fn efi_get_time_capabilities
110 function gets the capabilities from the RTC.
111 Returns 0 and populates the
122 if the time could not be retrieved due to a hardware error.
126 function requests a reset of the system.
129 argument may be one of the
132 .Bl -tag -width ".Dv EFI_RESET_SHUTDOWN"
133 .It Dv EFI_RESET_COLD
134 Perform a cold reset of the system, and reboot.
135 .It Dv EFI_RESET_WARM
136 Perform a warm reset of the system, and reboot.
137 .It Dv EFI_RESET_SHUTDOWN
138 Power off the system.
143 function sets the time on the RTC to the time described by the
146 Returns 0 on success,
148 if a time field is out of range, or
150 if the time could not be set due to a hardware error.
154 function fetches the variable identified by
158 Returns 0 and populates
164 Otherwise, one of the following errors are returned:
165 .Bl -tag -width ".Dv EOVERFLOW"
167 The variable was not found.
170 is not sufficient to hold the variable data.
172 is updated to reflect the size needed to complete the request.
182 is large enough to hold the response but
186 The variable could not be retrieved due to a hardware error.
188 The variable could not be retireved due to an authentication failure.
193 function is used for enumeration of variables.
194 On the initial call to
195 .Fn efi_var_nextname ,
197 should be an empty string.
198 Subsequent calls should pass in the last
205 Returns 0 and populates
210 with the next variable's data.
211 Otherwise, returns one of the following errors:
212 .Bl -tag -width ".Dv EOVERFLOW"
214 The next variable was not found.
217 is not sufficient to hold the variable data.
219 is updated to reflect the size needed to complete the request.
228 The variable could not be retrieved due to a hardware error.
233 function sets the variable described by
237 Returns 0 if the variable has been successfully.
238 Otherwise, returns one of the following errors:
239 .Bl -tag -width ".Dv EOVERFLOW"
243 was an invalid combination of attributes,
245 exceeds the maximum allowed size, or
247 is an empty Unicode stirng.
249 Not enough storage is available to hold the variable and its data.
251 The variable could not be saved due to a hardware error.
253 The variable in question is read-only or may not be deleted.
255 The variable could not be set due to an authentication failure.
257 The variable trying to be updated or deleted was not found.
262 This manual page was written by
263 .An Kyle Evans Aq Mt kevans@FreeBSD.org .