mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
loader: use file path size from fw_cfg.h
Avoid a bit of code duplication, make max file path constant reusable. Suggested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
544d2bfa84
commit
35c12e60c8
2 changed files with 4 additions and 2 deletions
|
@ -663,7 +663,7 @@ int rom_add_file(const char *file, const char *fw_dir,
|
||||||
rom_insert(rom);
|
rom_insert(rom);
|
||||||
if (rom->fw_file && fw_cfg) {
|
if (rom->fw_file && fw_cfg) {
|
||||||
const char *basename;
|
const char *basename;
|
||||||
char fw_file_name[56];
|
char fw_file_name[FW_CFG_MAX_FILE_PATH];
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
basename = strrchr(rom->fw_file, '/');
|
basename = strrchr(rom->fw_file, '/');
|
||||||
|
|
|
@ -46,12 +46,14 @@
|
||||||
|
|
||||||
#define FW_CFG_INVALID 0xffff
|
#define FW_CFG_INVALID 0xffff
|
||||||
|
|
||||||
|
#define FW_CFG_MAX_FILE_PATH 56
|
||||||
|
|
||||||
#ifndef NO_QEMU_PROTOS
|
#ifndef NO_QEMU_PROTOS
|
||||||
typedef struct FWCfgFile {
|
typedef struct FWCfgFile {
|
||||||
uint32_t size; /* file size */
|
uint32_t size; /* file size */
|
||||||
uint16_t select; /* write this to 0x510 to read it */
|
uint16_t select; /* write this to 0x510 to read it */
|
||||||
uint16_t reserved;
|
uint16_t reserved;
|
||||||
char name[56];
|
char name[FW_CFG_MAX_FILE_PATH];
|
||||||
} FWCfgFile;
|
} FWCfgFile;
|
||||||
|
|
||||||
typedef struct FWCfgFiles {
|
typedef struct FWCfgFiles {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue