summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2019-02-18 16:44:50 +0800
committerbiao716.wang <biao716.wang@samsung.com>2019-02-18 16:44:50 +0800
commit7b5cbad745e78581eada75a4a45483a819e7581a (patch)
tree175bb889b1829750de765c4727d19985e334b7ae
parent788695002ba35b2ce0168c13d4309f231c162ec7 (diff)
downloadqemu-arm-static-7b5cbad745e78581eada75a4a45483a819e7581a.tar.gz
qemu-arm-static-7b5cbad745e78581eada75a4a45483a819e7581a.tar.bz2
qemu-arm-static-7b5cbad745e78581eada75a4a45483a819e7581a.zip
use ucontext_t instead struct ucontext.
Change-Id: Iae48dc294f297fba1b230941cbc004e51538de09
-rw-r--r--user-exec.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/user-exec.c b/user-exec.c
index 82bfa66ce..67b65585b 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -53,7 +53,11 @@ static void exception_action(CPUArchState *env1)
void cpu_resume_from_signal(CPUArchState *env1, void *puc)
{
#ifdef __linux__
- struct ucontext *uc = puc;
+ // struct ucontext *uc = puc;
+ // Use typdef struct ucontext {...}ucontext_t in others distro,
+ // But use typedef struct ucontext_t {...}ucontext_t.
+ // So need to use unified define ucontext_t.
+ ucontext_t *uc = puc;
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#endif
@@ -164,7 +168,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#else
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#endif
unsigned long pc;
int trapno;
@@ -219,7 +223,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#else
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#endif
pc = PC_sig(uc);
@@ -324,7 +328,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
ucontext_t *uc = puc;
#else
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#endif
unsigned long pc;
int is_write;
@@ -351,7 +355,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
uint32_t *pc = uc->uc_mcontext.sc_pc;
uint32_t insn = *pc;
int is_write = 0;
@@ -438,7 +442,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long pc;
int is_write;
@@ -463,7 +467,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
uint64_t pc;
int is_write = 0; /* XXX how to determine? */
@@ -478,7 +482,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long pc;
int is_write;
@@ -500,7 +504,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long ip;
int is_write = 0;
@@ -531,7 +535,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long pc;
uint16_t *pinsn;
int is_write = 0;
@@ -584,7 +588,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
greg_t pc = uc->uc_mcontext.pc;
int is_write;
@@ -600,7 +604,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long pc = uc->uc_mcontext.sc_iaoq[0];
uint32_t insn = *(uint32_t *)pc;
int is_write = 0;
@@ -641,3 +645,4 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#error host CPU specific signal handler needed
#endif
+