bios-linker-loader.h 1.4 KB
Newer Older
M
Michael S. Tsirkin 已提交
1 2 3 4
#ifndef BIOS_LINKER_LOADER_H
#define BIOS_LINKER_LOADER_H


5 6
typedef struct BIOSLinker {
    GArray *cmd_blob;
7
    GArray *file_list;
8
} BIOSLinker;
M
Michael S. Tsirkin 已提交
9

10 11 12
BIOSLinker *bios_linker_loader_init(void);

void bios_linker_loader_alloc(BIOSLinker *linker,
13 14
                              const char *file_name,
                              GArray *file_blob,
M
Michael S. Tsirkin 已提交
15 16 17
                              uint32_t alloc_align,
                              bool alloc_fseg);

18
void bios_linker_loader_add_checksum(BIOSLinker *linker, const char *file,
19 20
                                     unsigned start_offset, unsigned size,
                                     unsigned checksum_offset);
M
Michael S. Tsirkin 已提交
21

22
void bios_linker_loader_add_pointer(BIOSLinker *linker,
M
Michael S. Tsirkin 已提交
23
                                    const char *dest_file,
24 25
                                    uint32_t dst_patched_offset,
                                    uint8_t dst_patched_size,
M
Michael S. Tsirkin 已提交
26
                                    const char *src_file,
27
                                    uint32_t src_offset);
M
Michael S. Tsirkin 已提交
28

29 30 31 32 33 34 35
void bios_linker_loader_write_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);

36
void bios_linker_loader_cleanup(BIOSLinker *linker);
M
Michael S. Tsirkin 已提交
37
#endif