From patchwork Mon May 11 15:10:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 470878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 942AB140187 for ; Tue, 12 May 2015 01:10:52 +1000 (AEST) Received: from localhost ([::1]:38109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrpM2-00026x-LL for incoming@patchwork.ozlabs.org; Mon, 11 May 2015 11:10:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrpLg-0001pK-CP for qemu-devel@nongnu.org; Mon, 11 May 2015 11:10:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrpLd-00060i-Cq for qemu-devel@nongnu.org; Mon, 11 May 2015 11:10:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrpLd-00060J-6B for qemu-devel@nongnu.org; Mon, 11 May 2015 11:10:25 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4BFAO5X004645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 11 May 2015 11:10:24 -0400 Received: from blackfin.pond.sub.org (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4BFAMFg022969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 11 May 2015 11:10:24 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D1B1530438E3; Mon, 11 May 2015 17:10:21 +0200 (CEST) From: Markus Armbruster To: Miroslav Rezanina References: <1431322734-12520-1-git-send-email-mrezanin@redhat.com> <87bnhry5l0.fsf@blackfin.pond.sub.org> <20150511070222.GA2655@lws.brq.redhat.com> Date: Mon, 11 May 2015 17:10:21 +0200 In-Reply-To: <20150511070222.GA2655@lws.brq.redhat.com> (Miroslav Rezanina's message of "Mon, 11 May 2015 09:02:22 +0200") Message-ID: <87k2wfb15u.fsf@blackfin.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: thuth@redhat.com, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCHv2] parallel: Allow to disable CONFIG_PARALLEL X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Miroslav Rezanina writes: > On Mon, May 11, 2015 at 08:46:19AM +0200, Markus Armbruster wrote: >> mrezanin@redhat.com writes: >> >> > From: Miroslav Rezanina >> > >> > Disabling CONFIG_PARALLEL cause build failure as commit 07dc788 factored >> > out initialization to parallel_hds_isa_init function in hw/char/parallel.c >> > that is not build. >> > >> > Stub file is added to be able to disable CONFIG_PARALLEL. This file is used >> > in targets using parallel_hds_isa_init and provide empty definition of this >> > function. >> > >> > Signed-off-by: Miroslav Rezanina >> > >> > --- >> > hw/i386/Makefile.objs | 1 + >> > hw/mips/Makefile.objs | 2 ++ >> > hw/sparc64/Makefile.objs | 2 ++ >> > stubs/parallel-stub.c | 7 +++++++ >> >> Nitpick: the existing stub/*.c naming practice suggests >> stubs/parallel.c. > > Yeah...I forget to rename it after moving from repository > root to stub directory. I originally have it in repository > root as it is not included in libqemustub. So the naming can > be treated as hint that something is different. However, > I can rename it to follow stubs/* naming. >> >> > 4 files changed, 12 insertions(+) >> > create mode 100644 stubs/parallel-stub.c >> > >> > diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs >> > index e058a39..2b7131a 100644 >> > --- a/hw/i386/Makefile.objs >> > +++ b/hw/i386/Makefile.objs >> > @@ -4,6 +4,7 @@ obj-y += pc.o pc_piix.o pc_q35.o >> > obj-y += pc_sysfw.o >> > obj-y += intel_iommu.o >> > obj-$(CONFIG_XEN) += ../xenpv/ xen/ >> > +obj-$(call lnot,$(CONFIG_PARALLEL)) += ../../stubs/parallel-stub.o >> > >> > obj-y += kvmvapic.o >> > obj-y += acpi-build.o >> >> Can we rely on the linker to pull parallel-stub.o from a suitable .a >> libqemustub.a when needed? > > We do not have to as parallel-stub.o is not included in libqemustub.a. > It is linked directly in case CONFIG_PARALLEL is not defined (for > targets using parallel_hds_isa_init). No other stub is linked conditionally like that. Instead we simply let the linker pick up stubs as needed. Let's do the same here. Sketch: diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 8beff4c..ad4e110 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -24,6 +24,7 @@ stub-obj-y += mon-printf.o stub-obj-y += mon-set-error.o stub-obj-y += monitor-init.o stub-obj-y += notify-event.o +stub-obj-y += parallel.o stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o stub-obj-y += qtest.o stub-obj-y += reset.o diff --git a/stubs/parallel.c b/stubs/parallel.c new file mode 100644 index 0000000..2fa7e3a --- /dev/null +++ b/stubs/parallel.c @@ -0,0 +1,12 @@ +#include "hw/i386/pc.h" + +void parallel_hds_isa_init(ISABus *bus, int n) +{ +} + +bool parallel_mm_init(MemoryRegion *address_space, + hwaddr base, int it_shift, qemu_irq irq, + CharDriverState *chr) +{ + return false; +} Links fine with this crude test patch on top: diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs index 5931cc8..c736436 100644 --- a/hw/char/Makefile.objs +++ b/hw/char/Makefile.objs @@ -1,6 +1,6 @@ common-obj-$(CONFIG_IPACK) += ipoctal232.o common-obj-$(CONFIG_ESCC) += escc.o -common-obj-$(CONFIG_PARALLEL) += parallel.o +#common-obj-$(CONFIG_PARALLEL) += parallel.o common-obj-$(CONFIG_PL011) += pl011.o common-obj-$(CONFIG_SERIAL) += serial.o serial-isa.o common-obj-$(CONFIG_SERIAL_PCI) += serial-pci.o