Skip to content

Commit

Permalink
hpet: fix build with CONFIG_HPET off
Browse files Browse the repository at this point in the history
make hpet_find inline so we don't need
to build hpet.c to check if hpet is enabled.

Fixes link error with CONFIG_HPET off.

Cc: qemu-stable@nongnu.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
mstsirkin committed Dec 11, 2013
1 parent 8ac2adf commit 142e095
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 0 additions & 6 deletions hw/timer/hpet.c
Expand Up @@ -42,7 +42,6 @@

#define HPET_MSI_SUPPORT 0

#define TYPE_HPET "hpet"
#define HPET(obj) OBJECT_CHECK(HPETState, (obj), TYPE_HPET)

struct HPETState;
Expand Down Expand Up @@ -772,11 +771,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,
Expand Down
10 changes: 9 additions & 1 deletion include/hw/timer/hpet.h
Expand Up @@ -13,6 +13,8 @@
#ifndef QEMU_HPET_EMUL_H
#define QEMU_HPET_EMUL_H

#include "qom/object.h"

#define HPET_BASE 0xfed00000
#define HPET_CLK_PERIOD 10000000ULL /* 10000000 femtoseconds == 10ns*/

Expand Down Expand Up @@ -72,5 +74,11 @@ struct hpet_fw_config

extern struct hpet_fw_config hpet_cfg;

bool hpet_find(void);
#define TYPE_HPET "hpet"

static inline bool hpet_find(void)
{
return object_resolve_path_type("", TYPE_HPET, NULL);
}

#endif

0 comments on commit 142e095

Please sign in to comment.