From dfe548117ea11cf81faf693a79bb019e07ffe4eb Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 11 May 2020 17:02:12 -0400 Subject: [PATCH] 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 --- qemu/target/arm/cpu.c | 10 ---------- qemu/target/arm/cpu.h | 10 ++++++++++ qemu/target/arm/cpu64.c | 10 ---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/qemu/target/arm/cpu.c b/qemu/target/arm/cpu.c index 2a712ada..e7bc8fd7 100644 --- a/qemu/target/arm/cpu.c +++ b/qemu/target/arm/cpu.c @@ -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) diff --git a/qemu/target/arm/cpu.h b/qemu/target/arm/cpu.h index 7093fd5f..47614a5c 100644 --- a/qemu/target/arm/cpu.h +++ b/qemu/target/arm/cpu.h @@ -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() diff --git a/qemu/target/arm/cpu64.c b/qemu/target/arm/cpu64.c index c709809b..934475de 100644 --- a/qemu/target/arm/cpu64.c +++ b/qemu/target/arm/cpu64.c @@ -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) {