Browse Source

target-info: Add page_bits_{init,vary}

Add two fields that will hold TARGET_PAGE_BITS,
TARGET_PAGE_BITS_VARY, TARGET_PAGE_BITS_LEGACY.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260217095106.598486-3-richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
master
Richard Henderson 2 months ago
committed by Philippe Mathieu-Daudé
parent
commit
afb94ae333
  1. 3
      configs/targets/aarch64-softmmu.c
  2. 3
      configs/targets/arm-softmmu.c
  3. 7
      include/qemu/target-info-impl.h
  4. 9
      target-info-stub.c

3
configs/targets/aarch64-softmmu.c

@ -10,6 +10,7 @@
#include "qemu/target-info-impl.h"
#include "hw/arm/machines-qom.h"
#include "target/arm/cpu-qom.h"
#include "target/arm/cpu-param.h"
static const TargetInfo target_info_aarch64_system = {
.target_name = "aarch64",
@ -18,6 +19,8 @@ static const TargetInfo target_info_aarch64_system = {
.cpu_type = TYPE_ARM_CPU,
.machine_typename = TYPE_TARGET_AARCH64_MACHINE,
.endianness = ENDIAN_MODE_LITTLE,
.page_bits_vary = true,
.page_bits_init = TARGET_PAGE_BITS_LEGACY,
};
const TargetInfo *target_info(void)

3
configs/targets/arm-softmmu.c

@ -10,6 +10,7 @@
#include "qemu/target-info-impl.h"
#include "hw/arm/machines-qom.h"
#include "target/arm/cpu-qom.h"
#include "target/arm/cpu-param.h"
static const TargetInfo target_info_arm_system = {
.target_name = "arm",
@ -18,6 +19,8 @@ static const TargetInfo target_info_arm_system = {
.cpu_type = TYPE_ARM_CPU,
.machine_typename = TYPE_TARGET_ARM_MACHINE,
.endianness = ENDIAN_MODE_LITTLE,
.page_bits_vary = true,
.page_bits_init = TARGET_PAGE_BITS_LEGACY,
};
const TargetInfo *target_info(void)

7
include/qemu/target-info-impl.h

@ -25,6 +25,13 @@ typedef struct TargetInfo {
const char *machine_typename;
/* related to TARGET_BIG_ENDIAN definition */
EndianMode endianness;
/*
* runtime equivalent of
* TARGET_PAGE_BITS_VARY ? TARGET_PAGE_BITS_LEGACY : TARGET_PAGE_BITS
*/
unsigned page_bits_init;
/* runtime equivalent of TARGET_PAGE_BITS_VARY definition */
bool page_bits_vary;
} TargetInfo;
/**

9
target-info-stub.c

@ -23,6 +23,15 @@ static const TargetInfo target_info_stub = {
.cpu_type = CPU_RESOLVING_TYPE,
.machine_typename = TYPE_MACHINE,
.endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE,
#ifdef TARGET_PAGE_BITS_VARY
.page_bits_vary = true,
# ifdef TARGET_PAGE_BITS_LEGACY
.page_bits_init = TARGET_PAGE_BITS_LEGACY,
# endif
#else
.page_bits_vary = false,
.page_bits_init = TARGET_PAGE_BITS,
#endif
};
const TargetInfo *target_info(void)

Loading…
Cancel
Save