qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/6] decouple board headers from cpu.h
@ 2015-12-15 14:28 Paolo Bonzini
  2015-12-15 14:28 ` [Qemu-devel] [PATCH 1/6] arm: use "struct ARMCPU" in header files Paolo Bonzini
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Paolo Bonzini @ 2015-12-15 14:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-12-17 13:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-15 14:28 [Qemu-devel] [RFC PATCH 0/6] decouple board headers from cpu.h Paolo Bonzini
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

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).