qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [RFC PATCH 0/6] decouple board headers from cpu.h
Date: Tue, 15 Dec 2015 15:28:24 +0100	[thread overview]
Message-ID: <1450189710-18264-1-git-send-email-pbonzini@redhat.com> (raw)

Hi,

a while ago I started removing cpu.h dependencies from several headers
in QEMU.  In particular, I wanted to put an end to qemu-common.h's
including cpu.h and vice versa.  This is useful for two reasons: 1)
because both headers bring in a lot of dependencies and thus very small
changes can cause complete recompilations of target-dependent code;
2) in order to remove indirect inclusions of other header files, which
often come from cpu.h itself.

These patches are perhaps the only somewhat controversial part.
Generally, we add opaque typedefs to typedefs.h in order to avoid
indirect header inclusions.  However, this might not be desirable
for target specific types such as FooCPU.  These types are used
mostly in headers for boards, and thus this series uses struct
explicitly in those headers.  Adding a typedef breaks on older
compilers that do not like redefinitions of typedefs.

Everything else is just extremely boring: code movement out of
our catch-all header files, or pushing #includes down to the
users.

Opinions?

Paolo

Paolo Bonzini (6):
  arm: use "struct ARMCPU" in header files
  mips: use struct CPUMIPSState to avoid need for cpu.h
  ppc: use struct to avoid the need for cpu.h
  alpha: use AlphaCPU as an opaque type
  coldfire: use "struct M68kCPU" in header files
  sh: use SuperHCPU struct to avoid cpu.h dependency

 hw/alpha/alpha_sys.h        |  3 ++-
 hw/arm/strongarm.h          |  2 +-
 include/hw/arm/arm.h        | 12 +++++++-----
 include/hw/arm/exynos4210.h |  5 +++--
 include/hw/arm/omap.h       |  4 +++-
 include/hw/arm/pxa.h        |  8 +++++---
 include/hw/m68k/mcf.h       |  5 +++--
 include/hw/mips/cpudevs.h   |  6 ++++--
 include/hw/ppc/ppc.h        | 36 +++++++++++++++++++++---------------
 include/hw/ppc/ppc4xx.h     | 17 +++++++++++------
 include/hw/sh4/sh.h         |  3 ++-
 linux-user/main.c           |  4 ++--
 target-ppc/cpu.h            | 10 ++++------
 13 files changed, 68 insertions(+), 47 deletions(-)

-- 
1.8.3.1

             reply	other threads:[~2015-12-15 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 14:28 Paolo Bonzini [this message]
2015-12-15 14:28 ` [Qemu-devel] [PATCH 1/6] arm: use "struct ARMCPU" in header files Paolo Bonzini
2015-12-15 16:05   ` Peter Maydell
2015-12-17 13:45     ` Paolo Bonzini
2015-12-15 14:28 ` [Qemu-devel] [PATCH 2/6] mips: use struct CPUMIPSState to avoid need for cpu.h Paolo Bonzini
2015-12-15 14:28 ` [Qemu-devel] [PATCH 3/6] ppc: use struct to avoid the " Paolo Bonzini
2015-12-15 14:28 ` [Qemu-devel] [PATCH 4/6] alpha: use AlphaCPU as an opaque type Paolo Bonzini
2015-12-15 14:28 ` [Qemu-devel] [PATCH 5/6] coldfire: use "struct M68kCPU" in header files Paolo Bonzini
2015-12-15 14:28 ` [Qemu-devel] [PATCH 6/6] sh: use SuperHCPU struct to avoid cpu.h dependency Paolo Bonzini
2015-12-15 16:06 ` [Qemu-devel] [RFC PATCH 0/6] decouple board headers from cpu.h Peter Maydell
2015-12-15 16:50   ` Paolo Bonzini

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=1450189710-18264-1-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).