qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-4.1 v2 02/36] tcg: Split out target/arch/cpu


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH for-4.1 v2 02/36] tcg: Split out target/arch/cpu-param.h
Date: Mon, 29 Apr 2019 14:31:51 +0100

On Thu, 28 Mar 2019 at 23:40, Richard Henderson
<address@hidden> wrote:
>
> For all targets, into this new file move TARGET_LONG_BITS,
> TARGET_PAGE_BITS, TARGET_PHYS_ADDR_SPACE_BITS,
> TARGET_VIRT_ADDR_SPACE_BITS, and NB_MMU_MODES.
>
> Include this new file from exec/cpu-defs.h.
>
> This now removes the somewhat odd requirement that target/arch/cpu.h
> defines TARGET_LONG_BITS before including exec/cpu-defs.h, so push the
> bulk of the includes within target/arch/cpu.h to the top.
>
> Acked-by: Alistair Francis <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>


Your new headers all need the standard copyright/license
header comment and multiple-include guard.
> diff --git a/target/xtensa/cpu-param.h b/target/xtensa/cpu-param.h
> new file mode 100644
> index 0000000000..000e6026c0
> --- /dev/null
> +++ b/target/xtensa/cpu-param.h
> @@ -0,0 +1,9 @@
> +#define TARGET_LONG_BITS 32
> +#define TARGET_PAGE_BITS 12
> +#define TARGET_PHYS_ADDR_SPACE_BITS 32
> +#ifdef CONFIG_USER_ONLY
> +#define TARGET_VIRT_ADDR_SPACE_BITS 30
> +#else
> +#define TARGET_VIRT_ADDR_SPACE_BITS 32
> +#endif
> +#define NB_MMU_MODES 4
> diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h
> index 4d8152682f..93440357b0 100644
> --- a/target/xtensa/cpu.h
> +++ b/target/xtensa/cpu.h
> @@ -28,28 +28,17 @@
>  #ifndef XTENSA_CPU_H
>  #define XTENSA_CPU_H
>
> -#define ALIGNED_ONLY
> -#define TARGET_LONG_BITS 32
> -
> -/* Xtensa processors have a weak memory model */
> -#define TCG_GUEST_DEFAULT_MO      (0)
> -
> -#define CPUArchState struct CPUXtensaState
> -
>  #include "qemu-common.h"
>  #include "cpu-qom.h"
>  #include "exec/cpu-defs.h"
>  #include "xtensa-isa.h"
>
> -#define NB_MMU_MODES 4
> +#define ALIGNED_ONLY

ALIGNED_ONLY is a config thing that tcg.h needs to see -- if
we define it this low in the cpu.h file it seems a bit fragile
whether or not tcg.h will get included by something else
before we get to the definition... (This probably applies
to a few of the other cpu.h files too.)

Otherwise
Reviewed-by: Peter Maydell <address@hidden>

thanks
-- PMM



reply via email to

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