]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
Move get_sp_from_cpustate from cpu.h to target_signal.h.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 27 Sep 2007 16:44:32 +0000 (16:44 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 27 Sep 2007 16:44:32 +0000 (16:44 +0000)
Enable sigaltstack processing for more architectures.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3253 c046a42c-6fe2-441c-8c8c-71466251a162

13 files changed:
linux-user/alpha/target_signal.h
linux-user/arm/target_signal.h
linux-user/i386/target_signal.h
linux-user/mips/target_signal.h
linux-user/ppc/target_signal.h
linux-user/sparc/target_signal.h
linux-user/syscall.c
target-alpha/cpu.h
target-arm/cpu.h
target-i386/cpu.h
target-mips/cpu.h
target-ppc/cpu.h
target-sparc/cpu.h

index bf54ac71d8402aa2dcbafeba0a9fbbb415963424..7618c3e83b7852447c11298325f4554a546a2535 100644 (file)
@@ -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 */
index eb4a0bb12c316c9eef30041cc35244c9f8872947..d5181651438ab174d53dd4fec05e3b26fa39a4cf 100644 (file)
@@ -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 */
index eb4a0bb12c316c9eef30041cc35244c9f8872947..f93a8d62b96cfcb57fa6e2d2411eaff81324ce81 100644 (file)
@@ -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 */
index c94788497c703ac08b1fcebd780dee25830735e3..d7611b01d4d2c092f7835afc48087c7e292fe361 100644 (file)
@@ -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 */
index e210e7a31704e0cb32a0fafe12c2f69de357f8d4..80ad21187f7a0df74877988cd8dbe9a2c9ef10eb 100644 (file)
@@ -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 */
index bf54ac71d8402aa2dcbafeba0a9fbbb415963424..dfca129162a7aae5f10f1b9cd4b716f15b22cc57 100644 (file)
@@ -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 */
index 5f1c804aaa1d4ac19614ab2a9791b13ea4deccac..af5b9d9225fcb1e982037c7fd2aec2e0da75c87f 100644 (file)
@@ -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));
index ef61d874830396458e801a8e2ea652dc29fd580f..3f517e67b6ec35c664e6fb059bd0ec38ce7d5ed8 100644 (file)
@@ -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__) */
index 926aa2a32a9beafcbad8827814a5c890b48c827d..76fdbb26bf322ab9eb185c52963b3d230641d41c 100644 (file)
@@ -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
index 4f454c6e9e409269d771b9fffe587a590cc4a36f..2cc7d64e95ae290b5a2ed551686cf909062411ed 100644 (file)
@@ -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"
index dd8388152acd64a9ebf3b1a9952de5d75d8dc1ee..569f9325bfea4a17c8e256ad5b1c7078957471d2 100644 (file)
@@ -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__) */
index e428f70f1655c3fe69c40a55818096bd8535c64f..f1df741e1e50bea39ae21118f1faab56a06d8a74 100644 (file)
@@ -1146,9 +1146,4 @@ enum {
 
 /*****************************************************************************/
 
-static inline target_ulong get_sp_from_cpustate(CPUPPCState *state)
-{
-    return state->gpr[1];
-}
-
 #endif /* !defined (__CPU_PPC_H__) */
index cb672717f4a5de3236560210e14b740379f627a8..5c8c49ab63b34cb58588a13a0e5caa61b0e5551c 100644 (file)
@@ -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