On 18/06/17 21:23, Michael S. Tsirkin wrote: > On Sun, Jun 18, 2017 at 09:02:14AM +0100, Mark Cave-Ayland wrote: >> By exposing FWCfgIoState and FWCfgMemState internals we allow the possibility >> for the internal MemoryRegion fields to be mapped by name for boards that >> wish >> to wire up the fw_cfg device themselves. >> >> An additional minor tidy-up is that the FWCfgEntry typedef is moved from the >> struct definitions in fw_cfg.h to typedefs.h along with the others. >> >> Signed-off-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk> >> --- >> hw/nvram/fw_cfg.c | 55 ------------------------------------------ >> include/hw/nvram/fw_cfg.h | 58 >> +++++++++++++++++++++++++++++++++++++++++++++ >> include/qemu/typedefs.h | 1 + >> 3 files changed, 59 insertions(+), 55 deletions(-) >> >> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c >> index df99903..00771c9 100644 >> --- a/hw/nvram/fw_cfg.c >> +++ b/hw/nvram/fw_cfg.c >> @@ -40,14 +40,6 @@ >> #define FW_CFG_NAME "fw_cfg" >> #define FW_CFG_PATH "/machine/" FW_CFG_NAME >> >> -#define TYPE_FW_CFG "fw_cfg" >> -#define TYPE_FW_CFG_IO "fw_cfg_io" >> -#define TYPE_FW_CFG_MEM "fw_cfg_mem" >> - >> -#define FW_CFG(obj) OBJECT_CHECK(FWCfgState, (obj), TYPE_FW_CFG) >> -#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) >> - >> /* FW_CFG_VERSION bits */ >> #define FW_CFG_VERSION 0x01 >> #define FW_CFG_VERSION_DMA 0x02 >> @@ -61,53 +53,6 @@ >> >> #define FW_CFG_DMA_SIGNATURE 0x51454d5520434647ULL /* "QEMU CFG" */ >> >> -typedef struct FWCfgEntry { >> - uint32_t len; >> - bool allow_write; >> - uint8_t *data; >> - void *callback_opaque; >> - FWCfgReadCallback read_callback; >> -} FWCfgEntry; > > This still doesn't seem to do what Laszlo requested which is to keep as > many types and macros as possible in fw_cfg.c, only put typedefs in > fw_cfg.h.
Yes, that's my fault as I misinterpreted Laszlo's comment related to the typedef. Fortunately I see from Laszlo's follow-up email that the fix is fairly trivial. ATB, Mark.