From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JqvrU-0004P3-Fy for qemu-devel@nongnu.org; Tue, 29 Apr 2008 15:51:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JqvrT-0004Or-3p for qemu-devel@nongnu.org; Tue, 29 Apr 2008 15:51:36 -0400 Received: from [199.232.76.173] (port=56900 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqvrT-0004Oo-0k for qemu-devel@nongnu.org; Tue, 29 Apr 2008 15:51:35 -0400 Received: from ug-out-1314.google.com ([66.249.92.173]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JqvrS-0002qS-G1 for qemu-devel@nongnu.org; Tue, 29 Apr 2008 15:51:34 -0400 Received: by ug-out-1314.google.com with SMTP id m2so1226144uge.4 for ; Tue, 29 Apr 2008 12:51:30 -0700 (PDT) Message-ID: Date: Tue, 29 Apr 2008 21:51:30 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [PATCH] remove target ifdefs from vl.c In-Reply-To: <12094964432654-git-send-email-gcosta@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <12094964432654-git-send-email-gcosta@redhat.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel@lists.sourceforge.net On 29/04/2008, Glauber Costa wrote: > This patch goes towards the direction of increasing general modularity of the > code. Code in vl.c that used to live inside target ifdefs, are moved to inside the > target directories, in a new file called machine.c. They are the cpu save/load and machine > registration Good idea, I had a similar patch to move cpu save/load to target-*/helper.c but I postponed it because it would make the libqemu.a depend on vl.c. > --- > Makefile.target | 5 +- > hw/boards.h | 1 + > target-arm/machine.c | 211 +++++++++++++++++ > target-cris/machine.c | 7 + > target-i386/machine.c | 264 +++++++++++++++++++++ > target-m68k/machine.c | 9 + > target-mips/machine.c | 21 ++ > target-ppc/machine.c | 20 ++ > target-sh4/machine.c | 8 + > target-sparc/machine.c | 102 ++++++++ > vl.c | 616 ------------------------------------------------ > 11 files changed, 647 insertions(+), 617 deletions(-) > create mode 100644 target-arm/machine.c > create mode 100644 target-cris/machine.c > create mode 100644 target-i386/machine.c > create mode 100644 target-m68k/machine.c > create mode 100644 target-mips/machine.c > create mode 100644 target-ppc/machine.c > create mode 100644 target-sh4/machine.c > create mode 100644 target-sparc/machine.c > > diff --git a/Makefile.target b/Makefile.target > index 5ac29a7..a530ee5 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -303,6 +303,9 @@ gen-op.h: op.o $(DYNGEN) > op.o: op.c > $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< > > +machine.o: machine.c > + $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< > + > # HELPER_CFLAGS is used for all the code compiled with static register > # variables > ifeq ($(TARGET_BASE_ARCH), i386) > @@ -481,7 +484,7 @@ endif #CONFIG_DARWIN_USER > # System emulator target > ifndef CONFIG_USER_ONLY > > -OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o > +OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o > ifdef CONFIG_WIN32 > OBJS+=block-raw-win32.o > else > diff --git a/hw/boards.h b/hw/boards.h > index affcaa6..ada4664 100644 > --- a/hw/boards.h > +++ b/hw/boards.h > @@ -18,6 +18,7 @@ typedef struct QEMUMachine { > } QEMUMachine; > > int qemu_register_machine(QEMUMachine *m); > +void register_machines(void); > > /* Axis ETRAX. */ > extern QEMUMachine bareetraxfs_machine; > diff --git a/target-arm/machine.c b/target-arm/machine.c > new file mode 100644 > index 0000000..d8de189 > --- /dev/null > +++ b/target-arm/machine.c > @@ -0,0 +1,211 @@ > +#include "hw/hw.h" > +#include "hw/boards.h" > + > +void register_machines(void) > +{ > + qemu_register_machine(&integratorcp_machine); > + qemu_register_machine(&versatilepb_machine); > + qemu_register_machine(&versatileab_machine); > + qemu_register_machine(&realview_machine); > + qemu_register_machine(&akitapda_machine); > + qemu_register_machine(&spitzpda_machine); > + qemu_register_machine(&borzoipda_machine); > + qemu_register_machine(&terrierpda_machine); > + qemu_register_machine(&palmte_machine); > + qemu_register_machine(&lm3s811evb_machine); > + qemu_register_machine(&lm3s6965evb_machine); > + qemu_register_machine(&connex_machine); > + qemu_register_machine(&verdex_machine); > + qemu_register_machine(&mainstone2_machine); > +} This list is a bit outdated and the new files lack licenses. Regards