[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] remove target ifdefs from vl.c
From: |
andrzej zaborowski |
Subject: |
Re: [Qemu-devel] [PATCH] remove target ifdefs from vl.c |
Date: |
Tue, 29 Apr 2008 21:51:30 +0200 |
On 29/04/2008, Glauber Costa <address@hidden> 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