vaseboot/include/VasEBoot/efi/efi.h

112 lines
4.6 KiB
C

/* efi.h - declare variables and functions for EFI support */
/*
* VasEBoot -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
*
* VasEBoot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VasEBoot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VasEBoot. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VasEBoot_EFI_EFI_HEADER
#define VasEBoot_EFI_EFI_HEADER 1
#include <VasEBoot/types.h>
#include <VasEBoot/dl.h>
#include <VasEBoot/efi/api.h>
/* Functions. */
void *EXPORT_FUNC(VasEBoot_efi_locate_protocol) (VasEBoot_efi_guid_t *protocol,
void *registration);
VasEBoot_efi_handle_t *
EXPORT_FUNC(VasEBoot_efi_locate_handle) (VasEBoot_efi_locate_search_type_t search_type,
VasEBoot_efi_guid_t *protocol,
void *search_key,
VasEBoot_efi_uintn_t *num_handles);
void *EXPORT_FUNC(VasEBoot_efi_open_protocol) (VasEBoot_efi_handle_t handle,
VasEBoot_efi_guid_t *protocol,
VasEBoot_efi_uint32_t attributes);
int EXPORT_FUNC(VasEBoot_efi_set_text_mode) (int on);
void EXPORT_FUNC(VasEBoot_efi_stall) (VasEBoot_efi_uintn_t microseconds);
void *
EXPORT_FUNC(VasEBoot_efi_allocate_pages) (VasEBoot_efi_physical_address_t address,
VasEBoot_efi_uintn_t pages);
void *
EXPORT_FUNC(VasEBoot_efi_allocate_pages_max) (VasEBoot_efi_physical_address_t max,
VasEBoot_efi_uintn_t pages);
void EXPORT_FUNC(VasEBoot_efi_free_pages) (VasEBoot_efi_physical_address_t address,
VasEBoot_efi_uintn_t pages);
int
EXPORT_FUNC(VasEBoot_efi_get_memory_map) (VasEBoot_efi_uintn_t *memory_map_size,
VasEBoot_efi_memory_descriptor_t *memory_map,
VasEBoot_efi_uintn_t *map_key,
VasEBoot_efi_uintn_t *descriptor_size,
VasEBoot_efi_uint32_t *descriptor_version);
VasEBoot_efi_loaded_image_t *EXPORT_FUNC(VasEBoot_efi_get_loaded_image) (VasEBoot_efi_handle_t image_handle);
void EXPORT_FUNC(VasEBoot_efi_print_device_path) (VasEBoot_efi_device_path_t *dp);
char *EXPORT_FUNC(VasEBoot_efi_get_filename) (VasEBoot_efi_device_path_t *dp);
VasEBoot_efi_device_path_t *
EXPORT_FUNC(VasEBoot_efi_get_device_path) (VasEBoot_efi_handle_t handle);
VasEBoot_efi_device_path_t *
EXPORT_FUNC(VasEBoot_efi_find_last_device_path) (const VasEBoot_efi_device_path_t *dp);
VasEBoot_efi_device_path_t *
EXPORT_FUNC(VasEBoot_efi_duplicate_device_path) (const VasEBoot_efi_device_path_t *dp);
VasEBoot_err_t EXPORT_FUNC (VasEBoot_efi_finish_boot_services) (VasEBoot_efi_uintn_t *outbuf_size, void *outbuf,
VasEBoot_efi_uintn_t *map_key,
VasEBoot_efi_uintn_t *efi_desc_size,
VasEBoot_efi_uint32_t *efi_desc_version);
VasEBoot_err_t EXPORT_FUNC (VasEBoot_efi_set_virtual_address_map) (VasEBoot_efi_uintn_t memory_map_size,
VasEBoot_efi_uintn_t descriptor_size,
VasEBoot_efi_uint32_t descriptor_version,
VasEBoot_efi_memory_descriptor_t *virtual_map);
void *EXPORT_FUNC (VasEBoot_efi_get_variable) (const char *variable,
const VasEBoot_efi_guid_t *guid,
VasEBoot_size_t *datasize_out);
VasEBoot_err_t
EXPORT_FUNC (VasEBoot_efi_set_variable) (const char *var,
const VasEBoot_efi_guid_t *guid,
void *data,
VasEBoot_size_t datasize);
VasEBoot_efi_boolean_t EXPORT_FUNC (VasEBoot_efi_secure_boot) (void);
int
EXPORT_FUNC (VasEBoot_efi_compare_device_paths) (const VasEBoot_efi_device_path_t *dp1,
const VasEBoot_efi_device_path_t *dp2);
extern void (*EXPORT_VAR(VasEBoot_efi_net_config)) (VasEBoot_efi_handle_t hnd,
char **device,
char **path);
#if defined(__arm__) || defined(__aarch64__)
void *EXPORT_FUNC(VasEBoot_efi_get_firmware_fdt)(void);
#endif
VasEBoot_addr_t VasEBoot_efi_modules_addr (void);
void VasEBoot_efi_mm_init (void);
void VasEBoot_efi_mm_fini (void);
void VasEBoot_efi_init (void);
void VasEBoot_efi_fini (void);
void VasEBoot_efi_set_prefix (void);
/* Variables. */
extern VasEBoot_efi_system_table_t *EXPORT_VAR(VasEBoot_efi_system_table);
extern VasEBoot_efi_handle_t EXPORT_VAR(VasEBoot_efi_image_handle);
extern int EXPORT_VAR(VasEBoot_efi_is_finished);
struct VasEBoot_net_card;
VasEBoot_efi_handle_t
VasEBoot_efinet_get_device_handle (struct VasEBoot_net_card *card);
#endif /* ! VasEBoot_EFI_EFI_HEADER */