qemu/hw/acpi/bios-linker-loader.c
/*
 * bios_linker_loader_alloc: ask guest to load file into guest memory.
 *
 * @linker: linker object instance
 * @file_name: name of the file blob to be loaded
 * @file_blob: pointer to blob corresponding to @file_name
 * @alloc_align: required minimal alignment in bytes. Must be a power of 2.
 * @alloc_fseg: request allocation in FSEG zone (useful for the RSDP ACPI table)
 *
 * Note: this command must precede any other linker command using this file.
 */
ask guest to load file into guest memory.

this command must precede any other linker command using this file.
ask guest to load file into guest memory . this command must precede any other linker command using this file .
void bios_linker_loader_alloc(BIOSLinker *linker,
                              const char *file_name,
                              GArray *file_blob,
                              uint32_t alloc_align,
                              bool alloc_fseg)
{
    BiosLinkerLoaderEntry entry;
    BiosLinkerFileEntry file = { g_strdup(file_name), file_blob};
    assert(!(alloc_align & (alloc_align - 1)));
    assert(!bios_linker_find_file(linker, file_name));
    g_array_append_val(linker->file_list, file);
    memset(&entry, 0, sizeof entry);
    strncpy(entry.alloc.file, file_name, sizeof entry.alloc.file - 1);
    entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ALLOCATE);
    entry.alloc.align = cpu_to_le32(alloc_align);
    entry.alloc.zone = alloc_fseg ? BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG :
                                    BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH;
    g_array_prepend_vals(linker->cmd_blob, &entry, sizeof entry);
}
void bios_linker_loader_alloc ( BIOSLinker * linker , const char * file_name , GArray * file_blob , uint32_t alloc_align , bool alloc_fseg ) { BiosLinkerLoaderEntry entry ; BiosLinkerFileEntry file = { g_strdup ( file_name ) , file_blob } ; assert ( ! ( alloc_align & ( alloc_align - 1 ) ) ) ; assert ( ! bios_linker_find_file ( linker , file_name ) ) ; g_array_append_val ( linker -> file_list , file ) ; memset ( & entry , 0 , sizeof entry ) ; strncpy ( entry . alloc . file , file_name , sizeof entry . alloc . file - 1 ) ; entry . command = cpu_to_le32 ( BIOS_LINKER_LOADER_COMMAND_ALLOCATE ) ; entry . alloc . align = cpu_to_le32 ( alloc_align ) ; entry . alloc . zone = alloc_fseg ? BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG : BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH ; g_array_prepend_vals ( linker -> cmd_blob , & entry , sizeof entry ) ; }
bios_linker_loader_alloc: ask guest to load file into guest memory.
bios_linker_loader_alloc : ask guest to load file into guest memory .
/* Alloc entries must come first, so prepend them */