30#ifndef _LOADER_EFILIB_H
31#define _LOADER_EFILIB_H
51extern struct devsw efipart_fddev;
52extern struct devsw efipart_cddev;
53extern struct devsw efipart_hddev;
54extern struct devsw efihttp_dev;
55extern struct devsw efinet_dev;
56extern struct netif_driver efinetif;
59typedef STAILQ_HEAD(pdinfo_list,
pdinfo) pdinfo_list_t;
63 STAILQ_ENTRY(
pdinfo) pd_link;
64 pdinfo_list_t pd_part;
68 EFI_BLOCK_IO *pd_blkio;
73 struct devsw *pd_devsw;
76pdinfo_list_t *efiblk_get_pdinfo_list(
struct devsw *dev);
78pdinfo_t *efiblk_get_pdinfo_by_handle(EFI_HANDLE h);
83EFI_STATUS OpenProtocolByHandle(EFI_HANDLE,
EFI_GUID *,
void **);
85static inline EFI_STATUS
86efi_exit_boot_services(UINTN key)
90 status = BS->ExitBootServices(IH, key);
91 if (!EFI_ERROR(status))
92 boot_services_active =
false;
96int efi_getdev(
void **vdev,
const char *devspec,
const char **path);
98int efi_register_handles(
struct devsw *, EFI_HANDLE *, EFI_HANDLE *,
int);
99EFI_HANDLE efi_find_handle(
struct devsw *,
int);
100int efi_handle_lookup(EFI_HANDLE,
struct devsw **,
int *, uint64_t *);
101int efi_handle_update_dev(EFI_HANDLE,
struct devsw *,
int, uint64_t);
105void efi_close_devpath(EFI_HANDLE);
113void efi_free_devpath_name(CHAR16 *);
120EFI_HANDLE efi_devpath_to_handle(
EFI_DEVICE_PATH *path, EFI_HANDLE *handles,
unsigned nhandles);
122int efi_status_to_errno(EFI_STATUS);
123EFI_STATUS errno_to_efi_status(
int errno);
125void efi_time_init(
void);
126void efi_time_fini(
void);
128int parse_uefi_con_out(
void);
131EFI_STATUS main(
int argc, CHAR16 *argv[]);
132void efi_exit(EFI_STATUS status) __dead2;
135void efi_init_environment(
void);
138const char *efi_memory_type(EFI_MEMORY_TYPE);
142int wcscmp(CHAR16 *, CHAR16 *);
143void cpy8to16(
const char *, CHAR16 *,
size_t);
144void cpy16to8(
const CHAR16 *,
char *,
size_t);
153EFI_STATUS efi_delenv(
EFI_GUID *guid,
const char *varname);
154EFI_STATUS efi_freebsd_delenv(
const char *varname);
155EFI_STATUS efi_freebsd_getenv(
const char *v,
void *data, __size_t *len);
156EFI_STATUS efi_getenv(
EFI_GUID *g,
const char *v,
void *data, __size_t *len);
157EFI_STATUS efi_global_getenv(
const char *v,
void *data, __size_t *len);
158EFI_STATUS efi_setenv(
EFI_GUID *guid,
const char *varname, UINT32 attr,
void *data, __size_t len);
159EFI_STATUS efi_setenv_freebsd_wcs(
const char *varname, CHAR16 *valstr);
162bool efi_guid_to_str(
const EFI_GUID *,
char **);
163bool efi_str_to_guid(
const char *,
EFI_GUID *);
164bool efi_name_to_guid(
const char *,
EFI_GUID *);
165bool efi_guid_to_name(
EFI_GUID *,
char **);
168int efipart_inithandles(
void);
Definition: flashPgmPvt.h:168