Move hpet_find function from hpet.c to pc.c
PATCH 1/1 Move hpet_find function from hpet.c to pc.c
From: Miroslav Rezanina <[email protected]>
Function hpet_find could not be used for checking hpet availability becouse it was not build when hpet was disabled.
To allow proper use of this function, moving it from hw/timer/hpet.c to hw/i386/pc.c.
Signed-off-by Miroslav Rezanina <[email protected]>
--- hw/i386/pc.c | 5 +++++ hw/timer/hpet.c | 5 ----- include/hw/i386/pc.h | 2 ++ include/hw/timer/hpet.h | 1 - 4 files changed, 7 insertions(+), 6 deletions(-)
hw/i386/pc.c +5 -0
@@ -1403,3 +1403,8 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) gsi_state->ioapic_irq[i] =qdev_get_gpio_in (dev, i); } } + +bool hpet_find (void ) +{ +return object_resolve_path_type ("" ,"hpet" ,NULL ); +}
hw/timer/hpet.c +0 -5
@@ -757,11 +757,6 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->props = hpet_device_properties; } -bool hpet_find (void ) -{ -return object_resolve_path_type ("" ,TYPE_HPET ,NULL ); -} -static const TypeInfo hpet_device_info = { .name =TYPE_HPET , .parent =TYPE_SYS_BUS_DEVICE ,
include/hw/i386/pc.h +2 -0
@@ -178,6 +178,8 @@ void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);/* hpet.c */ extern int no_hpet; +bool hpet_find (void ); +/* piix_pci.c */ struct PCII440FXState ;typedef struct PCII440FXState PCII440FXState ;
include/hw/timer/hpet.h +0 -1
@@ -72,5 +72,4 @@ struct hpet_fw_configextern struct hpet_fw_config hpet_cfg; -bool hpet_find (void );#endif
Signature · 1 line
1.8.3.1
Quoted 9 lines · On Wed, Dec 11, 2013 at 12:59:37PM +0100, [email protected] wrote:
From: Miroslav Rezanina <[email protected]>
Function
hpet_findcould not be used for checking hpet availability becouse it was not build when hpet was disabled.To allow proper use of this function, moving it from
hw/timer/hpet.ctohw/i386/pc.c.Signed-off-by Miroslav Rezanina <[email protected]>
I fixed this already in a different way,
just making the function inline.
See
[PULL 27/28] hpet: fix build with CONFIG_HPET off
Quoted 62 lines
--- hw/i386/pc.c | 5 +++++ hw/timer/hpet.c | 5 ----- include/hw/i386/pc.h | 2 ++ include/hw/timer/hpet.h | 1 - 4 files changed, 7 insertions(+), 6 deletions(-)hw/i386/pc.c +5
-0@@ -1403,3 +1403,8 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) gsi_state->ioapic_irq[i] =qdev_get_gpio_in (dev, i); } } + +bool hpet_find (void ) +{ +return object_resolve_path_type ("" ,"hpet" ,NULL ); +}hw/timer/hpet.c +0
-5@@ -757,11 +757,6 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->props = hpet_device_properties; } -bool hpet_find (void ) -{ -return object_resolve_path_type ("" ,TYPE_HPET ,NULL ); -} -static const TypeInfo hpet_device_info = { .name =TYPE_HPET , .parent =TYPE_SYS_BUS_DEVICE ,include/hw/i386/pc.h +2
-0@@ -178,6 +178,8 @@ void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);/* hpet.c */ extern int no_hpet; +bool hpet_find (void ); +/* piix_pci.c */ struct PCII440FXState ;typedef struct PCII440FXState PCII440FXState ;include/hw/timer/hpet.h +0
-1@@ -72,5 +72,4 @@ struct hpet_fw_configextern struct hpet_fw_config hpet_cfg; -bool hpet_find (void );#endif Signature · 1 line
1.8.3.1