mirror of
https://github.com/qemu/qemu.git
synced 2025-07-29 06:26:06 +00:00

cleanup bios_linker_loader_add_pointer() API by switching arguments to taking offsets relative to corresponding files instead of doing pointer arithmetic on behalf of user which were confusing. Also make offset inside of source file explicit in API so that user won't have to manually set it in destination file blob and while at it add additional boundary checks. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
#ifndef BIOS_LINKER_LOADER_H
|
|
#define BIOS_LINKER_LOADER_H
|
|
|
|
#include <glib.h>
|
|
|
|
typedef struct BIOSLinker {
|
|
GArray *cmd_blob;
|
|
GArray *file_list;
|
|
} BIOSLinker;
|
|
|
|
BIOSLinker *bios_linker_loader_init(void);
|
|
|
|
void bios_linker_loader_alloc(BIOSLinker *linker,
|
|
const char *file_name,
|
|
GArray *file_blob,
|
|
uint32_t alloc_align,
|
|
bool alloc_fseg);
|
|
|
|
void bios_linker_loader_add_checksum(BIOSLinker *linker, const char *file,
|
|
void *start, unsigned size,
|
|
uint8_t *checksum);
|
|
|
|
void bios_linker_loader_add_pointer(BIOSLinker *linker,
|
|
const char *dest_file,
|
|
uint32_t dst_patched_offset,
|
|
uint8_t dst_patched_size,
|
|
const char *src_file,
|
|
uint32_t src_offset);
|
|
|
|
void bios_linker_loader_cleanup(BIOSLinker *linker);
|
|
#endif
|