fw_cfg: import & use linux/qemu_fw_cfg.h

Use kernel common header for fw_cfg.

(unfortunately, optionrom.h must have its own define, since it's
actually an assembler header)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180817155910.5722-2-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2018-08-17 17:59:10 +02:00 committed by Paolo Bonzini
parent 039d7c4d53
commit 5be5df720e
11 changed files with 125 additions and 80 deletions

View file

@ -2,7 +2,7 @@
#define FW_CFG_H
#include "exec/hwaddr.h"
#include "hw/nvram/fw_cfg_keys.h"
#include "standard-headers/linux/qemu_fw_cfg.h"
#include "hw/sysbus.h"
#include "sysemu/dma.h"
@ -14,12 +14,7 @@
#define FW_CFG_IO(obj) OBJECT_CHECK(FWCfgIoState, (obj), TYPE_FW_CFG_IO)
#define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM)
typedef struct FWCfgFile {
uint32_t size; /* file size */
uint16_t select; /* write this to 0x510 to read it */
uint16_t reserved;
char name[FW_CFG_MAX_FILE_PATH];
} FWCfgFile;
typedef struct fw_cfg_file FWCfgFile;
#define FW_CFG_ORDER_OVERRIDE_VGA 70
#define FW_CFG_ORDER_OVERRIDE_NIC 80
@ -34,14 +29,7 @@ typedef struct FWCfgFiles {
FWCfgFile f[];
} FWCfgFiles;
/* Control as first field allows for different structures selected by this
* field, which might be useful in the future
*/
typedef struct FWCfgDmaAccess {
uint32_t control;
uint32_t length;
uint64_t address;
} QEMU_PACKED FWCfgDmaAccess;
typedef struct fw_cfg_dma_access FWCfgDmaAccess;
typedef void (*FWCfgCallback)(void *opaque);
typedef void (*FWCfgWriteCallback)(void *opaque, off_t start, size_t len);