![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <commonlib/endian.h>
#include <commonlib/fsp.h>
#include <vendorcode/intel/edk2/uefi_2.4/uefi_types.h>
#include <vendorcode/intel/fsp/fsp1_1/IntelFspPkg/Include/FspInfoHeader.h>
#include <commonlib/helpers.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | fsp_patch_table |
Macros | |
#define | FSP_DBG_LVL BIOS_NEVER |
#define | FSPP_SIG 0x50505346 |
Functions | |
static int | guid_compare (const EFI_GUID *le_guid, const EFI_GUID *native_guid) |
static void * | relative_offset (void *base, ssize_t offset) |
static uint32_t * | fspp_reloc (void *fsp, size_t fsp_size, uint32_t e) |
static int | reloc_type (uint16_t reloc_entry) |
static size_t | reloc_offset (uint16_t reloc_entry) |
static int | te_relocate (uintptr_t new_addr, void *te) |
static size_t | csh_size (const EFI_COMMON_SECTION_HEADER *csh) |
static size_t | section_data_offset (const EFI_COMMON_SECTION_HEADER *csh) |
static size_t | section_data_size (const EFI_COMMON_SECTION_HEADER *csh) |
static size_t | file_section_offset (const EFI_FFS_FILE_HEADER *ffsfh) |
static size_t | ffs_file_size (const EFI_FFS_FILE_HEADER *ffsfh) |
static int | relocate_patch_table (void *fsp, size_t size, size_t offset, ssize_t adjustment) |
static ssize_t | relocate_remaining_items (void *fsp, size_t size, uintptr_t new_addr, size_t fih_offset) |
static ssize_t | relocate_fvh (uintptr_t new_addr, void *fsp, size_t fsp_size, size_t fvh_offset, size_t *fih_offset) |
ssize_t | fsp_component_relocate (uintptr_t new_addr, void *fsp, size_t size) |
ssize_t | fsp1_1_relocate (uintptr_t new_addr, void *fsp, size_t size) |
Variables | |
static const EFI_GUID | ffs2_guid = EFI_FIRMWARE_FILE_SYSTEM2_GUID |
static const EFI_GUID | fih_guid = FSP_INFO_HEADER_GUID |
struct fsp_patch_table | __packed |
#define FSP_DBG_LVL BIOS_NEVER |
Definition at line 25 of file fsp_relocate.c.
#define FSPP_SIG 0x50505346 |
Definition at line 59 of file fsp_relocate.c.
|
static |
Definition at line 203 of file fsp_relocate.c.
References read_le8().
Referenced by section_data_offset(), and section_data_size().
|
static |
Definition at line 244 of file fsp_relocate.c.
References read_le32(), and read_le8().
Referenced by relocate_fvh().
|
static |
Definition at line 236 of file fsp_relocate.c.
Referenced by relocate_fvh(), and relocate_remaining_items().
Definition at line 539 of file fsp_relocate.c.
References fsp_component_relocate().
Referenced by fsp_relocate().
Definition at line 507 of file fsp_relocate.c.
References BIOS_ERR, NULL, offset, printk, relocate_fvh(), and relocate_remaining_items().
Referenced by fsp1_1_relocate().
Definition at line 71 of file fsp_relocate.c.
References MiB, NULL, offset, and relative_offset().
Referenced by relocate_patch_table().
|
static |
Definition at line 35 of file fsp_relocate.c.
References ARRAY_SIZE, memcmp(), read_le16(), and read_le32().
Referenced by relocate_fvh(), and relocate_remaining_items().
Definition at line 61 of file fsp_relocate.c.
Referenced by fspp_reloc(), relocate_fvh(), relocate_patch_table(), relocate_remaining_items(), and te_relocate().
Definition at line 97 of file fsp_relocate.c.
Referenced by te_relocate().
|
static |
Definition at line 91 of file fsp_relocate.c.
Referenced by te_relocate().
|
static |
Definition at line 381 of file fsp_relocate.c.
References ALIGN_UP, BIOS_ERR, ffs2_guid, ffs_file_size(), file_section_offset(), FSP_DBG_LVL, guid_compare(), NULL, offset, printk, read_le16(), read_le32(), read_le64(), read_le8(), relative_offset(), section_data_offset(), section_data_size(), and te_relocate().
Referenced by fsp_component_relocate().
|
static |
Definition at line 264 of file fsp_relocate.c.
References BIOS_ERR, FSP_DBG_LVL, fspp_reloc(), fsp_patch_table::header_length, NULL, offset, fsp_patch_table::patch_entries, fsp_patch_table::patch_entry_num, printk, read_le16(), read_le32(), relative_offset(), and write_le32().
Referenced by relocate_remaining_items().
|
static |
Definition at line 306 of file fsp_relocate.c.
References BIOS_ERR, fih_guid, file_section_offset(), FSP_DBG_LVL, FSPP_SIG, guid_compare(), offset, printk, read_le32(), read_le8(), relative_offset(), relocate_patch_table(), section_data_offset(), and write_le32().
Referenced by fsp_component_relocate().
|
static |
Definition at line 216 of file fsp_relocate.c.
References csh_size().
Referenced by relocate_fvh(), relocate_remaining_items(), and section_data_size().
|
static |
Definition at line 224 of file fsp_relocate.c.
References csh_size(), read_le32(), and section_data_offset().
Referenced by relocate_fvh().
Definition at line 103 of file fsp_relocate.c.
References BIOS_ERR, FSP_DBG_LVL, offset, printk, read_le16(), read_le32(), read_le64(), relative_offset(), reloc_offset(), reloc_type(), type, val, write_le32(), and write_le64().
Referenced by relocate_fvh().
struct fsp_patch_table __packed |
|
static |
Definition at line 47 of file fsp_relocate.c.
Referenced by relocate_fvh().
|
static |
Definition at line 48 of file fsp_relocate.c.
Referenced by relocate_remaining_items().