xref: /freebsd/stand/kboot/include/efi.h (revision 92ad79ec33fb5caf9a79c0bd8b33697b34c8e26d)
1 /*-
2  * Copyright (c) 2024, Netflix, Inc.
3  *
4  * SPDX-License-Identifier: BSD-2-Clause
5  */
6 
7 #pragma once
8 
9 #include <sys/efi.h>
10 #include <machine/metadata.h>
11 
12 /* Note, we mix and match FreeBSD types and EFI standard defined types */
13 
14 typedef void (*efi_map_entry_cb)(struct efi_md *, void *argp);
15 
16 struct preloaded_file;
17 
18 bool efi_read_from_pa(uint64_t pa, uint32_t map_size, uint32_t desc_size, uint32_t vers);
19 void efi_read_from_sysfs(void);
20 void efi_set_systbl(uint64_t tbl);
21 void foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void *argp);
22 void print_efi_map(struct efi_map_header *efihdr);
23 void efi_bi_loadsmap(struct preloaded_file *kfp);
24 
25 extern uint32_t efi_map_size;
26 extern vm_paddr_t efi_map_phys_src;	/* From DTB */
27 extern vm_paddr_t efi_map_phys_dst;	/* From our memory map metadata module */
28