diff options
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/elfload.c | 40 | ||||
-rw-r--r-- | linux-user/m68k/syscall.h | 2 | ||||
-rw-r--r-- | linux-user/main.c | 44 | ||||
-rw-r--r-- | linux-user/qemu.h | 14 | ||||
-rw-r--r-- | linux-user/signal.c | 217 | ||||
-rw-r--r-- | linux-user/syscall.c | 30 |
6 files changed, 177 insertions, 170 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 2fd4a93f8a..e502b39007 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -157,7 +157,7 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *env) { (*regs)[0] = env->regs[15]; (*regs)[1] = env->regs[14]; @@ -229,7 +229,7 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *env) { (*regs)[0] = env->regs[R_EBX]; (*regs)[1] = env->regs[R_ECX]; @@ -288,7 +288,7 @@ static inline void init_thread(struct target_pt_regs *regs, #define ELF_NREG 18 typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUARMState *env) { (*regs)[0] = tswapl(env->regs[0]); (*regs)[1] = tswapl(env->regs[1]); @@ -307,7 +307,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) (*regs)[14] = tswapl(env->regs[14]); (*regs)[15] = tswapl(env->regs[15]); - (*regs)[16] = tswapl(cpsr_read((CPUState *)env)); + (*regs)[16] = tswapl(cpsr_read((CPUARMState *)env)); (*regs)[17] = tswapl(env->regs[0]); /* XXX */ } @@ -410,7 +410,7 @@ static inline void init_thread(struct target_pt_regs *regs, #define ELF_NREG 34 typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUUniCore32State *env) { (*regs)[0] = env->regs[0]; (*regs)[1] = env->regs[1]; @@ -445,7 +445,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) (*regs)[30] = env->regs[30]; (*regs)[31] = env->regs[31]; - (*regs)[32] = cpu_asr_read((CPUState *)env); + (*regs)[32] = cpu_asr_read((CPUUniCore32State *)env); (*regs)[33] = env->regs[0]; /* XXX */ } @@ -572,7 +572,7 @@ enum { static uint32_t get_elf_hwcap(void) { - CPUState *e = thread_env; + CPUPPCState *e = thread_env; uint32_t features = 0; /* We don't have to be terribly complete here; the high points are @@ -628,7 +628,7 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info * #define ELF_NREG 48 typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *env) { int i; target_ulong ccr = 0; @@ -697,7 +697,7 @@ enum { }; /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *env) { int i; @@ -749,7 +749,7 @@ static inline void init_thread(struct target_pt_regs *regs, typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env) { int i, pos = 0; @@ -797,7 +797,7 @@ enum { }; static inline void elf_core_copy_regs(target_elf_gregset_t *regs, - const CPUState *env) + const CPUSH4State *env) { int i; @@ -862,7 +862,7 @@ static inline void init_thread(struct target_pt_regs *regs, #define ELF_NREG 20 typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *env) { (*regs)[0] = tswapl(env->dregs[1]); (*regs)[1] = tswapl(env->dregs[2]); @@ -1044,7 +1044,7 @@ static inline void bswap_sym(struct elf_sym *sym) { } #endif #ifdef USE_ELF_CORE_DUMP -static int elf_core_dump(int, const CPUState *); +static int elf_core_dump(int, const CPUArchState *); #endif /* USE_ELF_CORE_DUMP */ static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias); @@ -1930,7 +1930,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, * from given cpu into just specified register set. Prototype is: * * static void elf_core_copy_regs(taret_elf_gregset_t *regs, - * const CPUState *env); + * const CPUArchState *env); * * Parameters: * regs - copy register values into here (allocated and zeroed by caller) @@ -2054,8 +2054,8 @@ static void fill_auxv_note(struct memelfnote *, const TaskState *); static void fill_elf_note_phdr(struct elf_phdr *, int, off_t); static size_t note_size(const struct memelfnote *); static void free_note_info(struct elf_note_info *); -static int fill_note_info(struct elf_note_info *, long, const CPUState *); -static void fill_thread_info(struct elf_note_info *, const CPUState *); +static int fill_note_info(struct elf_note_info *, long, const CPUArchState *); +static void fill_thread_info(struct elf_note_info *, const CPUArchState *); static int core_dump_filename(const TaskState *, char *, size_t); static int dump_write(int, const void *, size_t); @@ -2448,7 +2448,7 @@ static int write_note(struct memelfnote *men, int fd) return (0); } -static void fill_thread_info(struct elf_note_info *info, const CPUState *env) +static void fill_thread_info(struct elf_note_info *info, const CPUArchState *env) { TaskState *ts = (TaskState *)env->opaque; struct elf_thread_status *ets; @@ -2466,10 +2466,10 @@ static void fill_thread_info(struct elf_note_info *info, const CPUState *env) } static int fill_note_info(struct elf_note_info *info, - long signr, const CPUState *env) + long signr, const CPUArchState *env) { #define NUMNOTES 3 - CPUState *cpu = NULL; + CPUArchState *cpu = NULL; TaskState *ts = (TaskState *)env->opaque; int i; @@ -2595,7 +2595,7 @@ static int write_note_info(struct elf_note_info *info, int fd) * handler (provided that target process haven't registered * handler for that) that does the dump when signal is received. */ -static int elf_core_dump(int signr, const CPUState *env) +static int elf_core_dump(int signr, const CPUArchState *env) { const TaskState *ts = (const TaskState *)env->opaque; struct vm_area_struct *vma = NULL; diff --git a/linux-user/m68k/syscall.h b/linux-user/m68k/syscall.h index 2fd85dd6fb..26187930db 100644 --- a/linux-user/m68k/syscall.h +++ b/linux-user/m68k/syscall.h @@ -18,4 +18,4 @@ struct target_pt_regs { #define UNAME_MACHINE "m68k" -void do_m68k_simcall(CPUState *, int); +void do_m68k_simcall(CPUM68KState *, int); diff --git a/linux-user/main.c b/linux-user/main.c index bd4748941a..962677e01d 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -71,7 +71,7 @@ void gemu_log(const char *fmt, ...) } #if defined(TARGET_I386) -int cpu_get_pic_interrupt(CPUState *env) +int cpu_get_pic_interrupt(CPUX86State *env) { return -1; } @@ -146,7 +146,7 @@ static inline void exclusive_idle(void) Must only be called from outside cpu_arm_exec. */ static inline void start_exclusive(void) { - CPUState *other; + CPUArchState *other; pthread_mutex_lock(&exclusive_lock); exclusive_idle(); @@ -172,7 +172,7 @@ static inline void end_exclusive(void) } /* Wait for exclusive ops to finish, and begin cpu execution. */ -static inline void cpu_exec_start(CPUState *env) +static inline void cpu_exec_start(CPUArchState *env) { pthread_mutex_lock(&exclusive_lock); exclusive_idle(); @@ -181,7 +181,7 @@ static inline void cpu_exec_start(CPUState *env) } /* Mark cpu as not executing, and release pending exclusive ops. */ -static inline void cpu_exec_end(CPUState *env) +static inline void cpu_exec_end(CPUArchState *env) { pthread_mutex_lock(&exclusive_lock); env->running = 0; @@ -206,11 +206,11 @@ void cpu_list_unlock(void) } #else /* if !CONFIG_USE_NPTL */ /* These are no-ops because we are not threadsafe. */ -static inline void cpu_exec_start(CPUState *env) +static inline void cpu_exec_start(CPUArchState *env) { } -static inline void cpu_exec_end(CPUState *env) +static inline void cpu_exec_end(CPUArchState *env) { } @@ -247,7 +247,7 @@ void cpu_list_unlock(void) /***********************************************************/ /* CPUX86 core interface */ -void cpu_smm_update(CPUState *env) +void cpu_smm_update(CPUX86State *env) { } @@ -889,7 +889,7 @@ void cpu_loop(CPUARMState *env) #ifdef TARGET_UNICORE32 -void cpu_loop(CPUState *env) +void cpu_loop(CPUUniCore32State *env) { int trapnr; unsigned int n, insn; @@ -1226,36 +1226,36 @@ void cpu_loop (CPUSPARCState *env) #endif #ifdef TARGET_PPC -static inline uint64_t cpu_ppc_get_tb (CPUState *env) +static inline uint64_t cpu_ppc_get_tb(CPUPPCState *env) { /* TO FIX */ return 0; } -uint64_t cpu_ppc_load_tbl (CPUState *env) +uint64_t cpu_ppc_load_tbl(CPUPPCState *env) { return cpu_ppc_get_tb(env); } -uint32_t cpu_ppc_load_tbu (CPUState *env) +uint32_t cpu_ppc_load_tbu(CPUPPCState *env) { return cpu_ppc_get_tb(env) >> 32; } -uint64_t cpu_ppc_load_atbl (CPUState *env) +uint64_t cpu_ppc_load_atbl(CPUPPCState *env) { return cpu_ppc_get_tb(env); } -uint32_t cpu_ppc_load_atbu (CPUState *env) +uint32_t cpu_ppc_load_atbu(CPUPPCState *env) { return cpu_ppc_get_tb(env) >> 32; } -uint32_t cpu_ppc601_load_rtcu (CPUState *env) +uint32_t cpu_ppc601_load_rtcu(CPUPPCState *env) __attribute__ (( alias ("cpu_ppc_load_tbu") )); -uint32_t cpu_ppc601_load_rtcl (CPUState *env) +uint32_t cpu_ppc601_load_rtcl(CPUPPCState *env) { return cpu_ppc_load_tbl(env) & 0x3FFFFF80; } @@ -2276,7 +2276,7 @@ done_syscall: #endif #ifdef TARGET_SH4 -void cpu_loop (CPUState *env) +void cpu_loop(CPUSH4State *env) { int trapnr, ret; target_siginfo_t info; @@ -2335,7 +2335,7 @@ void cpu_loop (CPUState *env) #endif #ifdef TARGET_CRIS -void cpu_loop (CPUState *env) +void cpu_loop(CPUCRISState *env) { int trapnr, ret; target_siginfo_t info; @@ -2393,7 +2393,7 @@ void cpu_loop (CPUState *env) #endif #ifdef TARGET_MICROBLAZE -void cpu_loop (CPUState *env) +void cpu_loop(CPUMBState *env) { int trapnr, ret; target_siginfo_t info; @@ -2630,7 +2630,7 @@ static void do_store_exclusive(CPUAlphaState *env, int reg, int quad) queue_signal(env, TARGET_SIGSEGV, &info); } -void cpu_loop (CPUState *env) +void cpu_loop(CPUAlphaState *env) { int trapnr; target_siginfo_t info; @@ -2888,7 +2888,7 @@ void cpu_loop(CPUS390XState *env) #endif /* TARGET_S390X */ -THREAD CPUState *thread_env; +THREAD CPUArchState *thread_env; void task_settid(TaskState *ts) { @@ -3277,7 +3277,7 @@ int main(int argc, char **argv, char **envp) struct image_info info1, *info = &info1; struct linux_binprm bprm; TaskState *ts; - CPUState *env; + CPUArchState *env; int optind; char **target_environ, **wrk; char **target_argv; @@ -3375,7 +3375,7 @@ int main(int argc, char **argv, char **envp) exit(1); } #if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC) - cpu_reset(env); + cpu_state_reset(env); #endif thread_env = env; diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 308dbc025b..68895671ed 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -171,7 +171,7 @@ struct linux_binprm { char **argv; char **envp; char * filename; /* Name of binary */ - int (*core_dump)(int, const CPUState *); /* coredump routine */ + int (*core_dump)(int, const CPUArchState *); /* coredump routine */ }; void do_init_thread(struct target_pt_regs *regs, struct image_info *infop); @@ -196,8 +196,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8); void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -extern THREAD CPUState *thread_env; -void cpu_loop(CPUState *env); +extern THREAD CPUArchState *thread_env; +void cpu_loop(CPUArchState *env); char *target_strerror(int err); int get_osversion(void); void fork_start(void); @@ -219,15 +219,15 @@ void print_syscall_ret(int num, abi_long arg1); extern int do_strace; /* signal.c */ -void process_pending_signals(CPUState *cpu_env); +void process_pending_signals(CPUArchState *cpu_env); void signal_init(void); -int queue_signal(CPUState *env, int sig, target_siginfo_t *info); +int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info); void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info); void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo); int target_to_host_signal(int sig); int host_to_target_signal(int sig); -long do_sigreturn(CPUState *env); -long do_rt_sigreturn(CPUState *env); +long do_sigreturn(CPUArchState *env); +long do_rt_sigreturn(CPUArchState *env); abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp); #ifdef TARGET_I386 diff --git a/linux-user/signal.c b/linux-user/signal.c index cefd2ff3ce..fca51e2b11 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -347,7 +347,7 @@ void signal_init(void) /* signal queue handling */ -static inline struct sigqueue *alloc_sigqueue(CPUState *env) +static inline struct sigqueue *alloc_sigqueue(CPUArchState *env) { TaskState *ts = env->opaque; struct sigqueue *q = ts->first_free; @@ -357,7 +357,7 @@ static inline struct sigqueue *alloc_sigqueue(CPUState *env) return q; } -static inline void free_sigqueue(CPUState *env, struct sigqueue *q) +static inline void free_sigqueue(CPUArchState *env, struct sigqueue *q) { TaskState *ts = env->opaque; q->next = ts->first_free; @@ -415,7 +415,7 @@ static void QEMU_NORETURN force_sig(int target_sig) /* queue a signal so that it will be send to the virtual CPU as soon as possible */ -int queue_signal(CPUState *env, int sig, target_siginfo_t *info) +int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info) { TaskState *ts = env->opaque; struct emulated_sigtable *k; @@ -1205,14 +1205,14 @@ static const abi_ulong retcodes[4] = { #define __get_user_error(x,p,e) __get_user(x, p) -static inline int valid_user_regs(CPUState *regs) +static inline int valid_user_regs(CPUARMState *regs) { return 1; } static void setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ - CPUState *env, abi_ulong mask) + CPUARMState *env, abi_ulong mask) { __put_user(env->regs[0], &sc->arm_r0); __put_user(env->regs[1], &sc->arm_r1); @@ -1241,7 +1241,7 @@ setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ } static inline abi_ulong -get_sigframe(struct target_sigaction *ka, CPUState *regs, int framesize) +get_sigframe(struct target_sigaction *ka, CPUARMState *regs, int framesize) { unsigned long sp = regs->regs[13]; @@ -1257,7 +1257,7 @@ get_sigframe(struct target_sigaction *ka, CPUState *regs, int framesize) } static int -setup_return(CPUState *env, struct target_sigaction *ka, +setup_return(CPUARMState *env, struct target_sigaction *ka, abi_ulong *rc, abi_ulong frame_addr, int usig, abi_ulong rc_addr) { abi_ulong handler = ka->_sa_handler; @@ -1295,7 +1295,7 @@ setup_return(CPUState *env, struct target_sigaction *ka, return 0; } -static abi_ulong *setup_sigframe_v2_vfp(abi_ulong *regspace, CPUState *env) +static abi_ulong *setup_sigframe_v2_vfp(abi_ulong *regspace, CPUARMState *env) { int i; struct target_vfp_sigframe *vfpframe; @@ -1312,7 +1312,8 @@ static abi_ulong *setup_sigframe_v2_vfp(abi_ulong *regspace, CPUState *env) return (abi_ulong*)(vfpframe+1); } -static abi_ulong *setup_sigframe_v2_iwmmxt(abi_ulong *regspace, CPUState *env) +static abi_ulong *setup_sigframe_v2_iwmmxt(abi_ulong *regspace, + CPUARMState *env) { int i; struct target_iwmmxt_sigframe *iwmmxtframe; @@ -1332,7 +1333,7 @@ static abi_ulong *setup_sigframe_v2_iwmmxt(abi_ulong *regspace, CPUState *env) } static void setup_sigframe_v2(struct target_ucontext_v2 *uc, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUARMState *env) { struct target_sigaltstack stack; int i; @@ -1367,7 +1368,7 @@ static void setup_sigframe_v2(struct target_ucontext_v2 *uc, /* compare linux/arch/arm/kernel/signal.c:setup_frame() */ static void setup_frame_v1(int usig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *regs) + target_sigset_t *set, CPUARMState *regs) { struct sigframe_v1 *frame; abi_ulong frame_addr = get_sigframe(ka, regs, sizeof(*frame)); @@ -1391,7 +1392,7 @@ end: } static void setup_frame_v2(int usig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *regs) + target_sigset_t *set, CPUARMState *regs) { struct sigframe_v2 *frame; abi_ulong frame_addr = get_sigframe(ka, regs, sizeof(*frame)); @@ -1408,7 +1409,7 @@ static void setup_frame_v2(int usig, struct target_sigaction *ka, } static void setup_frame(int usig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *regs) + target_sigset_t *set, CPUARMState *regs) { if (get_osversion() >= 0x020612) { setup_frame_v2(usig, ka, set, regs); @@ -1420,7 +1421,7 @@ static void setup_frame(int usig, struct target_sigaction *ka, /* compare linux/arch/arm/kernel/signal.c:setup_rt_frame() */ static void setup_rt_frame_v1(int usig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUARMState *env) { struct rt_sigframe_v1 *frame; abi_ulong frame_addr = get_sigframe(ka, env, sizeof(*frame)); @@ -1464,7 +1465,7 @@ end: static void setup_rt_frame_v2(int usig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUARMState *env) { struct rt_sigframe_v2 *frame; abi_ulong frame_addr = get_sigframe(ka, env, sizeof(*frame)); @@ -1490,7 +1491,7 @@ static void setup_rt_frame_v2(int usig, struct target_sigaction *ka, static void setup_rt_frame(int usig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUARMState *env) { if (get_osversion() >= 0x020612) { setup_rt_frame_v2(usig, ka, info, set, env); @@ -1500,7 +1501,7 @@ static void setup_rt_frame(int usig, struct target_sigaction *ka, } static int -restore_sigcontext(CPUState *env, struct target_sigcontext *sc) +restore_sigcontext(CPUARMState *env, struct target_sigcontext *sc) { int err = 0; uint32_t cpsr; @@ -1531,7 +1532,7 @@ restore_sigcontext(CPUState *env, struct target_sigcontext *sc) return err; } -static long do_sigreturn_v1(CPUState *env) +static long do_sigreturn_v1(CPUARMState *env) { abi_ulong frame_addr; struct sigframe_v1 *frame; @@ -1578,7 +1579,7 @@ badframe: return 0; } -static abi_ulong *restore_sigframe_v2_vfp(CPUState *env, abi_ulong *regspace) +static abi_ulong *restore_sigframe_v2_vfp(CPUARMState *env, abi_ulong *regspace) { int i; abi_ulong magic, sz; @@ -1608,7 +1609,8 @@ static abi_ulong *restore_sigframe_v2_vfp(CPUState *env, abi_ulong *regspace) return (abi_ulong*)(vfpframe + 1); } -static abi_ulong *restore_sigframe_v2_iwmmxt(CPUState *env, abi_ulong *regspace) +static abi_ulong *restore_sigframe_v2_iwmmxt(CPUARMState *env, + abi_ulong *regspace) { int i; abi_ulong magic, sz; @@ -1632,7 +1634,7 @@ static abi_ulong *restore_sigframe_v2_iwmmxt(CPUState *env, abi_ulong *regspace) return (abi_ulong*)(iwmmxtframe + 1); } -static int do_sigframe_return_v2(CPUState *env, target_ulong frame_addr, +static int do_sigframe_return_v2(CPUARMState *env, target_ulong frame_addr, struct target_ucontext_v2 *uc) { sigset_t host_set; @@ -1671,7 +1673,7 @@ static int do_sigframe_return_v2(CPUState *env, target_ulong frame_addr, return 0; } -static long do_sigreturn_v2(CPUState *env) +static long do_sigreturn_v2(CPUARMState *env) { abi_ulong frame_addr; struct sigframe_v2 *frame; @@ -1700,7 +1702,7 @@ badframe: return 0; } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUARMState *env) { if (get_osversion() >= 0x020612) { return do_sigreturn_v2(env); @@ -1709,7 +1711,7 @@ long do_sigreturn(CPUState *env) } } -static long do_rt_sigreturn_v1(CPUState *env) +static long do_rt_sigreturn_v1(CPUARMState *env) { abi_ulong frame_addr; struct rt_sigframe_v1 *frame; @@ -1750,7 +1752,7 @@ badframe: return 0; } -static long do_rt_sigreturn_v2(CPUState *env) +static long do_rt_sigreturn_v2(CPUARMState *env) { abi_ulong frame_addr; struct rt_sigframe_v2 *frame; @@ -1779,7 +1781,7 @@ badframe: return 0; } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUARMState *env) { if (get_osversion() >= 0x020612) { return do_rt_sigreturn_v2(env); @@ -1888,7 +1890,8 @@ struct target_rt_signal_frame { #define UREG_SP UREG_O6 static inline abi_ulong get_sigframe(struct target_sigaction *sa, - CPUState *env, unsigned long framesize) + CPUSPARCState *env, + unsigned long framesize) { abi_ulong sp; @@ -1904,7 +1907,7 @@ static inline abi_ulong get_sigframe(struct target_sigaction *sa, } static int -setup___siginfo(__siginfo_t *si, CPUState *env, abi_ulong mask) +setup___siginfo(__siginfo_t *si, CPUSPARCState *env, abi_ulong mask) { int err = 0, i; @@ -1925,7 +1928,7 @@ setup___siginfo(__siginfo_t *si, CPUState *env, abi_ulong mask) #if 0 static int setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ - CPUState *env, unsigned long mask) + CPUSPARCState *env, unsigned long mask) { int err = 0; @@ -1943,7 +1946,7 @@ setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ #define NF_ALIGNEDSZ (((sizeof(struct target_signal_frame) + 7) & (~7))) static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUSPARCState *env) { abi_ulong sf_addr; struct target_signal_frame *sf; @@ -2032,7 +2035,7 @@ sigsegv: force_sig(TARGET_SIGSEGV); } static inline int -restore_fpu_state(CPUState *env, qemu_siginfo_fpu_t *fpu) +restore_fpu_state(CPUSPARCState *env, qemu_siginfo_fpu_t *fpu) { int err; #if 0 @@ -2073,12 +2076,12 @@ restore_fpu_state(CPUState *env, qemu_siginfo_fpu_t *fpu) static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUSPARCState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUSPARCState *env) { abi_ulong sf_addr; struct target_signal_frame *sf; @@ -2151,7 +2154,7 @@ segv_and_exit: force_sig(TARGET_SIGSEGV); } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUSPARCState *env) { fprintf(stderr, "do_rt_sigreturn: not implemented\n"); return -TARGET_ENOSYS; @@ -2427,25 +2430,25 @@ void sparc64_get_context(CPUSPARCState *env) # warning signal handling not implemented static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUMIPSState *env) { fprintf(stderr, "setup_frame: not implemented\n"); } static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUMIPSState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUMIPSState *env) { fprintf(stderr, "do_sigreturn: not implemented\n"); return -TARGET_ENOSYS; } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUMIPSState *env) { fprintf(stderr, "do_rt_sigreturn: not implemented\n"); return -TARGET_ENOSYS; @@ -2456,25 +2459,25 @@ long do_rt_sigreturn(CPUState *env) # warning signal handling not implemented static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUMIPSState *env) { fprintf(stderr, "setup_frame: not implemented\n"); } static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUMIPSState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUMIPSState *env) { fprintf(stderr, "do_sigreturn: not implemented\n"); return -TARGET_ENOSYS; } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUMIPSState *env) { fprintf(stderr, "do_rt_sigreturn: not implemented\n"); return -TARGET_ENOSYS; @@ -2546,7 +2549,7 @@ static inline int install_sigtramp(unsigned int *tramp, unsigned int syscall) } static inline int -setup_sigcontext(CPUState *regs, struct target_sigcontext *sc) +setup_sigcontext(CPUMIPSState *regs, struct target_sigcontext *sc) { int err = 0; @@ -2621,7 +2624,7 @@ setup_sigcontext(CPUState *regs, struct target_sigcontext *sc) } static inline int -restore_sigcontext(CPUState *regs, struct target_sigcontext *sc) +restore_sigcontext(CPUMIPSState *regs, struct target_sigcontext *sc) { int err = 0; @@ -2692,7 +2695,7 @@ restore_sigcontext(CPUState *regs, struct target_sigcontext *sc) * Determine which stack to use.. */ static inline abi_ulong -get_sigframe(struct target_sigaction *ka, CPUState *regs, size_t frame_size) +get_sigframe(struct target_sigaction *ka, CPUMIPSState *regs, size_t frame_size) { unsigned long sp; @@ -2716,7 +2719,7 @@ get_sigframe(struct target_sigaction *ka, CPUState *regs, size_t frame_size) /* compare linux/arch/mips/kernel/signal.c:setup_frame() */ static void setup_frame(int sig, struct target_sigaction * ka, - target_sigset_t *set, CPUState *regs) + target_sigset_t *set, CPUMIPSState *regs) { struct sigframe *frame; abi_ulong frame_addr; @@ -2764,7 +2767,7 @@ give_sigsegv: return; } -long do_sigreturn(CPUState *regs) +long do_sigreturn(CPUMIPSState *regs) { struct sigframe *frame; abi_ulong frame_addr; @@ -2815,7 +2818,7 @@ badframe: static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUMIPSState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -2873,7 +2876,7 @@ give_sigsegv: return; } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUMIPSState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -2974,7 +2977,7 @@ static abi_ulong get_sigframe(struct target_sigaction *ka, } static int setup_sigcontext(struct target_sigcontext *sc, - CPUState *regs, unsigned long mask) + CPUSH4State *regs, unsigned long mask) { int err = 0; int i; @@ -3005,7 +3008,7 @@ static int setup_sigcontext(struct target_sigcontext *sc, return err; } -static int restore_sigcontext(CPUState *regs, struct target_sigcontext *sc, +static int restore_sigcontext(CPUSH4State *regs, struct target_sigcontext *sc, target_ulong *r0_p) { unsigned int err = 0; @@ -3037,7 +3040,7 @@ static int restore_sigcontext(CPUState *regs, struct target_sigcontext *sc, } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *regs) + target_sigset_t *set, CPUSH4State *regs) { struct target_sigframe *frame; abi_ulong frame_addr; @@ -3089,7 +3092,7 @@ give_sigsegv: static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *regs) + target_sigset_t *set, CPUSH4State *regs) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -3150,7 +3153,7 @@ give_sigsegv: force_sig(TARGET_SIGSEGV); } -long do_sigreturn(CPUState *regs) +long do_sigreturn(CPUSH4State *regs) { struct target_sigframe *frame; abi_ulong frame_addr; @@ -3190,7 +3193,7 @@ badframe: return 0; } -long do_rt_sigreturn(CPUState *regs) +long do_rt_sigreturn(CPUSH4State *regs) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -3257,7 +3260,7 @@ struct rt_signal_frame { uint32_t tramp[2]; }; -static void setup_sigcontext(struct target_sigcontext *sc, CPUState *env) +static void setup_sigcontext(struct target_sigcontext *sc, CPUMBState *env) { __put_user(env->regs[0], &sc->regs.r0); __put_user(env->regs[1], &sc->regs.r1); @@ -3294,7 +3297,7 @@ static void setup_sigcontext(struct target_sigcontext *sc, CPUState *env) __put_user(env->sregs[SR_PC], &sc->regs.pc); } -static void restore_sigcontext(struct target_sigcontext *sc, CPUState *env) +static void restore_sigcontext(struct target_sigcontext *sc, CPUMBState *env) { __get_user(env->regs[0], &sc->regs.r0); __get_user(env->regs[1], &sc->regs.r1); @@ -3332,7 +3335,7 @@ static void restore_sigcontext(struct target_sigcontext *sc, CPUState *env) } static abi_ulong get_sigframe(struct target_sigaction *ka, - CPUState *env, int frame_size) + CPUMBState *env, int frame_size) { abi_ulong sp = env->regs[1]; @@ -3343,7 +3346,7 @@ static abi_ulong get_sigframe(struct target_sigaction *ka, } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUMBState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; @@ -3409,12 +3412,12 @@ static void setup_frame(int sig, struct target_sigaction *ka, static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUMBState *env) { fprintf(stderr, "Microblaze setup_rt_frame: not implemented\n"); } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUMBState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; @@ -3449,7 +3452,7 @@ long do_sigreturn(CPUState *env) force_sig(TARGET_SIGSEGV); } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUMBState *env) { fprintf(stderr, "Microblaze do_rt_sigreturn: not implemented\n"); return -TARGET_ENOSYS; @@ -3478,7 +3481,7 @@ struct rt_signal_frame { uint8_t retcode[8]; /* Trampoline code. */ }; -static void setup_sigcontext(struct target_sigcontext *sc, CPUState *env) +static void setup_sigcontext(struct target_sigcontext *sc, CPUCRISState *env) { __put_user(env->regs[0], &sc->regs.r0); __put_user(env->regs[1], &sc->regs.r1); @@ -3501,7 +3504,7 @@ static void setup_sigcontext(struct target_sigcontext *sc, CPUState *env) __put_user(env->pc, &sc->regs.erp); } -static void restore_sigcontext(struct target_sigcontext *sc, CPUState *env) +static void restore_sigcontext(struct target_sigcontext *sc, CPUCRISState *env) { __get_user(env->regs[0], &sc->regs.r0); __get_user(env->regs[1], &sc->regs.r1); @@ -3524,7 +3527,7 @@ static void restore_sigcontext(struct target_sigcontext *sc, CPUState *env) __get_user(env->pc, &sc->regs.erp); } -static abi_ulong get_sigframe(CPUState *env, int framesize) +static abi_ulong get_sigframe(CPUCRISState *env, int framesize) { abi_ulong sp; /* Align the stack downwards to 4. */ @@ -3533,7 +3536,7 @@ static abi_ulong get_sigframe(CPUState *env, int framesize) } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUCRISState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; @@ -3584,12 +3587,12 @@ static void setup_frame(int sig, struct target_sigaction *ka, static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUCRISState *env) { fprintf(stderr, "CRIS setup_rt_frame: not implemented\n"); } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUCRISState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; @@ -3620,7 +3623,7 @@ long do_sigreturn(CPUState *env) force_sig(TARGET_SIGSEGV); } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUCRISState *env) { fprintf(stderr, "CRIS do_rt_sigreturn: not implemented\n"); return -TARGET_ENOSYS; @@ -3687,7 +3690,7 @@ typedef struct { } rt_sigframe; static inline abi_ulong -get_sigframe(struct target_sigaction *ka, CPUState *env, size_t frame_size) +get_sigframe(struct target_sigaction *ka, CPUS390XState *env, size_t frame_size) { abi_ulong sp; @@ -3712,7 +3715,7 @@ get_sigframe(struct target_sigaction *ka, CPUState *env, size_t frame_size) return (sp - frame_size) & -8ul; } -static void save_sigregs(CPUState *env, target_sigregs *sregs) +static void save_sigregs(CPUS390XState *env, target_sigregs *sregs) { int i; //save_access_regs(current->thread.acrs); FIXME @@ -3738,7 +3741,7 @@ static void save_sigregs(CPUState *env, target_sigregs *sregs) } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUS390XState *env) { sigframe *frame; abi_ulong frame_addr; @@ -3805,7 +3808,7 @@ give_sigsegv: static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUS390XState *env) { int i; rt_sigframe *frame; @@ -3869,7 +3872,7 @@ give_sigsegv: } static int -restore_sigregs(CPUState *env, target_sigregs *sc) +restore_sigregs(CPUS390XState *env, target_sigregs *sc) { int err = 0; int i; @@ -3895,7 +3898,7 @@ restore_sigregs(CPUState *env, target_sigregs *sc) return err; } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUS390XState *env) { sigframe *frame; abi_ulong frame_addr = env->regs[15]; @@ -3927,7 +3930,7 @@ badframe: return 0; } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUS390XState *env) { rt_sigframe *frame; abi_ulong frame_addr = env->regs[15]; @@ -4107,7 +4110,7 @@ struct target_rt_sigframe { /* See arch/powerpc/kernel/signal.c. */ static target_ulong get_sigframe(struct target_sigaction *ka, - CPUState *env, + CPUPPCState *env, int frame_size) { target_ulong oldsp, newsp; @@ -4125,7 +4128,7 @@ static target_ulong get_sigframe(struct target_sigaction *ka, return newsp; } -static int save_user_regs(CPUState *env, struct target_mcontext *frame, +static int save_user_regs(CPUPPCState *env, struct target_mcontext *frame, int sigret) { target_ulong msr = env->msr; @@ -4221,7 +4224,7 @@ static int save_user_regs(CPUState *env, struct target_mcontext *frame, return 0; } -static int restore_user_regs(CPUState *env, +static int restore_user_regs(CPUPPCState *env, struct target_mcontext *frame, int sig) { target_ulong save_r2 = 0; @@ -4320,7 +4323,7 @@ static int restore_user_regs(CPUState *env, } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUPPCState *env) { struct target_sigframe *frame; struct target_sigcontext *sc; @@ -4382,7 +4385,7 @@ sigsegv: static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUPPCState *env) { struct target_rt_sigframe *rt_sf; struct target_mcontext *frame; @@ -4450,7 +4453,7 @@ sigsegv: } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUPPCState *env) { struct target_sigcontext *sc = NULL; struct target_mcontext *sr = NULL; @@ -4493,7 +4496,7 @@ sigsegv: } /* See arch/powerpc/kernel/signal_32.c. */ -static int do_setcontext(struct target_ucontext *ucp, CPUState *env, int sig) +static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig) { struct target_mcontext *mcp; target_ulong mcp_addr; @@ -4528,7 +4531,7 @@ sigsegv: #endif } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUPPCState *env) { struct target_rt_sigframe *rt_sf = NULL; target_ulong rt_sf_addr; @@ -4617,7 +4620,8 @@ struct target_rt_sigframe }; static int -setup_sigcontext(struct target_sigcontext *sc, CPUState *env, abi_ulong mask) +setup_sigcontext(struct target_sigcontext *sc, CPUM68KState *env, + abi_ulong mask) { int err = 0; @@ -4634,7 +4638,7 @@ setup_sigcontext(struct target_sigcontext *sc, CPUState *env, abi_ulong mask) } static int -restore_sigcontext(CPUState *env, struct target_sigcontext *sc, int *pd0) +restore_sigcontext(CPUM68KState *env, struct target_sigcontext *sc, int *pd0) { int err = 0; int temp; @@ -4656,7 +4660,8 @@ restore_sigcontext(CPUState *env, struct target_sigcontext *sc, int *pd0) * Determine which stack to use.. */ static inline abi_ulong -get_sigframe(struct target_sigaction *ka, CPUState *regs, size_t frame_size) +get_sigframe(struct target_sigaction *ka, CPUM68KState *regs, + size_t frame_size) { unsigned long sp; @@ -4671,7 +4676,7 @@ get_sigframe(struct target_sigaction *ka, CPUState *regs, size_t frame_size) } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUM68KState *env) { struct target_sigframe *frame; abi_ulong frame_addr; @@ -4725,7 +4730,7 @@ give_sigsegv: } static inline int target_rt_setup_ucontext(struct target_ucontext *uc, - CPUState *env) + CPUM68KState *env) { target_greg_t *gregs = uc->tuc_mcontext.gregs; int err; @@ -4753,7 +4758,7 @@ static inline int target_rt_setup_ucontext(struct target_ucontext *uc, return err; } -static inline int target_rt_restore_ucontext(CPUState *env, +static inline int target_rt_restore_ucontext(CPUM68KState *env, struct target_ucontext *uc, int *pd0) { @@ -4795,7 +4800,7 @@ badframe: static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUM68KState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -4866,7 +4871,7 @@ give_sigsegv: force_sig(TARGET_SIGSEGV); } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUM68KState *env) { struct target_sigframe *frame; abi_ulong frame_addr = env->aregs[7] - 4; @@ -4904,7 +4909,7 @@ badframe: return 0; } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUM68KState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr = env->aregs[7] - 4; @@ -4985,7 +4990,7 @@ struct target_rt_sigframe { #define INSN_LDI_R0 0x201f0000 #define INSN_CALLSYS 0x00000083 -static int setup_sigcontext(struct target_sigcontext *sc, CPUState *env, +static int setup_sigcontext(struct target_sigcontext *sc, CPUAlphaState *env, abi_ulong frame_addr, target_sigset_t *set) { int i, err = 0; @@ -5013,7 +5018,8 @@ static int setup_sigcontext(struct target_sigcontext *sc, CPUState *env, return err; } -static int restore_sigcontext(CPUState *env, struct target_sigcontext *sc) +static int restore_sigcontext(CPUAlphaState *env, + struct target_sigcontext *sc) { uint64_t fpcr; int i, err = 0; @@ -5034,7 +5040,8 @@ static int restore_sigcontext(CPUState *env, struct target_sigcontext *sc) } static inline abi_ulong get_sigframe(struct target_sigaction *sa, - CPUState *env, unsigned long framesize) + CPUAlphaState *env, + unsigned long framesize) { abi_ulong sp = env->ir[IR_SP]; @@ -5046,7 +5053,7 @@ static inline abi_ulong get_sigframe(struct target_sigaction *sa, } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUAlphaState *env) { abi_ulong frame_addr, r26; struct target_sigframe *frame; @@ -5090,7 +5097,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUAlphaState *env) { abi_ulong frame_addr, r26; struct target_rt_sigframe *frame; @@ -5144,7 +5151,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, env->ir[IR_SP] = frame_addr; } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUAlphaState *env) { struct target_sigcontext *sc; abi_ulong sc_addr = env->ir[IR_A0]; @@ -5174,7 +5181,7 @@ long do_sigreturn(CPUState *env) force_sig(TARGET_SIGSEGV); } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUAlphaState *env) { abi_ulong frame_addr = env->ir[IR_A0]; struct target_rt_sigframe *frame; @@ -5207,25 +5214,25 @@ long do_rt_sigreturn(CPUState *env) #else static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUArchState *env) { fprintf(stderr, "setup_frame: not implemented\n"); } static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUArchState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUArchState *env) { fprintf(stderr, "do_sigreturn: not implemented\n"); return -TARGET_ENOSYS; } -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUArchState *env) { fprintf(stderr, "do_rt_sigreturn: not implemented\n"); return -TARGET_ENOSYS; @@ -5233,7 +5240,7 @@ long do_rt_sigreturn(CPUState *env) #endif -void process_pending_signals(CPUState *cpu_env) +void process_pending_signals(CPUArchState *cpu_env) { int sig; abi_ulong handler; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8a11213402..9f5e53a7fe 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3955,7 +3955,7 @@ static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) static pthread_mutex_t clone_lock = PTHREAD_MUTEX_INITIALIZER; typedef struct { - CPUState *env; + CPUArchState *env; pthread_mutex_t mutex; pthread_cond_t cond; pthread_t thread; @@ -3968,7 +3968,7 @@ typedef struct { static void *clone_func(void *arg) { new_thread_info *info = arg; - CPUState *env; + CPUArchState *env; TaskState *ts; env = info->env; @@ -3998,7 +3998,7 @@ static void *clone_func(void *arg) static int clone_func(void *arg) { - CPUState *env = arg; + CPUArchState *env = arg; cpu_loop(env); /* never exits */ return 0; @@ -4007,13 +4007,13 @@ static int clone_func(void *arg) /* do_fork() Must return host values and target errnos (unlike most do_*() functions). */ -static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, +static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, abi_ulong parent_tidptr, target_ulong newtls, abi_ulong child_tidptr) { int ret; TaskState *ts; - CPUState *new_env; + CPUArchState *new_env; #if defined(CONFIG_USE_NPTL) unsigned int nptl_flags; sigset_t sigmask; @@ -4036,7 +4036,7 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, /* we create a new CPU instance. */ new_env = cpu_copy(env); #if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC) - cpu_reset(new_env); + cpu_state_reset(new_env); #endif /* Init regs that differ from the parent. */ cpu_clone_regs(new_env, newsp); @@ -4640,7 +4640,7 @@ int get_osversion(void) static int open_self_maps(void *cpu_env, int fd) { - TaskState *ts = ((CPUState *)cpu_env)->opaque; + TaskState *ts = ((CPUArchState *)cpu_env)->opaque; dprintf(fd, "%08llx-%08llx rw-p %08llx 00:00 0 [stack]\n", (unsigned long long)ts->info->stack_limit, @@ -4653,7 +4653,7 @@ static int open_self_maps(void *cpu_env, int fd) static int open_self_stat(void *cpu_env, int fd) { - TaskState *ts = ((CPUState *)cpu_env)->opaque; + TaskState *ts = ((CPUArchState *)cpu_env)->opaque; abi_ulong start_stack = ts->info->start_stack; int i; @@ -4678,7 +4678,7 @@ static int open_self_stat(void *cpu_env, int fd) static int open_self_auxv(void *cpu_env, int fd) { - TaskState *ts = ((CPUState *)cpu_env)->opaque; + TaskState *ts = ((CPUArchState *)cpu_env)->opaque; abi_ulong auxv = ts->info->saved_auxv; abi_ulong len = ts->info->auxv_len; char *ptr; @@ -4784,13 +4784,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, be disabling signals. */ if (first_cpu->next_cpu) { TaskState *ts; - CPUState **lastp; - CPUState *p; + CPUArchState **lastp; + CPUArchState *p; cpu_list_lock(); lastp = &first_cpu; p = first_cpu; - while (p && p != (CPUState *)cpu_env) { + while (p && p != (CPUArchState *)cpu_env) { lastp = &p->next_cpu; p = p->next_cpu; } @@ -4801,7 +4801,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, /* Remove the CPU from the list. */ *lastp = p->next_cpu; cpu_list_unlock(); - ts = ((CPUState *)cpu_env)->opaque; + ts = ((CPUArchState *)cpu_env)->opaque; if (ts->child_tidptr) { put_user_u32(0, ts->child_tidptr); sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX, @@ -6091,7 +6091,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; case TARGET_NR_mprotect: { - TaskState *ts = ((CPUState *)cpu_env)->opaque; + TaskState *ts = ((CPUArchState *)cpu_env)->opaque; /* Special hack to detect libc making the stack executable. */ if ((arg3 & PROT_GROWSDOWN) && arg1 >= ts->info->stack_limit @@ -7076,7 +7076,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_MIPS) || \ defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_ALPHA) || \ defined(TARGET_M68K) || defined(TARGET_S390X) - ret = do_sigaltstack(arg1, arg2, get_sp_from_cpustate((CPUState *)cpu_env)); + ret = do_sigaltstack(arg1, arg2, get_sp_from_cpustate((CPUArchState *)cpu_env)); break; #else goto unimplemented; |