Received: from eggs.gnu.org ([208.118.235.92]:51503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWoJN-0003Fb-Lr for qemu-devel@nongnu.org; Fri, 09 Nov 2012 08:07:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWoJF-0004Xr-Al for qemu-devel@nongnu.org; Fri, 09 Nov 2012 08:07:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWoJE-0004WJ-Vu for qemu-devel@nongnu.org; Fri, 09 Nov 2012 08:07:45 -0500 From: Eduardo Habkost Date: Fri, 9 Nov 2012 11:08:36 -0200 Message-Id: <1352466519-5779-22-git-send-email-ehabkost@redhat.com> In-Reply-To: <1352466519-5779-1-git-send-email-ehabkost@redhat.com> References: <1352466519-5779-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 21/24] qdev: add sysbus_get_default() GCC_WEAK stub List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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?= 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); -- 1.7.11.4