/* firmware_volume.h - definitions of the firmware volume protocol */ /* * 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 firmware volume bios protocol is not a part of the EFI spec, but defined in Intel's Firmware Volume Specification. */ #ifndef GRUB_EFI_FIRMWARE_VOLUME_HEADER #define GRUB_EFI_FIRMWARE_VOLUME_HEADER 1 #define GRUB_EFI_FIRMWARE_VOLUME_GUID \ { 0x389f751f, 0x1838, 0x4388, \ { 0x83, 0x90, 0xcd, 0x81, 0x54, 0xbd, 0x27, 0xf8 } \ } #define GRUB_EFI_FV_FILETYPE_ALL 0 #define GRUB_EFI_FV_FILETYPE_RAW 1 #define GRUB_EFI_FV_FILETYPE_FREEFORM 2 #define GRUB_EFI_FV_FILETYPE_SECURITY_CORE 3 #define GRUB_EFI_FV_FILETYPE_PEI_CORE 4 #define GRUB_EFI_FV_FILETYPE_DXE_CORE 5 #define GRUB_EFI_FV_FILETYPE_PEIM 6 #define GRUB_EFI_FV_FILETYPE_DRIVER 7 #define GRUB_EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 8 #define GRUB_EFI_FV_FILETYPE_APPLICATION 9 #define GRUB_EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 11 typedef grub_uint64_t grub_efi_fv_attributes_t; typedef grub_uint8_t grub_efi_fv_filetype_t; typedef grub_uint32_t grub_efi_fv_file_attributes_t; typedef grub_uint8_t grub_efi_section_type_t; typedef grub_uint32_t grub_efi_fv_write_policy_t; struct grub_efi_fv_write_file_data { grub_efi_guid_t *name_guid; grub_efi_fv_filetype_t type; grub_efi_fv_file_attributes_t file_attributes; void *buffer; grub_efi_uint32_t buffer_size; }; typedef struct grub_efi_fv_write_file_data grub_efi_fv_write_file_data_t; struct grub_efi_firmware_volume_protocol { grub_efi_status_t (*get_volume_attributes) (struct grub_efi_firmware_volume_protocol *this, grub_efi_fv_attributes_t *fvattributes); grub_efi_status_t (*set_volume_attributes) (struct grub_efi_firmware_volume_protocol *this, grub_efi_fv_attributes_t *fvattributes); grub_efi_status_t (*read_file) (struct grub_efi_firmware_volume_protocol *this, grub_efi_guid_t *name_guid, void **buffer, grub_efi_uintn_t *buffer_size, grub_efi_fv_filetype_t *found_type, grub_efi_fv_file_attributes_t *file_attributes, grub_efi_uint32_t *authentication_status); grub_efi_status_t (*read_section) (struct grub_efi_firmware_volume_protocol *this, grub_efi_guid_t *name_guid, grub_efi_section_type_t section_type, grub_efi_uintn_t section_instance, void **buffer, grub_efi_uintn_t *buffer_size, grub_efi_uint32_t *authentication_status); grub_efi_status_t (*write_file) (struct grub_efi_firmware_volume_protocol *this, grub_efi_uint32_t number_of_files, grub_efi_fv_write_policy_t write_policy, grub_efi_fv_write_file_data_t *file_data); grub_efi_status_t (*get_next_file) (struct grub_efi_firmware_volume_protocol *this, void *key, grub_efi_fv_filetype_t *file_type, grub_efi_guid_t *name_guid, grub_efi_fv_file_attributes_t *file_attributes, grub_efi_uintn_t *size); grub_efi_uint32_t key_size; grub_efi_handle_t parent_handle; }; typedef struct grub_efi_firmware_volume_protocol grub_efi_firmware_volume_protocol_t; #endif /* ! GRUB_EFI_FIRMWARE_VOLUME_HEADER */