aboutsummaryrefslogtreecommitdiff
path: root/linux-user/include/host/ppc/host-signal.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-12-21 16:20:32 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2022-01-12 14:08:29 +0100
commit05a248715cef192336a594afed812871a52efc1f (patch)
treebc71df9e28eb4fc84dc4ac0e1918365f61661753 /linux-user/include/host/ppc/host-signal.h
parenta3a576b0bf376eeb3cfc6c97c082628a8b73ff60 (diff)
user: move common-user includes to a subdirectory of {bsd,linux}-user/
Avoid polluting the compilation of common-user/ with local include files; making an include file available to common-user/ should be a deliberate decision in order to keep a clear interface that can be used by both bsd-user/ and linux-user/. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'linux-user/include/host/ppc/host-signal.h')
-rw-r--r--linux-user/include/host/ppc/host-signal.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/linux-user/include/host/ppc/host-signal.h b/linux-user/include/host/ppc/host-signal.h
new file mode 100644
index 0000000000..1d8e658ff7
--- /dev/null
+++ b/linux-user/include/host/ppc/host-signal.h
@@ -0,0 +1,30 @@
+/*
+ * host-signal.h: signal info dependent on the host architecture
+ *
+ * Copyright (c) 2003-2005 Fabrice Bellard
+ * Copyright (c) 2021 Linaro Limited
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef PPC_HOST_SIGNAL_H
+#define PPC_HOST_SIGNAL_H
+
+static inline uintptr_t host_signal_pc(ucontext_t *uc)
+{
+ return uc->uc_mcontext.regs->nip;
+}
+
+static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc)
+{
+ uc->uc_mcontext.regs->nip = pc;
+}
+
+static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
+{
+ return uc->uc_mcontext.regs->trap != 0x400
+ && (uc->uc_mcontext.regs->dsisr & 0x02000000);
+}
+
+#endif