1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#ifndef SIGNAL_COMMON_H
21#define SIGNAL_COMMON_H
22
23#include "special-errno.h"
24
25
26extern abi_ulong default_sigreturn;
27extern abi_ulong default_rt_sigreturn;
28
29void setup_sigtramp(abi_ulong tramp_page);
30
31int on_sig_stack(unsigned long sp);
32int sas_ss_flags(unsigned long sp);
33abi_ulong target_sigsp(abi_ulong sp, struct target_sigaction *ka);
34void target_save_altstack(target_stack_t *uss, CPUArchState *env);
35abi_long target_restore_altstack(target_stack_t *uss, CPUArchState *env);
36
37static inline void target_sigemptyset(target_sigset_t *set)
38{
39 memset(set, 0, sizeof(*set));
40}
41
42void host_to_target_sigset_internal(target_sigset_t *d,
43 const sigset_t *s);
44void target_to_host_sigset_internal(sigset_t *d,
45 const target_sigset_t *s);
46void tswap_siginfo(target_siginfo_t *tinfo,
47 const target_siginfo_t *info);
48void set_sigmask(const sigset_t *set);
49void force_sig(int sig);
50void force_sigsegv(int oldsig);
51void force_sig_fault(int sig, int code, abi_ulong addr);
52#if defined(TARGET_ARCH_HAS_SETUP_FRAME)
53void setup_frame(int sig, struct target_sigaction *ka,
54 target_sigset_t *set, CPUArchState *env);
55#endif
56void setup_rt_frame(int sig, struct target_sigaction *ka,
57 target_siginfo_t *info,
58 target_sigset_t *set, CPUArchState *env);
59
60void process_pending_signals(CPUArchState *cpu_env);
61void signal_init(void);
62void queue_signal(CPUArchState *env, int sig, int si_type,
63 target_siginfo_t *info);
64void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info);
65void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo);
66int target_to_host_signal(int sig);
67int host_to_target_signal(int sig);
68long do_sigreturn(CPUArchState *env);
69long do_rt_sigreturn(CPUArchState *env);
70abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr,
71 CPUArchState *env);
72int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
73abi_long do_swapcontext(CPUArchState *env, abi_ulong uold_ctx,
74 abi_ulong unew_ctx, abi_long ctx_size);
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93int block_signals(void);
94
95
96
97
98
99
100
101
102
103
104int process_sigsuspend_mask(sigset_t **pset, target_ulong sigset,
105 target_ulong sigsize);
106
107
108
109
110
111
112
113static inline void finish_sigsuspend_mask(int ret)
114{
115 if (ret != -QEMU_ERESTARTSYS) {
116 TaskState *ts = (TaskState *)thread_cpu->opaque;
117 ts->in_sigsuspend = 1;
118 }
119}
120
121#endif
122