/* dxe.h - definitions of the driver execution environment core interface */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2007 Free Software Foundation, Inc. * * GRUB 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. * * GRUB 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 GRUB. If not, see . */ /* The driver execution environment core interface is not a part of the EFI spec, but defined in Intel's DXE CIS. */ #ifndef GRUB_EFI_DXE_HEADER #define GRUB_EFI_DXE_HEADER 1 #define GRUB_EFI_DXE_SERVICES_SIGNATURE 0x565245535f455844 enum grub_efi_gcd_memory_type { GRUB_EFI_GCD_MEMORY_TYPE_NON_EXISTENT, GRUB_EFI_GCD_MEMORY_TYPE_RESERVED, GRUB_EFI_GCD_MEMORY_TYPE_SYSTEM_MEMORY, GRUB_EFI_GCD_MEMORY_TYPE_MEMORY_MAPPED_IO, GRUB_EFI_GCD_MEMORY_TYPE_MAXIMUM }; typedef grub_efi_gcd_memory_type grub_efi_gcd_memory_type_t; enum grub_efi_gcd_allocate_type { GRUB_EFI_GCD_ALLOCATE_ANY_SEARCH_BOTTOM_UP, GRUB_EFI_GCD_ALLOCATE_MAX_ADDRESS_SEARCH_BOTTOM_UP, GRUB_EFI_GCD_ALLOCATE_ADDRESS, GRUB_EFI_GCD_ALLOCATE_ANY_SEARCH_TOP_DOWN, GRUB_EFI_GCD_ALLOCATE_MAX_ADDRESS_SEARCH_TOP_DOWN, GRUB_EFI_GCD_MAX_ALLOCATE_TYPE }; typedef grub_efi_gcd_allocate_type grub_efi_gcd_allocate_type_t; struct grub_efi_gcd_memory_space_descriptor { grub_efi_physical_address_t base_address; grub_efi_uint64_t length; grub_efi_uint64_t capabilities; grub_efi_gcd_memory_type_t gcd_memory_type; grub_efi_handle_t image_handle; grub_efi_handle_t device_hande; } typedef grub_efi_gcd_memory_space_descriptor grub_efi_gcd_memory_space_descriptor_t; enum grub_efi_gcd_io_type { GRUB_EFI_GCD_IO_TYPE_NON_EXISTENT, GRUB_EFI_GCD_IO_TYPE_RESERVED, GRUB_EFI_GCD_IO_TYPE_IO, GRUB_EFI_GCD_IO_TYPE_MAXIMUM }; typedef grub_efi_gcd_io_type grub_efi_gcd_io_type_t; struct grub_efi_gcd_io_space_descriptor { grub_efi_physical_address_t base_address; grub_efi_uint64_t length; grub_efi_gcd_io_type_t gcd_io_type; grub_efi_handle_t image_handle; grub_efi_handle_t device_hande; } typedef grub_efi_gcd_io_space_descriptor grub_efi_gcd_io_space_descriptor_t; struct grub_efi_dxe_services { grub_efi_table_header_t hdr; grub_efi_status_t (*add_memory_space) (grub_efi_gcd_memory_type_t gcd_memory_type, grub_efi_physical_address_t base_address, grub_efi_uint64_t length, grub_efi_uint64_t capabilities); grub_efi_status_t (*allocate_memory_space) (grub_efi_gcd_allocate_type_t gcd_allocate_type, grub_efi_gcd_memory_type_t gcd_memory_type, grub_efi_uintn_t alignment, grub_efi_uint64_t length, grub_efi_physical_address_t *base_address, grub_efi_handle_t image_handle, grub_efi_handle_t device_handle); grub_efi_status_t (*free_memory_space) (grub_efi_physical_address_t base_address, grub_efi_uint64_t length); grub_efi_status_t (*remove_memory_space) (grub_efi_physical_address_t base_address, grub_efi_uint64_t length); grub_efi_status_t (*get_memory_space_descriptor) (grub_efi_physical_address_t base_address, grub_efi_gcd_memory_space_descriptor_t *descriptor); grub_efi_status_t (*set_memory_space_attributes) (grub_efi_physical_address_t base_address, grub_efi_uint64_t length, grub_efi_uint64_t attributes); grub_efi_status_t (*get_memory_space_map) (grub_efi_uintn_t *number_of_descriptors, grub_efi_gcd_memory_space_descriptor_t **memory_space_map); grub_efi_status_t (*add_io_space) (grub_efi_gcd_io_type_t gcd_io_type, grub_efi_physical_address_t base_address, grub_efi_uint64_t length); grub_efi_status_t (*allocate_io_space) (grub_efi_gcd_allocate_type_t gcd_allocate_type, grub_efi_gcd_io_type_t gcd_io_type, grub_efi_uintn_t alignment, grub_efi_uint64_t length, grub_efi_physical_address_t *base_address, grub_efi_handle_t image_handle, grub_efi_handle_t device_handle); grub_efi_status_t (*free_io_space) (grub_efi_physical_address_t base_address, grub_efi_uint64_t length); grub_efi_status_t (*remove io_space) (grub_efi_physical_address_t base_address, grub_efi_uint64_t length); grub_efi_status_t (*get_io_space_descriptor) (grub_efi_physical_address_t base_address, grub_efi_gcd_io_space_descriptor_t *descriptor); grub_efi_status_t (*get_io_space_map) (grub_efi_uintn_t *number_of_descriptors, grub_efi_gcd_io_space_descriptor_t **io_space_map); grub_efi_status_t (*dispatch) (); grub_efi_status_t (*schedule) (grub_efi_handle_t firmware_volume_handle, grub_efi_guid_t *filename); grub_efi_status_t (*trust) (grub_efi_handle_t firmware_volume_handle, grub_efi_guid_t *filename); grub_efi_status_t (*process_firmware_volume) (void *firmware_volume_header, grub_efi_uintn_t size, grub_efi_handle_t *firmware_volume_handle); }; typedef struct grub_efi_dxe_services grub_efi_dxe_services_t; #endif /* ! GRUB_EFI_DXE_HEADER */