From patchwork Fri Nov 9 13:08:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [21/24] qdev: add sysbus_get_default() GCC_WEAK stub From: Eduardo Habkost X-Patchwork-Id: 198070 Message-Id: <1352466519-5779-22-git-send-email-ehabkost@redhat.com> To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, blauwirbel@gmail.com, Anthony Liguori , Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 9 Nov 2012 11:08:36 -0200 This version will be used on cases where sysbus.c is not compiled in (e.g. *-user). Signed-off-by: Eduardo Habkost --- hw/qdev-core.h | 2 +- hw/qdev.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/qdev-core.h b/hw/qdev-core.h index 494b687..19d9e03 100644 --- a/hw/qdev-core.h +++ b/hw/qdev-core.h @@ -194,7 +194,7 @@ void qbus_free(BusState *bus); #define FROM_QBUS(type, dev) DO_UPCAST(type, qbus, dev) /* This should go away once we get rid of the NULL bus hack */ -BusState *sysbus_get_default(void); +GCC_WEAK_DECL BusState *sysbus_get_default(void); char *qdev_get_fw_dev_path(DeviceState *dev); diff --git a/hw/qdev.c b/hw/qdev.c index fe4de96..1c4ff03 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -97,6 +97,18 @@ GCC_WEAK void vmstate_unregister(DeviceState *dev, { } + +/* sysbus stub functions + * + * The real implementation is on sysbus.c, but the stub functions will be used + * on cases where sysbus.c is not compiled in (e.g. *-user). + */ + +GCC_WEAK BusState *sysbus_get_default(void) +{ + return NULL; +} + const VMStateDescription *qdev_get_vmsd(DeviceState *dev) { DeviceClass *dc = DEVICE_GET_CLASS(dev);