From: "andrzej zaborowski" <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [Qemu-devel] [PATCH] remove target ifdefs from vl.c
Date: Tue, 29 Apr 2008 21:51:30 +0200 [thread overview]
Message-ID: <fb249edb0804291251v4210adf1nc55060f64b97e76d@mail.gmail.com> (raw)
In-Reply-To: <12094964432654-git-send-email-gcosta@redhat.com>
On 29/04/2008, Glauber Costa <gcosta@redhat.com> 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
prev parent reply other threads:[~2008-04-29 19:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-29 19:14 [Qemu-devel] [PATCH] remove target ifdefs from vl.c Glauber Costa
2008-04-29 19:51 ` andrzej zaborowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb249edb0804291251v4210adf1nc55060f64b97e76d@mail.gmail.com \
--to=balrogg@gmail.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).