qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 0/6] decouple board headers from cpu.h


From: Paolo Bonzini
Subject: [Qemu-devel] [RFC PATCH 0/6] decouple board headers from cpu.h
Date: Tue, 15 Dec 2015 15:28:24 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]