if (err != EFI_SUCCESS)
return false;
- PeSectionVector vector = {};
+ PeSectionVector vector[1] = {};
pe_locate_profile_sections(
section_table,
n_section_table,
section_names,
/* profile= */ UINT_MAX,
/* validate_base= */ 0,
- &vector);
- if (vector.memory_size != STRLEN(SD_MAGIC))
+ vector);
+ if (vector[0].memory_size != STRLEN(SD_MAGIC))
return false;
- err = file_handle_read(handle, vector.file_offset, vector.file_size, &content, &read);
- if (err != EFI_SUCCESS || vector.file_size != read)
+ err = file_handle_read(handle, vector[0].file_offset, vector[0].file_size, &content, &read);
+ if (err != EFI_SUCCESS || vector[0].file_size != read)
return false;
return memcmp(content, SD_MAGIC, STRLEN(SD_MAGIC)) == 0;
/* and now iterate through possible profiles, and create a menu item for each profile we find */
for (unsigned profile = 0; profile < UNIFIED_PROFILES_MAX; profile ++) {
- PeSectionVector sections[_SECTION_MAX];
+ PeSectionVector sections[_SECTION_MAX] = {};
/* Start out with the base sections */
memcpy(sections, base_sections, sizeof(sections));
if (!firmware_devicetree_exists()) {
/* Find HWIDs table and search for the current device */
- PeSectionVector hwids_section = {};
+ static const char *const hwid_section_names[] = { ".hwids", NULL };
+ PeSectionVector hwids_section[1] = {};
pe_locate_sections_internal(
section_table,
n_section_table,
- (const char *const[]) { ".hwids", NULL },
+ hwid_section_names,
validate_base,
/* device_table */ NULL,
/* device */ NULL,
- &hwids_section);
+ hwids_section);
- if (PE_SECTION_VECTOR_IS_SET(&hwids_section)) {
- hwids = (const uint8_t *) SIZE_TO_PTR(validate_base) + hwids_section.memory_offset;
+ if (PE_SECTION_VECTOR_IS_SET(hwids_section)) {
+ hwids = (const uint8_t *) SIZE_TO_PTR(validate_base) + hwids_section[0].memory_offset;
- EFI_STATUS err = chid_match(hwids, hwids_section.memory_size, DEVICE_TYPE_DEVICETREE, &device);
+ EFI_STATUS err = chid_match(hwids, hwids_section[0].memory_size, DEVICE_TYPE_DEVICETREE, &device);
if (err != EFI_SUCCESS) {
log_error_status(err, "HWID matching failed, no DT blob will be selected: %m");
hwids = NULL;
assert(pe);
static const char *const section_names[] = { ".compat", NULL };
- PeSectionVector vector = {};
+ PeSectionVector vector[1] = {};
pe_locate_sections(
(const PeSectionHeader *) ((const uint8_t *) dos + section_table_offset(dos, pe)),
pe->FileHeader.NumberOfSections,
section_names,
PTR_TO_SIZE(dos),
- &vector);
+ vector);
- if (!PE_SECTION_VECTOR_IS_SET(&vector)) /* not found */
+ if (!PE_SECTION_VECTOR_IS_SET(vector)) /* not found */
return 0;
typedef struct {
uint32_t entry_point;
} _packed_ LinuxPeCompat1;
- size_t addr = vector.memory_offset, size = vector.memory_size;
+ size_t addr = vector[0].memory_offset, size = vector[0].memory_size;
while (size >= sizeof(LinuxPeCompat1) && addr % alignof(LinuxPeCompat1) == 0) {
const LinuxPeCompat1 *compat = (const LinuxPeCompat1 *) ((const uint8_t *) dos + addr);