diff options
author | Laurent Vivier <laurent@vivier.eu> | 2018-05-29 21:42:00 +0200 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2018-06-04 01:30:44 +0200 |
commit | 9850f9f63acb44724138a2b89b07ea4f6b3d2ba0 (patch) | |
tree | 7b93dc56fa31b54b2d910a61322aeda972148f8e | |
parent | 995d2004b739a2a8ff60f9a0dda8c53bbdcceccf (diff) | |
download | qemu-9850f9f63acb44724138a2b89b07ea4f6b3d2ba0.zip qemu-9850f9f63acb44724138a2b89b07ea4f6b3d2ba0.tar.gz qemu-9850f9f63acb44724138a2b89b07ea4f6b3d2ba0.tar.bz2 |
linux-user: move get_sp_from_cpustate() to target_cpu.h
Remove useless includes
Fix HPPA include guard.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180529194207.31503-9-laurent@vivier.eu>
60 files changed, 83 insertions, 177 deletions
diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c index f95dc61..07fedfc 100644 --- a/linux-user/aarch64/signal.c +++ b/linux-user/aarch64/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.h index 777ce29..a021c95 100644 --- a/linux-user/aarch64/target_cpu.h +++ b/linux-user/aarch64/target_cpu.h @@ -35,4 +35,8 @@ static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) env->cp15.tpidr_el[0] = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUARMState *state) +{ + return state->xregs[31]; +} #endif diff --git a/linux-user/aarch64/target_signal.h b/linux-user/aarch64/target_signal.h index 0b7ae25..18599b1 100644 --- a/linux-user/aarch64/target_signal.h +++ b/linux-user/aarch64/target_signal.h @@ -1,8 +1,6 @@ #ifndef AARCH64_TARGET_SIGNAL_H #define AARCH64_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,10 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUARMState *state) -{ - return state->xregs[31]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* AARCH64_TARGET_SIGNAL_H */ diff --git a/linux-user/alpha/signal.c b/linux-user/alpha/signal.c index f24de02..c5c27ce 100644 --- a/linux-user/alpha/signal.c +++ b/linux-user/alpha/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h index ad124da..ac4d255 100644 --- a/linux-user/alpha/target_cpu.h +++ b/linux-user/alpha/target_cpu.h @@ -33,4 +33,8 @@ static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls) env->unique = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state) +{ + return state->ir[IR_SP]; +} #endif diff --git a/linux-user/alpha/target_signal.h b/linux-user/alpha/target_signal.h index 4e912e1..e6f2f04 100644 --- a/linux-user/alpha/target_signal.h +++ b/linux-user/alpha/target_signal.h @@ -1,8 +1,6 @@ #ifndef ALPHA_TARGET_SIGNAL_H #define ALPHA_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -22,12 +20,6 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 4096 #define TARGET_SIGSTKSZ 16384 -static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state) -{ - return state->ir[IR_SP]; -} - - /* From <asm/gentrap.h>. */ #define TARGET_GEN_INTOVF -1 /* integer overflow */ #define TARGET_GEN_INTDIV -2 /* integer division by zero */ diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c index 59b5b65..b0e7538 100644 --- a/linux-user/arm/signal.c +++ b/linux-user/arm/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index c3eb4b2..8a37649 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -49,4 +49,8 @@ static inline target_ulong cpu_get_tls(CPUARMState *env) } } +static inline abi_ulong get_sp_from_cpustate(CPUARMState *state) +{ + return state->regs[13]; +} #endif diff --git a/linux-user/arm/target_signal.h b/linux-user/arm/target_signal.h index d6a03ec..f80eb0a 100644 --- a/linux-user/arm/target_signal.h +++ b/linux-user/arm/target_signal.h @@ -1,8 +1,6 @@ #ifndef ARM_TARGET_SIGNAL_H #define ARM_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,10 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUARMState *state) -{ - return state->regs[13]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* ARM_TARGET_SIGNAL_H */ diff --git a/linux-user/cris/signal.c b/linux-user/cris/signal.c index 322d9db..0b40524 100644 --- a/linux-user/cris/signal.c +++ b/linux-user/cris/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/cris/target_cpu.h b/linux-user/cris/target_cpu.h index c43aac6..2309343 100644 --- a/linux-user/cris/target_cpu.h +++ b/linux-user/cris/target_cpu.h @@ -33,4 +33,8 @@ static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls) env->pregs[PR_PID] = (env->pregs[PR_PID] & 0xff) | newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state) +{ + return state->regs[14]; +} #endif diff --git a/linux-user/cris/target_signal.h b/linux-user/cris/target_signal.h index 74ff2f3..bf404a8 100644 --- a/linux-user/cris/target_signal.h +++ b/linux-user/cris/target_signal.h @@ -1,8 +1,6 @@ #ifndef CRIS_TARGET_SIGNAL_H #define CRIS_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,10 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state) -{ - return state->regs[14]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* CRIS_TARGET_SIGNAL_H */ diff --git a/linux-user/hppa/signal.c b/linux-user/hppa/signal.c index 6e7a295..b6927ee 100644 --- a/linux-user/hppa/signal.c +++ b/linux-user/hppa/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index 7b78bbe..1c539bd 100644 --- a/linux-user/hppa/target_cpu.h +++ b/linux-user/hppa/target_cpu.h @@ -16,8 +16,8 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef ALPHA_TARGET_CPU_H -#define ALPHA_TARGET_CPU_H +#ifndef HPPA_TARGET_CPU_H +#define HPPA_TARGET_CPU_H static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp) { @@ -36,4 +36,8 @@ static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls) env->cr[27] = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUHPPAState *state) +{ + return state->gr[30]; +} #endif diff --git a/linux-user/hppa/target_signal.h b/linux-user/hppa/target_signal.h index f28b4bf..1beae64 100644 --- a/linux-user/hppa/target_signal.h +++ b/linux-user/hppa/target_signal.h @@ -1,8 +1,6 @@ #ifndef HPPA_TARGET_SIGNAL_H #define HPPA_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,8 +19,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUHPPAState *state) -{ - return state->gr[30]; -} #endif /* HPPA_TARGET_SIGNAL_H */ diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index e9a23a2..fecb4c9 100644 --- a/linux-user/i386/signal.c +++ b/linux-user/i386/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/i386/target_cpu.h b/linux-user/i386/target_cpu.h index 7fbcf9b..ece04d0 100644 --- a/linux-user/i386/target_cpu.h +++ b/linux-user/i386/target_cpu.h @@ -45,4 +45,8 @@ static inline void cpu_set_tls(CPUX86State *env, target_ulong newtls) } #endif /* defined(TARGET_ABI32) */ +static inline abi_ulong get_sp_from_cpustate(CPUX86State *state) +{ + return state->regs[R_ESP]; +} #endif /* I386_TARGET_CPU_H */ diff --git a/linux-user/i386/target_signal.h b/linux-user/i386/target_signal.h index 6ad4089..8a284f4 100644 --- a/linux-user/i386/target_signal.h +++ b/linux-user/i386/target_signal.h @@ -1,8 +1,6 @@ #ifndef I386_TARGET_SIGNAL_H #define I386_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,10 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUX86State *state) -{ - return state->regs[R_ESP]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* I386_TARGET_SIGNAL_H */ diff --git a/linux-user/m68k/signal.c b/linux-user/m68k/signal.c index 5dd8bb5..38bd77e 100644 --- a/linux-user/m68k/signal.c +++ b/linux-user/m68k/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/m68k/target_cpu.h b/linux-user/m68k/target_cpu.h index cc0bfc2..611df06 100644 --- a/linux-user/m68k/target_cpu.h +++ b/linux-user/m68k/target_cpu.h @@ -37,4 +37,8 @@ static inline void cpu_set_tls(CPUM68KState *env, target_ulong newtls) ts->tp_value = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state) +{ + return state->aregs[7]; +} #endif diff --git a/linux-user/m68k/target_signal.h b/linux-user/m68k/target_signal.h index ff303f2..0cf26b7 100644 --- a/linux-user/m68k/target_signal.h +++ b/linux-user/m68k/target_signal.h @@ -1,8 +1,6 @@ #ifndef M68K_TARGET_SIGNAL_H #define M68K_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,10 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state) -{ - return state->aregs[7]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* M68K_TARGET_SIGNAL_H */ diff --git a/linux-user/microblaze/signal.c b/linux-user/microblaze/signal.c index fada0f1..712ee52 100644 --- a/linux-user/microblaze/signal.c +++ b/linux-user/microblaze/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/target_cpu.h index 7dd979f..73e1399 100644 --- a/linux-user/microblaze/target_cpu.h +++ b/linux-user/microblaze/target_cpu.h @@ -32,4 +32,8 @@ static inline void cpu_set_tls(CPUMBState *env, target_ulong newtls) env->regs[21] = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUMBState *state) +{ + return state->regs[1]; +} #endif diff --git a/linux-user/microblaze/target_signal.h b/linux-user/microblaze/target_signal.h index 9fe4048..86adcc1 100644 --- a/linux-user/microblaze/target_signal.h +++ b/linux-user/microblaze/target_signal.h @@ -1,8 +1,6 @@ #ifndef MICROBLAZE_TARGET_SIGNAL_H #define MICROBLAZE_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,10 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUMBState *state) -{ - return state->regs[1]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* MICROBLAZE_TARGET_SIGNAL_H */ diff --git a/linux-user/mips/signal.c b/linux-user/mips/signal.c index ed9849c..6aa303e 100644 --- a/linux-user/mips/signal.c +++ b/linux-user/mips/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h index 2002920..02cf5ee 100644 --- a/linux-user/mips/target_cpu.h +++ b/linux-user/mips/target_cpu.h @@ -33,4 +33,8 @@ static inline void cpu_set_tls(CPUMIPSState *env, target_ulong newtls) env->active_tc.CP0_UserLocal = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) +{ + return state->active_tc.gpr[29]; +} #endif diff --git a/linux-user/mips/target_signal.h b/linux-user/mips/target_signal.h index d36f5da..5f68bd7 100644 --- a/linux-user/mips/target_signal.h +++ b/linux-user/mips/target_signal.h @@ -1,8 +1,6 @@ #ifndef MIPS_TARGET_SIGNAL_H #define MIPS_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,11 +19,6 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) -{ - return state->active_tc.gpr[29]; -} - #if defined(TARGET_ABI_MIPSO32) /* compare linux/arch/mips/kernel/signal.c:setup_frame() */ #define TARGET_ARCH_HAS_SETUP_FRAME diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h index c074e15..7fe6b2f 100644 --- a/linux-user/mips64/target_signal.h +++ b/linux-user/mips64/target_signal.h @@ -1,8 +1,6 @@ #ifndef MIPS64_TARGET_SIGNAL_H #define MIPS64_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,8 +19,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) -{ - return state->active_tc.gpr[29]; -} #endif /* MIPS64_TARGET_SIGNAL_H */ diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index 9a0b36e..4985dc2 100644 --- a/linux-user/nios2/signal.c +++ b/linux-user/nios2/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/nios2/target_cpu.h b/linux-user/nios2/target_cpu.h index 20ab479..14f6333 100644 --- a/linux-user/nios2/target_cpu.h +++ b/linux-user/nios2/target_cpu.h @@ -36,4 +36,8 @@ static inline void cpu_set_tls(CPUNios2State *env, target_ulong newtls) */ } +static inline abi_ulong get_sp_from_cpustate(CPUNios2State *state) +{ + return state->regs[R_SP]; +} #endif diff --git a/linux-user/nios2/target_signal.h b/linux-user/nios2/target_signal.h index f4db4d6..1f09f1e 100644 --- a/linux-user/nios2/target_signal.h +++ b/linux-user/nios2/target_signal.h @@ -1,8 +1,6 @@ #ifndef TARGET_SIGNAL_H #define TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -18,8 +16,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUNios2State *state) -{ - return state->regs[R_SP]; -} #endif /* TARGET_SIGNAL_H */ diff --git a/linux-user/openrisc/signal.c b/linux-user/openrisc/signal.c index ecf2897..8be0b74 100644 --- a/linux-user/openrisc/signal.c +++ b/linux-user/openrisc/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_cpu.h index 606ad6f..d1ea450 100644 --- a/linux-user/openrisc/target_cpu.h +++ b/linux-user/openrisc/target_cpu.h @@ -33,4 +33,8 @@ static inline void cpu_set_tls(CPUOpenRISCState *env, target_ulong newtls) cpu_set_gpr(env, 10, newtls); } +static inline abi_ulong get_sp_from_cpustate(CPUOpenRISCState *state) +{ + return cpu_get_gpr(state, 1); +} #endif diff --git a/linux-user/openrisc/target_signal.h b/linux-user/openrisc/target_signal.h index 2a4e00b..5903833 100644 --- a/linux-user/openrisc/target_signal.h +++ b/linux-user/openrisc/target_signal.h @@ -1,8 +1,6 @@ #ifndef OPENRISC_TARGET_SIGNAL_H #define OPENRISC_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -18,8 +16,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUOpenRISCState *state) -{ - return cpu_get_gpr(state, 1); -} #endif /* OPENRISC_TARGET_SIGNAL_H */ diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c index cacc9af..ef4c518 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/ppc/target_cpu.h b/linux-user/ppc/target_cpu.h index 3aab3d1..c464183 100644 --- a/linux-user/ppc/target_cpu.h +++ b/linux-user/ppc/target_cpu.h @@ -47,5 +47,8 @@ static inline uint32_t get_ppc64_abi(struct image_info *infop) return infop->elf_flags & EF_PPC64_ABI; } - +static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state) +{ + return state->gpr[1]; +} #endif diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h index e3bf1d2..6f9e67e 100644 --- a/linux-user/ppc/target_signal.h +++ b/linux-user/ppc/target_signal.h @@ -1,8 +1,6 @@ #ifndef PPC_TARGET_SIGNAL_H #define PPC_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,11 +19,6 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state) -{ - return state->gpr[1]; -} - #if !defined(TARGET_PPC64) #define TARGET_ARCH_HAS_SETUP_FRAME #endif diff --git a/linux-user/qemu.h b/linux-user/qemu.h index c55c8e2..6fa1e96 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -623,7 +623,6 @@ static inline void *lock_user_string(abi_ulong guest_addr) * above, so include them last. */ #include "target_cpu.h" -#include "target_signal.h" #include "target_structs.h" #endif /* QEMU_H */ diff --git a/linux-user/riscv/signal.c b/linux-user/riscv/signal.c index ef599e3..f598d41 100644 --- a/linux-user/riscv/signal.c +++ b/linux-user/riscv/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/riscv/target_cpu.h b/linux-user/riscv/target_cpu.h index c5549b1..7e090f3 100644 --- a/linux-user/riscv/target_cpu.h +++ b/linux-user/riscv/target_cpu.h @@ -15,4 +15,8 @@ static inline void cpu_set_tls(CPURISCVState *env, target_ulong newtls) env->gpr[xTP] = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPURISCVState *state) +{ + return state->gpr[xSP]; +} #endif diff --git a/linux-user/riscv/target_signal.h b/linux-user/riscv/target_signal.h index 9dac002..c7fa357 100644 --- a/linux-user/riscv/target_signal.h +++ b/linux-user/riscv/target_signal.h @@ -1,8 +1,6 @@ #ifndef TARGET_SIGNAL_H #define TARGET_SIGNAL_H -#include "cpu.h" - typedef struct target_sigaltstack { abi_ulong ss_sp; abi_int ss_flags; @@ -15,8 +13,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPURISCVState *state) -{ - return state->gpr[xSP]; -} #endif /* TARGET_SIGNAL_H */ diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index e35cbe6..3d3cb67 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/s390x/target_cpu.h b/linux-user/s390x/target_cpu.h index 87ea4d2..66ef8aa 100644 --- a/linux-user/s390x/target_cpu.h +++ b/linux-user/s390x/target_cpu.h @@ -36,4 +36,8 @@ static inline void cpu_set_tls(CPUS390XState *env, target_ulong newtls) env->aregs[1] = newtls & 0xffffffffULL; } +static inline abi_ulong get_sp_from_cpustate(CPUS390XState *state) +{ + return state->regs[15]; +} #endif diff --git a/linux-user/s390x/target_signal.h b/linux-user/s390x/target_signal.h index 4e99f8f..8f41ccf 100644 --- a/linux-user/s390x/target_signal.h +++ b/linux-user/s390x/target_signal.h @@ -1,8 +1,6 @@ #ifndef S390X_TARGET_SIGNAL_H #define S390X_TARGET_SIGNAL_H -#include "cpu.h" - typedef struct target_sigaltstack { abi_ulong ss_sp; int ss_flags; @@ -18,10 +16,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUS390XState *state) -{ - return state->regs[15]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* S390X_TARGET_SIGNAL_H */ diff --git a/linux-user/sh4/signal.c b/linux-user/sh4/signal.c index 2a5378e..c6752ba 100644 --- a/linux-user/sh4/signal.c +++ b/linux-user/sh4/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/sh4/target_cpu.h b/linux-user/sh4/target_cpu.h index 9d305d2..1a647dd 100644 --- a/linux-user/sh4/target_cpu.h +++ b/linux-user/sh4/target_cpu.h @@ -32,4 +32,8 @@ static inline void cpu_set_tls(CPUSH4State *env, target_ulong newtls) env->gbr = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUSH4State *state) +{ + return state->gregs[15]; +} #endif diff --git a/linux-user/sh4/target_signal.h b/linux-user/sh4/target_signal.h index e7b18a6..2bdc24c 100644 --- a/linux-user/sh4/target_signal.h +++ b/linux-user/sh4/target_signal.h @@ -1,8 +1,6 @@ #ifndef SH4_TARGET_SIGNAL_H #define SH4_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,10 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUSH4State *state) -{ - return state->gregs[15]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* SH4_TARGET_SIGNAL_H */ diff --git a/linux-user/signal.c b/linux-user/signal.c index 01de433..be2815b 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -23,7 +23,6 @@ #include "qemu.h" #include "qemu-common.h" -#include "target_signal.h" #include "trace.h" #include "signal-common.h" diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 45e922f..55e9d6f 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index f2fe526..1ffc0ae 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -41,4 +41,15 @@ static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) env->gregs[7] = newtls; } +#ifndef UREG_I6 +#define UREG_I6 6 +#endif +#ifndef UREG_FP +#define UREG_FP UREG_I6 +#endif + +static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) +{ + return state->regwptr[UREG_FP]; +} #endif diff --git a/linux-user/sparc/target_signal.h b/linux-user/sparc/target_signal.h index 467abea..bfa19bb 100644 --- a/linux-user/sparc/target_signal.h +++ b/linux-user/sparc/target_signal.h @@ -1,8 +1,6 @@ #ifndef SPARC_TARGET_SIGNAL_H #define SPARC_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,17 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 4096 #define TARGET_SIGSTKSZ 16384 -#ifndef UREG_I6 -#define UREG_I6 6 -#endif -#ifndef UREG_FP -#define UREG_FP UREG_I6 -#endif - -static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) -{ - return state->regwptr[UREG_FP]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* SPARC_TARGET_SIGNAL_H */ diff --git a/linux-user/sparc64/target_signal.h b/linux-user/sparc64/target_signal.h index 14b01d9..1d804bf 100644 --- a/linux-user/sparc64/target_signal.h +++ b/linux-user/sparc64/target_signal.h @@ -1,8 +1,6 @@ #ifndef SPARC64_TARGET_SIGNAL_H #define SPARC64_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,17 +19,5 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 4096 #define TARGET_SIGSTKSZ 16384 -#ifndef UREG_I6 -#define UREG_I6 6 -#endif -#ifndef UREG_FP -#define UREG_FP UREG_I6 -#endif - -static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) -{ - return state->regwptr[UREG_FP]; -} - #define TARGET_ARCH_HAS_SETUP_FRAME #endif /* SPARC64_TARGET_SIGNAL_H */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index fbf1bf9..85e0d87 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -482,6 +482,8 @@ int do_sigaction(int sig, const struct target_sigaction *act, #define TARGET_SA_RESTORER 0x04000000 #endif +#include "target_signal.h" + #ifdef TARGET_SA_RESTORER #define TARGET_ARCH_HAS_SA_RESTORER 1 #endif diff --git a/linux-user/tilegx/signal.c b/linux-user/tilegx/signal.c index d0ed3de..c5a1c71 100644 --- a/linux-user/tilegx/signal.c +++ b/linux-user/tilegx/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h index 4878e01..d1aa582 100644 --- a/linux-user/tilegx/target_cpu.h +++ b/linux-user/tilegx/target_cpu.h @@ -32,4 +32,8 @@ static inline void cpu_set_tls(CPUTLGState *env, target_ulong newtls) env->regs[TILEGX_R_TP] = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUTLGState *state) +{ + return state->regs[TILEGX_R_SP]; +} #endif diff --git a/linux-user/tilegx/target_signal.h b/linux-user/tilegx/target_signal.h index a74fa37..4cb8c56 100644 --- a/linux-user/tilegx/target_signal.h +++ b/linux-user/tilegx/target_signal.h @@ -1,8 +1,6 @@ #ifndef TILEGX_TARGET_SIGNAL_H #define TILEGX_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -20,8 +18,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUTLGState *state) -{ - return state->regs[TILEGX_R_SP]; -} #endif /* TILEGX_TARGET_SIGNAL_H */ diff --git a/linux-user/x86_64/target_signal.h b/linux-user/x86_64/target_signal.h index 6b01b5a..be054d1 100644 --- a/linux-user/x86_64/target_signal.h +++ b/linux-user/x86_64/target_signal.h @@ -1,8 +1,6 @@ #ifndef X86_64_TARGET_SIGNAL_H #define X86_64_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -21,8 +19,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUX86State *state) -{ - return state->regs[R_ESP]; -} #endif /* X86_64_TARGET_SIGNAL_H */ diff --git a/linux-user/xtensa/signal.c b/linux-user/xtensa/signal.c index 3e483ef..8d54ef3 100644 --- a/linux-user/xtensa/signal.c +++ b/linux-user/xtensa/signal.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#include "target_signal.h" #include "signal-common.h" #include "linux-user/trace.h" diff --git a/linux-user/xtensa/target_cpu.h b/linux-user/xtensa/target_cpu.h index 747d828..e31efe3 100644 --- a/linux-user/xtensa/target_cpu.h +++ b/linux-user/xtensa/target_cpu.h @@ -19,4 +19,8 @@ static inline void cpu_set_tls(CPUXtensaState *env, target_ulong newtls) env->uregs[THREADPTR] = newtls; } +static inline abi_ulong get_sp_from_cpustate(CPUXtensaState *state) +{ + return state->regs[1]; +} #endif diff --git a/linux-user/xtensa/target_signal.h b/linux-user/xtensa/target_signal.h index 4376b2e..de03c0a 100644 --- a/linux-user/xtensa/target_signal.h +++ b/linux-user/xtensa/target_signal.h @@ -1,8 +1,6 @@ #ifndef XTENSA_TARGET_SIGNAL_H #define XTENSA_TARGET_SIGNAL_H -#include "cpu.h" - /* this struct defines a stack used during syscall handling */ typedef struct target_sigaltstack { @@ -20,8 +18,4 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 -static inline abi_ulong get_sp_from_cpustate(CPUXtensaState *state) -{ - return state->regs[1]; -} #endif |