aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpu-exec.c17
-rw-r--r--dyngen-exec.h1
-rw-r--r--vl.c9
3 files changed, 27 insertions, 0 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index c7cd607887..e7f4322ef4 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -1280,6 +1280,23 @@ int cpu_signal_handler(int host_signum, struct siginfo *info, void *puc)
&uc->uc_sigmask, puc);
}
+#elif defined(__s390__)
+
+int cpu_signal_handler(int host_signum, struct siginfo *info,
+ void *puc)
+{
+ struct ucontext *uc = puc;
+ unsigned long pc;
+ int is_write;
+
+ pc = uc->uc_mcontext.psw.addr;
+ /* XXX: compute is_write */
+ is_write = 0;
+ return handle_cpu_signal(pc, (unsigned long)info->si_addr,
+ is_write,
+ &uc->uc_sigmask, puc);
+}
+
#else
#error host CPU specific signal handler needed
diff --git a/dyngen-exec.h b/dyngen-exec.h
index 2dc948bf4a..946347d6c7 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -218,6 +218,7 @@ extern int __op_jmp0, __op_jmp1, __op_jmp2, __op_jmp3;
#endif
#ifdef __s390__
#define EXIT_TB() asm volatile ("br %r14")
+#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
#endif
#ifdef __alpha__
#define EXIT_TB() asm volatile ("ret")
diff --git a/vl.c b/vl.c
index 13b07c8427..c3894b8017 100644
--- a/vl.c
+++ b/vl.c
@@ -532,6 +532,15 @@ int64_t cpu_get_real_ticks(void)
return val;
}
+#elif defined(__s390__)
+
+int64_t cpu_get_real_ticks(void)
+{
+ int64_t val;
+ asm volatile("stck 0(%1)" : "=m" (val) : "a" (&val) : "cc");
+ return val;
+}
+
#else
#error unsupported CPU
#endif