xref: /dflybsd-src/sys/platform/pc64/include/efi.h (revision bb7548fd68273597588b57868a739b2d3a8a8d94)
1*bb7548fdSMatthew Dillon /*-
2*bb7548fdSMatthew Dillon  * Copyright (c) 2016 The FreeBSD Foundation
3*bb7548fdSMatthew Dillon  * All rights reserved.
4*bb7548fdSMatthew Dillon  *
5*bb7548fdSMatthew Dillon  * This software was developed by Konstantin Belousov <kib@FreeBSD.org>
6*bb7548fdSMatthew Dillon  * under sponsorship from the FreeBSD Foundation.
7*bb7548fdSMatthew Dillon  *
8*bb7548fdSMatthew Dillon  * Redistribution and use in source and binary forms, with or without
9*bb7548fdSMatthew Dillon  * modification, are permitted provided that the following conditions
10*bb7548fdSMatthew Dillon  * are met:
11*bb7548fdSMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
12*bb7548fdSMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
13*bb7548fdSMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
14*bb7548fdSMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
15*bb7548fdSMatthew Dillon  *    documentation and/or other materials provided with the distribution.
16*bb7548fdSMatthew Dillon  *
17*bb7548fdSMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18*bb7548fdSMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*bb7548fdSMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*bb7548fdSMatthew Dillon  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21*bb7548fdSMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*bb7548fdSMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*bb7548fdSMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*bb7548fdSMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*bb7548fdSMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*bb7548fdSMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*bb7548fdSMatthew Dillon  * SUCH DAMAGE.
28*bb7548fdSMatthew Dillon  *
29*bb7548fdSMatthew Dillon  * $FreeBSD: head/sys/amd64/include/efi.h 306209 2016-09-22 19:04:51Z imp $
30*bb7548fdSMatthew Dillon  */
31*bb7548fdSMatthew Dillon 
32*bb7548fdSMatthew Dillon #ifndef __AMD64_INCLUDE_EFI_H_
33*bb7548fdSMatthew Dillon #define __AMD64_INCLUDE_EFI_H_
34*bb7548fdSMatthew Dillon 
35*bb7548fdSMatthew Dillon /*
36*bb7548fdSMatthew Dillon  * XXX: from gcc 6.2 manual:
37*bb7548fdSMatthew Dillon  * Note, the ms_abi attribute for Microsoft Windows 64-bit targets
38*bb7548fdSMatthew Dillon  * currently requires the -maccumulate-outgoing-args option.
39*bb7548fdSMatthew Dillon  */
40*bb7548fdSMatthew Dillon #define	EFIABI_ATTR	__attribute__((ms_abi))
41*bb7548fdSMatthew Dillon 
42*bb7548fdSMatthew Dillon #ifdef _KERNEL
43*bb7548fdSMatthew Dillon struct uuid;
44*bb7548fdSMatthew Dillon struct efi_tm;
45*bb7548fdSMatthew Dillon 
46*bb7548fdSMatthew Dillon int efi_get_table(struct uuid *uuid, void **ptr);
47*bb7548fdSMatthew Dillon int efi_get_time(struct efi_tm *tm);
48*bb7548fdSMatthew Dillon int efi_get_time_locked(struct efi_tm *tm);
49*bb7548fdSMatthew Dillon int efi_reset_system(void);
50*bb7548fdSMatthew Dillon int efi_set_time(struct efi_tm *tm);
51*bb7548fdSMatthew Dillon int efi_set_time_locked(struct efi_tm *tm);
52*bb7548fdSMatthew Dillon int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib,
53*bb7548fdSMatthew Dillon     size_t *datasize, void *data);
54*bb7548fdSMatthew Dillon int efi_var_nextname(size_t *namesize, uint16_t *name, struct uuid *vendor);
55*bb7548fdSMatthew Dillon int efi_var_set(uint16_t *name, struct uuid *vendor, uint32_t attrib,
56*bb7548fdSMatthew Dillon     size_t datasize, void *data);
57*bb7548fdSMatthew Dillon #endif
58*bb7548fdSMatthew Dillon 
59*bb7548fdSMatthew Dillon #endif /* __AMD64_INCLUDE_EFI_H_ */
60