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>
This commit is contained in:
Richard Henderson
2026-02-17 19:51:01 +10:00
committed by Philippe Mathieu-Daudé
parent 40a5b6745e
commit afb94ae333
4 changed files with 22 additions and 0 deletions

View File

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

View File

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

View File

@@ -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;
/**

View File

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