target/arm: Make set_feature() available for other files

Move the common set_feature() and unset_feature() functions
from cpu.c and cpu64.c to cpu.h.

Backports commit 5fda95041d7237ab35733ceb66e0cb89f6107169 from qemu
This commit is contained in:
Thomas Huth 2020-05-11 17:02:12 -04:00 committed by Lioncash
parent cfe94f63f3
commit dfe548117e
3 changed files with 10 additions and 20 deletions

View file

@ -660,16 +660,6 @@ static QEMU_UNUSED_FUNC bool arm_cpu_is_big_endian(CPUState *cs)
return (env->cp15.sctlr_el[cur_el] & SCTLR_EE) != 0;
}
static inline void set_feature(CPUARMState *env, int feature)
{
env->features |= 1ULL << feature;
}
static inline void unset_feature(CPUARMState *env, int feature)
{
env->features &= ~(1ULL << feature);
}
#define ARM_CPUS_PER_CLUSTER 8
static void cpreg_hashtable_data_destroy(gpointer data)

View file

@ -691,6 +691,16 @@ typedef struct CPUARMState {
struct uc_struct *uc;
} CPUARMState;
static inline void set_feature(CPUARMState *env, int feature)
{
env->features |= 1ULL << feature;
}
static inline void unset_feature(CPUARMState *env, int feature)
{
env->features &= ~(1ULL << feature);
}
/**
* ARMELChangeHookFn:
* type of a function which can be registered via arm_register_el_change_hook()

View file

@ -25,16 +25,6 @@
#include "hw/arm/arm.h"
#include "sysemu/sysemu.h"
static inline void set_feature(CPUARMState *env, int feature)
{
env->features |= 1ULL << feature;
}
static inline QEMU_UNUSED_FUNC void unset_feature(CPUARMState *env, int feature)
{
env->features &= ~(1ULL << feature);
}
#ifndef CONFIG_USER_ONLY
static uint64_t a57_a53_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
{