aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-user/alpha/target_signal.h5
-rw-r--r--linux-user/arm/target_signal.h5
-rw-r--r--linux-user/i386/target_signal.h5
-rw-r--r--linux-user/mips/target_signal.h5
-rw-r--r--linux-user/ppc/target_signal.h5
-rw-r--r--linux-user/sparc/target_signal.h12
-rw-r--r--linux-user/syscall.c3
-rw-r--r--target-alpha/cpu.h5
-rw-r--r--target-arm/cpu.h5
-rw-r--r--target-i386/cpu.h5
-rw-r--r--target-mips/cpu.h5
-rw-r--r--target-ppc/cpu.h5
-rw-r--r--target-sparc/cpu.h12
13 files changed, 39 insertions, 38 deletions
diff --git a/linux-user/alpha/target_signal.h b/linux-user/alpha/target_signal.h
index bf54ac71d8..7618c3e83b 100644
--- a/linux-user/alpha/target_signal.h
+++ b/linux-user/alpha/target_signal.h
@@ -21,4 +21,9 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 4096
#define TARGET_SIGSTKSZ 16384
+static inline target_ulong get_sp_from_cpustate(CPUAlphaState *state)
+{
+ return state->ir[IR_SP];
+}
+
#endif /* TARGET_SIGNAL_H */
diff --git a/linux-user/arm/target_signal.h b/linux-user/arm/target_signal.h
index eb4a0bb12c..d518165143 100644
--- a/linux-user/arm/target_signal.h
+++ b/linux-user/arm/target_signal.h
@@ -21,4 +21,9 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192
+static inline target_ulong get_sp_from_cpustate(CPUARMState *state)
+{
+ return state->regs[13];
+}
+
#endif /* TARGET_SIGNAL_H */
diff --git a/linux-user/i386/target_signal.h b/linux-user/i386/target_signal.h
index eb4a0bb12c..f93a8d62b9 100644
--- a/linux-user/i386/target_signal.h
+++ b/linux-user/i386/target_signal.h
@@ -21,4 +21,9 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192
+static inline target_ulong get_sp_from_cpustate(CPUX86State *state)
+{
+ return state->regs[R_ESP];
+}
+
#endif /* TARGET_SIGNAL_H */
diff --git a/linux-user/mips/target_signal.h b/linux-user/mips/target_signal.h
index c94788497c..d7611b01d4 100644
--- a/linux-user/mips/target_signal.h
+++ b/linux-user/mips/target_signal.h
@@ -21,4 +21,9 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192
+static inline target_ulong get_sp_from_cpustate(CPUMIPSState *state)
+{
+ return state->gpr[29][state->current_tc];
+}
+
#endif /* TARGET_SIGNAL_H */
diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h
index e210e7a317..80ad21187f 100644
--- a/linux-user/ppc/target_signal.h
+++ b/linux-user/ppc/target_signal.h
@@ -21,4 +21,9 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192
+static inline target_ulong get_sp_from_cpustate(CPUPPCState *state)
+{
+ return state->gpr[1];
+}
+
#endif /* TARGET_SIGNAL_H */
diff --git a/linux-user/sparc/target_signal.h b/linux-user/sparc/target_signal.h
index bf54ac71d8..dfca129162 100644
--- a/linux-user/sparc/target_signal.h
+++ b/linux-user/sparc/target_signal.h
@@ -21,4 +21,16 @@ 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 target_ulong get_sp_from_cpustate(CPUSPARCState *state)
+{
+ return state->regwptr[UREG_FP];
+}
+
#endif /* TARGET_SIGNAL_H */
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5f1c804aaa..af5b9d9225 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4318,7 +4318,8 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
case TARGET_NR_capset:
goto unimplemented;
case TARGET_NR_sigaltstack:
-#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC)
+#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_MIPS) || \
+ defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_ALPHA)
ret = do_sigaltstack((struct target_sigaltstack *)arg1,
(struct target_sigaltstack *)arg2,
get_sp_from_cpustate((CPUState *)cpu_env));
diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index ef61d87483..3f517e67b6 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -397,9 +397,4 @@ void cpu_loop_exit (void);
void pal_init (CPUState *env);
void call_pal (CPUState *env, int palcode);
-static inline target_ulong get_sp_from_cpustate(CPUAlphaState *state)
-{
- return state->ir[IR_SP];
-}
-
#endif /* !defined (__CPU_ALPHA_H__) */
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 926aa2a32a..76fdbb26bf 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -300,11 +300,6 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum,
#define cpu_gen_code cpu_arm_gen_code
#define cpu_signal_handler cpu_arm_signal_handler
-static inline target_ulong get_sp_from_cpustate(CPUARMState *state)
-{
- return state->regs[13];
-}
-
#include "cpu-all.h"
#endif
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 4f454c6e9e..2cc7d64e95 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -688,11 +688,6 @@ static inline int cpu_get_time_fast(void)
#define cpu_gen_code cpu_x86_gen_code
#define cpu_signal_handler cpu_x86_signal_handler
-static inline target_ulong get_sp_from_cpustate(CPUX86State *state)
-{
- return state->regs[R_ESP];
-}
-
#include "cpu-all.h"
#include "svm.h"
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index dd8388152a..569f9325bf 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -548,9 +548,4 @@ CPUMIPSState *cpu_mips_init(void);
uint32_t cpu_mips_get_clock (void);
int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);
-static inline target_ulong get_sp_from_cpustate(CPUMIPSState *state)
-{
- return state->gpr[29][state->current_tc];
-}
-
#endif /* !defined (__MIPS_CPU_H__) */
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index e428f70f16..f1df741e1e 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -1146,9 +1146,4 @@ enum {
/*****************************************************************************/
-static inline target_ulong get_sp_from_cpustate(CPUPPCState *state)
-{
- return state->gpr[1];
-}
-
#endif /* !defined (__CPU_PPC_H__) */
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index cb672717f4..5c8c49ab63 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -316,18 +316,6 @@ void cpu_check_irqs(CPUSPARCState *env);
#define cpu_gen_code cpu_sparc_gen_code
#define cpu_signal_handler cpu_sparc_signal_handler
-#ifndef UREG_I6
-#define UREG_I6 6
-#endif
-#ifndef UREG_FP
-#define UREG_FP UREG_I6
-#endif
-
-static inline target_ulong get_sp_from_cpustate(CPUSPARCState *state)
-{
- return state->regwptr[UREG_FP];
-}
-
#include "cpu-all.h"
#endif