Skip to content

Commit

Permalink
target/arm: Move feature test functions to their own header
Browse files Browse the repository at this point in the history
The feature test functions isar_feature_*() now take up nearly
a thousand lines in target/arm/cpu.h. This header file is included
by a lot of source files, most of which don't need these functions.
Move the feature test functions to their own header file.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20231024163510.2972081-2-peter.maydell@linaro.org
  • Loading branch information
pm215 committed Oct 27, 2023
1 parent dfff100 commit 5a53431
Show file tree
Hide file tree
Showing 29 changed files with 1,028 additions and 972 deletions.
1 change: 1 addition & 0 deletions bsd-user/arm/target_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define TARGET_ARCH_H

#include "qemu.h"
#include "target/arm/cpu-features.h"

void target_cpu_set_tls(CPUARMState *env, target_ulong newtls);
target_ulong target_cpu_get_tls(CPUARMState *env);
Expand Down
1 change: 1 addition & 0 deletions hw/arm/armv7m.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "qemu/module.h"
#include "qemu/log.h"
#include "target/arm/idau.h"
#include "target/arm/cpu-features.h"
#include "migration/vmstate.h"

/* Bitbanded IO. Each word corresponds to a single bit. */
Expand Down
1 change: 1 addition & 0 deletions hw/intc/armv7m_nvic.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "sysemu/tcg.h"
#include "sysemu/runstate.h"
#include "target/arm/cpu.h"
#include "target/arm/cpu-features.h"
#include "exec/exec-all.h"
#include "exec/memop.h"
#include "qemu/log.h"
Expand Down
1 change: 1 addition & 0 deletions linux-user/aarch64/cpu_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "qemu/guest-random.h"
#include "semihosting/common-semi.h"
#include "target/arm/syndrome.h"
#include "target/arm/cpu-features.h"

#define get_user_code_u32(x, gaddr, env) \
({ abi_long __r = get_user_u32((x), (gaddr)); \
Expand Down
1 change: 1 addition & 0 deletions linux-user/aarch64/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "user-internals.h"
#include "signal-common.h"
#include "linux-user/trace.h"
#include "target/arm/cpu-features.h"

struct target_sigcontext {
uint64_t fault_address;
Expand Down
2 changes: 2 additions & 0 deletions linux-user/aarch64/target_prctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef AARCH64_TARGET_PRCTL_H
#define AARCH64_TARGET_PRCTL_H

#include "target/arm/cpu-features.h"

static abi_long do_prctl_sve_get_vl(CPUArchState *env)
{
ARMCPU *cpu = env_archcpu(env);
Expand Down
1 change: 1 addition & 0 deletions linux-user/arm/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "user-internals.h"
#include "signal-common.h"
#include "linux-user/trace.h"
#include "target/arm/cpu-features.h"

struct target_sigcontext {
abi_ulong trap_no;
Expand Down
4 changes: 4 additions & 0 deletions linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include "target_signal.h"
#include "accel/tcg/debuginfo.h"

#ifdef TARGET_ARM
#include "target/arm/cpu-features.h"
#endif

#ifdef _ARCH_PPC64
#undef ARCH_DLINFO
#undef ELF_PLATFORM
Expand Down
4 changes: 4 additions & 0 deletions linux-user/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include "target_mman.h"
#include "qemu/interval-tree.h"

#ifdef TARGET_ARM
#include "target/arm/cpu-features.h"
#endif

static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER;
static __thread int mmap_lock_count;

Expand Down
1 change: 1 addition & 0 deletions target/arm/arch_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "cpu.h"
#include "elf.h"
#include "sysemu/dump.h"
#include "cpu-features.h"

/* struct user_pt_regs from arch/arm64/include/uapi/asm/ptrace.h */
struct aarch64_user_regs {
Expand Down

0 comments on commit 5a53431

Please sign in to comment.