diff options
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/alpha/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/alpha/termbits.h | 22 | ||||
-rw-r--r-- | linux-user/arm/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/cris/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/elfload.c | 64 | ||||
-rw-r--r-- | linux-user/i386/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/m68k/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/main.c | 24 | ||||
-rw-r--r-- | linux-user/microblaze/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/mips/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/mips64/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/mipsn32/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/ppc/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/qemu.h | 8 | ||||
-rw-r--r-- | linux-user/sh4/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/signal.c | 246 | ||||
-rw-r--r-- | linux-user/sparc/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/sparc64/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/syscall.c | 36 | ||||
-rw-r--r-- | linux-user/syscall_defs.h | 56 | ||||
-rw-r--r-- | linux-user/x86_64/target_signal.h | 2 | ||||
-rw-r--r-- | linux-user/x86_64/termbits.h | 18 |
22 files changed, 251 insertions, 251 deletions
diff --git a/linux-user/alpha/target_signal.h b/linux-user/alpha/target_signal.h index 2382ffd..d73c44e 100644 --- a/linux-user/alpha/target_signal.h +++ b/linux-user/alpha/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/alpha/termbits.h b/linux-user/alpha/termbits.h index 6406b6a..56ab3eb 100644 --- a/linux-user/alpha/termbits.h +++ b/linux-user/alpha/termbits.h @@ -1,17 +1,17 @@ -typedef unsigned char target_cc_t; -typedef unsigned int target_speed_t; -typedef unsigned int target_tcflag_t; +typedef unsigned char a_target_cc; +typedef unsigned int a_target_speed; +typedef unsigned int a_target_tcflag; #define TARGET_NCCS 19 struct target_termios { - target_tcflag_t c_iflag; /* input mode flags */ - target_tcflag_t c_oflag; /* output mode flags */ - target_tcflag_t c_cflag; /* control mode flags */ - target_tcflag_t c_lflag; /* local mode flags */ - target_cc_t c_cc[TARGET_NCCS]; /* control characters */ - target_cc_t c_line; /* line discipline (== c_cc[19]) */ - target_speed_t c_ispeed; /* input speed */ - target_speed_t c_ospeed; /* output speed */ + a_target_tcflag c_iflag; /* input mode flags */ + a_target_tcflag c_oflag; /* output mode flags */ + a_target_tcflag c_cflag; /* control mode flags */ + a_target_tcflag c_lflag; /* local mode flags */ + a_target_cc c_cc[TARGET_NCCS]; /* control characters */ + a_target_cc c_line; /* line discipline (== c_cc[19]) */ + a_target_speed c_ispeed; /* input speed */ + a_target_speed c_ospeed; /* output speed */ }; /* c_cc characters */ diff --git a/linux-user/arm/target_signal.h b/linux-user/arm/target_signal.h index 2b32813..71cc0c4 100644 --- a/linux-user/arm/target_signal.h +++ b/linux-user/arm/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/cris/target_signal.h b/linux-user/cris/target_signal.h index 5611840..d0e7aec 100644 --- a/linux-user/cris/target_signal.h +++ b/linux-user/cris/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_ulong ss_size; abi_long ss_flags; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 07277a6..8f2049b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -134,13 +134,13 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i regs->rip = infop->entry; } -typedef target_ulong target_elf_greg_t; -typedef uint32_t target_uid_t; -typedef uint32_t target_gid_t; -typedef int32_t target_pid_t; +typedef target_ulong a_target_elf_greg; +typedef uint32_t a_target_uid; +typedef uint32_t a_target_gid; +typedef int32_t a_target_pid; #define ELF_NREG 27 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef a_target_elf_greg a_target_elf_gregset[ELF_NREG]; /* * Note that ELF_NREG should be 29 as there should be place for @@ -149,7 +149,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(a_target_elf_gregset *regs, const CPUState *env) { (*regs)[0] = env->regs[15]; (*regs)[1] = env->regs[14]; @@ -211,13 +211,13 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i regs->edx = 0; } -typedef target_ulong target_elf_greg_t; -typedef uint16_t target_uid_t; -typedef uint16_t target_gid_t; -typedef int32_t target_pid_t; +typedef target_ulong a_target_elf_greg; +typedef uint16_t a_target_uid; +typedef uint16_t a_target_gid; +typedef int32_t a_target_pid; #define ELF_NREG 17 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef a_target_elf_greg a_target_elf_gregset[ELF_NREG]; /* * Note that ELF_NREG should be 19 as there should be place for @@ -226,7 +226,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(a_target_elf_gregset *regs, const CPUState *env) { (*regs)[0] = env->regs[R_EBX]; (*regs)[1] = env->regs[R_ECX]; @@ -286,15 +286,15 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i regs->ARM_r10 = infop->start_data; } -typedef uint32_t target_elf_greg_t; -typedef uint16_t target_uid_t; -typedef uint16_t target_gid_t; -typedef int32_t target_pid_t; +typedef uint32_t a_target_elf_greg; +typedef uint16_t a_target_uid; +typedef uint16_t a_target_gid; +typedef int32_t a_target_pid; #define ELF_NREG 18 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef a_target_elf_greg a_target_elf_gregset[ELF_NREG]; -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +static void elf_core_copy_regs(a_target_elf_gregset *regs, const CPUState *env) { (*regs)[0] = env->regs[0]; (*regs)[1] = env->regs[1]; @@ -1768,21 +1768,21 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, * Next you define type of register set used for dumping. ELF specification * says that it needs to be array of elf_greg_t that has size of ELF_NREG. * - * typedef <target_regtype> target_elf_greg_t; + * typedef <target_regtype> a_target_elf_greg; * #define ELF_NREG <number of registers> - * typedef taret_elf_greg_t target_elf_gregset_t[ELF_NREG]; + * typedef a_taret_elf_greg a_target_elf_gregset[ELF_NREG]; * * Then define following types to match target types. Actual types can * be found from linux kernel (arch/<ARCH>/include/asm/posix_types.h): * - * typedef <target_uid_type> target_uid_t; - * typedef <target_gid_type> target_gid_t; - * typedef <target_pid_type> target_pid_t; + * typedef <target_uid_type> a_target_uid; + * typedef <target_gid_type> a_target_gid; + * typedef <target_pid_type> a_target_pid; * * Last step is to implement target specific function that copies registers * from given cpu into just specified register set. Prototype is: * - * static void elf_core_copy_regs(taret_elf_gregset_t *regs, + * static void elf_core_copy_regs(a_taret_elf_gregset *regs, * const CPUState *env); * * Parameters: @@ -1814,15 +1814,15 @@ struct target_elf_prstatus { short pr_cursig; /* Current signal */ target_ulong pr_sigpend; /* XXX */ target_ulong pr_sighold; /* XXX */ - target_pid_t pr_pid; - target_pid_t pr_ppid; - target_pid_t pr_pgrp; - target_pid_t pr_sid; + a_target_pid pr_pid; + a_target_pid pr_ppid; + a_target_pid pr_pgrp; + a_target_pid pr_sid; struct target_timeval pr_utime; /* XXX User time */ struct target_timeval pr_stime; /* XXX System time */ struct target_timeval pr_cutime; /* XXX Cumulative user time */ struct target_timeval pr_cstime; /* XXX Cumulative system time */ - target_elf_gregset_t pr_reg; /* GP registers */ + a_target_elf_gregset pr_reg; /* GP registers */ int pr_fpvalid; /* XXX */ }; @@ -1834,9 +1834,9 @@ struct target_elf_prpsinfo { char pr_zomb; /* zombie */ char pr_nice; /* nice val */ target_ulong pr_flag; /* flags */ - target_uid_t pr_uid; - target_gid_t pr_gid; - target_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid; + a_target_uid pr_uid; + a_target_gid pr_gid; + a_target_pid pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing */ char pr_fname[16]; /* filename of executable */ char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ diff --git a/linux-user/i386/target_signal.h b/linux-user/i386/target_signal.h index 9baf7fb..da86689 100644 --- a/linux-user/i386/target_signal.h +++ b/linux-user/i386/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/m68k/target_signal.h b/linux-user/m68k/target_signal.h index 479758a..964c55b 100644 --- a/linux-user/m68k/target_signal.h +++ b/linux-user/m68k/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/main.c b/linux-user/main.c index 81a1ada..4474c90 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -303,7 +303,7 @@ void cpu_loop(CPUX86State *env) { int trapnr; abi_ulong pc; - target_siginfo_t info; + a_target_siginfo info; for(;;) { trapnr = cpu_x86_exec(env); @@ -528,7 +528,7 @@ void cpu_loop(CPUARMState *env) { int trapnr; unsigned int n, insn; - target_siginfo_t info; + a_target_siginfo info; uint32_t addr; for(;;) { @@ -856,7 +856,7 @@ static void flush_windows(CPUSPARCState *env) void cpu_loop (CPUSPARCState *env) { int trapnr, ret; - target_siginfo_t info; + a_target_siginfo info; while (1) { trapnr = cpu_sparc_exec (env); @@ -1015,12 +1015,12 @@ uint32_t cpu_ppc601_load_rtcl (CPUState *env) } /* XXX: to be fixed */ -int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, target_ulong *valp) +int ppc_dcr_read (a_ppc_dcr *dcr_env, int dcrn, target_ulong *valp) { return -1; } -int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val) +int ppc_dcr_write (a_ppc_dcr *dcr_env, int dcrn, target_ulong val) { return -1; } @@ -1093,7 +1093,7 @@ static int do_store_exclusive(CPUPPCState *env) void cpu_loop(CPUPPCState *env) { - target_siginfo_t info; + a_target_siginfo info; int trapnr; uint32_t ret; @@ -1890,7 +1890,7 @@ static int do_store_exclusive(CPUMIPSState *env) void cpu_loop(CPUMIPSState *env) { - target_siginfo_t info; + a_target_siginfo info; int trapnr, ret; unsigned int syscall_num; @@ -1999,7 +1999,7 @@ void cpu_loop(CPUMIPSState *env) void cpu_loop (CPUState *env) { int trapnr, ret; - target_siginfo_t info; + a_target_siginfo info; while (1) { trapnr = cpu_sh4_exec (env); @@ -2057,7 +2057,7 @@ void cpu_loop (CPUState *env) void cpu_loop (CPUState *env) { int trapnr, ret; - target_siginfo_t info; + a_target_siginfo info; while (1) { trapnr = cpu_cris_exec (env); @@ -2114,7 +2114,7 @@ void cpu_loop (CPUState *env) void cpu_loop (CPUState *env) { int trapnr, ret; - target_siginfo_t info; + a_target_siginfo info; while (1) { trapnr = cpu_mb_exec (env); @@ -2176,7 +2176,7 @@ void cpu_loop(CPUM68KState *env) { int trapnr; unsigned int n; - target_siginfo_t info; + a_target_siginfo info; TaskState *ts = env->opaque; for(;;) { @@ -2266,7 +2266,7 @@ void cpu_loop(CPUM68KState *env) void cpu_loop (CPUState *env) { int trapnr; - target_siginfo_t info; + a_target_siginfo info; while (1) { trapnr = cpu_alpha_exec (env); diff --git a/linux-user/microblaze/target_signal.h b/linux-user/microblaze/target_signal.h index 3d1f7a7..a91b21d 100644 --- a/linux-user/microblaze/target_signal.h +++ b/linux-user/microblaze/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_ulong ss_size; abi_long ss_flags; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/mips/target_signal.h b/linux-user/mips/target_signal.h index 6e1dc8b..13c2d19 100644 --- a/linux-user/mips/target_signal.h +++ b/linux-user/mips/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_long ss_sp; abi_ulong ss_size; abi_long ss_flags; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h index 6e1dc8b..13c2d19 100644 --- a/linux-user/mips64/target_signal.h +++ b/linux-user/mips64/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_long ss_sp; abi_ulong ss_size; abi_long ss_flags; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/mipsn32/target_signal.h b/linux-user/mipsn32/target_signal.h index ff20d9e..8946792 100644 --- a/linux-user/mipsn32/target_signal.h +++ b/linux-user/mipsn32/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { int32_t ss_sp; uint32_t ss_size; int32_t ss_flags; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h index a93b5cf..e25d776 100644 --- a/linux-user/ppc/target_signal.h +++ b/linux-user/ppc/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; int ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/qemu.h b/linux-user/qemu.h index d129deb..8151c1b 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -78,7 +78,7 @@ struct vm86_saved_state { struct sigqueue { struct sigqueue *next; - target_siginfo_t info; + a_target_siginfo info; }; struct emulated_sigtable { @@ -207,9 +207,9 @@ extern int do_strace; /* signal.c */ void process_pending_signals(CPUState *cpu_env); void signal_init(void); -int queue_signal(CPUState *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 queue_signal(CPUState *env, int sig, a_target_siginfo *info); +void host_to_target_siginfo(a_target_siginfo *tinfo, const siginfo_t *info); +void target_to_host_siginfo(siginfo_t *info, const a_target_siginfo *tinfo); int target_to_host_signal(int sig); int host_to_target_signal(int sig); long do_sigreturn(CPUState *env); diff --git a/linux-user/sh4/target_signal.h b/linux-user/sh4/target_signal.h index e148da0..a241a89 100644 --- a/linux-user/sh4/target_signal.h +++ b/linux-user/sh4/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/signal.c b/linux-user/signal.c index 2df17aa..a840ccf 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -115,26 +115,26 @@ int target_to_host_signal(int sig) return target_to_host_signal_table[sig]; } -static inline void target_sigemptyset(target_sigset_t *set) +static inline void target_sigemptyset(a_target_sigset *set) { memset(set, 0, sizeof(*set)); } -static inline void target_sigaddset(target_sigset_t *set, int signum) +static inline void target_sigaddset(a_target_sigset *set, int signum) { signum--; abi_ulong mask = (abi_ulong)1 << (signum % TARGET_NSIG_BPW); set->sig[signum / TARGET_NSIG_BPW] |= mask; } -static inline int target_sigismember(const target_sigset_t *set, int signum) +static inline int target_sigismember(const a_target_sigset *set, int signum) { signum--; abi_ulong mask = (abi_ulong)1 << (signum % TARGET_NSIG_BPW); return ((set->sig[signum / TARGET_NSIG_BPW] & mask) != 0); } -static void host_to_target_sigset_internal(target_sigset_t *d, +static void host_to_target_sigset_internal(a_target_sigset *d, const sigset_t *s) { int i; @@ -146,9 +146,9 @@ static void host_to_target_sigset_internal(target_sigset_t *d, } } -void host_to_target_sigset(target_sigset_t *d, const sigset_t *s) +void host_to_target_sigset(a_target_sigset *d, const sigset_t *s) { - target_sigset_t d1; + a_target_sigset d1; int i; host_to_target_sigset_internal(&d1, s); @@ -157,7 +157,7 @@ void host_to_target_sigset(target_sigset_t *d, const sigset_t *s) } static void target_to_host_sigset_internal(sigset_t *d, - const target_sigset_t *s) + const a_target_sigset *s) { int i; sigemptyset(d); @@ -168,9 +168,9 @@ static void target_to_host_sigset_internal(sigset_t *d, } } -void target_to_host_sigset(sigset_t *d, const target_sigset_t *s) +void target_to_host_sigset(sigset_t *d, const a_target_sigset *s) { - target_sigset_t s1; + a_target_sigset s1; int i; for(i = 0;i < TARGET_NSIG_WORDS; i++) @@ -181,7 +181,7 @@ void target_to_host_sigset(sigset_t *d, const target_sigset_t *s) void host_to_target_old_sigset(abi_ulong *old_sigset, const sigset_t *sigset) { - target_sigset_t d; + a_target_sigset d; host_to_target_sigset(&d, sigset); *old_sigset = d.sig[0]; } @@ -189,7 +189,7 @@ void host_to_target_old_sigset(abi_ulong *old_sigset, void target_to_host_old_sigset(sigset_t *sigset, const abi_ulong *old_sigset) { - target_sigset_t d; + a_target_sigset d; int i; d.sig[0] = *old_sigset; @@ -200,7 +200,7 @@ void target_to_host_old_sigset(sigset_t *sigset, /* siginfo conversion */ -static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo, +static inline void host_to_target_siginfo_noswap(a_target_siginfo *tinfo, const siginfo_t *info) { int sig; @@ -224,8 +224,8 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo, } } -static void tswap_siginfo(target_siginfo_t *tinfo, - const target_siginfo_t *info) +static void tswap_siginfo(a_target_siginfo *tinfo, + const a_target_siginfo *info) { int sig; sig = info->si_signo; @@ -247,7 +247,7 @@ static void tswap_siginfo(target_siginfo_t *tinfo, } -void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info) +void host_to_target_siginfo(a_target_siginfo *tinfo, const siginfo_t *info) { host_to_target_siginfo_noswap(tinfo, info); tswap_siginfo(tinfo, tinfo); @@ -255,7 +255,7 @@ void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info) /* XXX: we support only POSIX RT signals are used. */ /* XXX: find a solution for 64 bit (additional malloced data is needed) */ -void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo) +void target_to_host_siginfo(siginfo_t *info, const a_target_siginfo *tinfo) { info->si_signo = tswap32(tinfo->si_signo); info->si_errno = tswap32(tinfo->si_errno); @@ -417,7 +417,7 @@ static void QEMU_NORETURN force_sig(int 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(CPUState *env, int sig, a_target_siginfo *info) { TaskState *ts = env->opaque; struct emulated_sigtable *k; @@ -485,7 +485,7 @@ static void host_signal_handler(int host_signum, siginfo_t *info, void *puc) { int sig; - target_siginfo_t tinfo; + a_target_siginfo tinfo; /* the CPU emulator uses some host signals to detect exceptions, we forward to it some signals */ @@ -630,8 +630,8 @@ int do_sigaction(int sig, const struct target_sigaction *act, return ret; } -static inline int copy_siginfo_to_user(target_siginfo_t *tinfo, - const target_siginfo_t *info) +static inline int copy_siginfo_to_user(a_target_siginfo *tinfo, + const a_target_siginfo *info) { tswap_siginfo(tinfo, info); return 0; @@ -714,9 +714,9 @@ struct target_sigcontext { struct target_ucontext { abi_ulong tuc_flags; abi_ulong tuc_link; - target_stack_t tuc_stack; + a_target_stack tuc_stack; struct target_sigcontext tuc_mcontext; - target_sigset_t tuc_sigmask; /* mask last for extensibility */ + a_target_sigset tuc_sigmask; /* mask last for extensibility */ }; struct sigframe @@ -815,7 +815,7 @@ get_sigframe(struct target_sigaction *ka, CPUX86State *env, size_t frame_size) /* compare linux/arch/i386/kernel/signal.c:setup_frame() */ static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUX86State *env) + a_target_sigset *set, CPUX86State *env) { abi_ulong frame_addr; struct sigframe *frame; @@ -884,8 +884,8 @@ give_sigsegv: /* compare linux/arch/i386/kernel/signal.c:setup_rt_frame() */ static void setup_rt_frame(int sig, struct target_sigaction *ka, - target_siginfo_t *info, - target_sigset_t *set, CPUX86State *env) + a_target_siginfo *info, + a_target_sigset *set, CPUX86State *env) { abi_ulong frame_addr, addr; struct rt_sigframe *frame; @@ -1008,7 +1008,7 @@ long do_sigreturn(CPUX86State *env) { struct sigframe *frame; abi_ulong frame_addr = env->regs[R_ESP] - 8; - target_sigset_t target_set; + a_target_sigset target_set; sigset_t set; int eax, i; @@ -1098,17 +1098,17 @@ struct target_sigcontext { struct target_ucontext_v1 { abi_ulong tuc_flags; abi_ulong tuc_link; - target_stack_t tuc_stack; + a_target_stack tuc_stack; struct target_sigcontext tuc_mcontext; - target_sigset_t tuc_sigmask; /* mask last for extensibility */ + a_target_sigset tuc_sigmask; /* mask last for extensibility */ }; struct target_ucontext_v2 { abi_ulong tuc_flags; abi_ulong tuc_link; - target_stack_t tuc_stack; + a_target_stack tuc_stack; struct target_sigcontext tuc_mcontext; - target_sigset_t tuc_sigmask; /* mask last for extensibility */ + a_target_sigset tuc_sigmask; /* mask last for extensibility */ char __unused[128 - sizeof(sigset_t)]; abi_ulong tuc_regspace[128] __attribute__((__aligned__(8))); }; @@ -1257,7 +1257,7 @@ setup_return(CPUState *env, struct target_sigaction *ka, } static void setup_sigframe_v2(struct target_ucontext_v2 *uc, - target_sigset_t *set, CPUState *env) + a_target_sigset *set, CPUState *env) { struct target_sigaltstack stack; int i; @@ -1280,7 +1280,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) + a_target_sigset *set, CPUState *regs) { struct sigframe_v1 *frame; abi_ulong frame_addr = get_sigframe(ka, regs, sizeof(*frame)); @@ -1304,7 +1304,7 @@ end: } static void setup_frame_v2(int usig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *regs) + a_target_sigset *set, CPUState *regs) { struct sigframe_v2 *frame; abi_ulong frame_addr = get_sigframe(ka, regs, sizeof(*frame)); @@ -1321,7 +1321,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) + a_target_sigset *set, CPUState *regs) { if (get_osversion() >= 0x020612) { setup_frame_v2(usig, ka, set, regs); @@ -1332,8 +1332,8 @@ 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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { struct rt_sigframe_v1 *frame; abi_ulong frame_addr = get_sigframe(ka, env, sizeof(*frame)); @@ -1376,8 +1376,8 @@ end: } static void setup_rt_frame_v2(int usig, struct target_sigaction *ka, - target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { struct rt_sigframe_v2 *frame; abi_ulong frame_addr = get_sigframe(ka, env, sizeof(*frame)); @@ -1402,8 +1402,8 @@ 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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { if (get_osversion() >= 0x020612) { setup_rt_frame_v2(usig, ka, info, set, env); @@ -1448,7 +1448,7 @@ static long do_sigreturn_v1(CPUState *env) { abi_ulong frame_addr; struct sigframe_v1 *frame; - target_sigset_t set; + a_target_sigset set; sigset_t host_set; int i; @@ -1691,7 +1691,7 @@ typedef struct { unsigned long *insn_addr; unsigned long insn; } si_fpqueue [16]; -} qemu_siginfo_fpu_t; +} a_qemu_siginfo_fpu; struct target_signal_frame { @@ -1701,7 +1701,7 @@ struct target_signal_frame { abi_ulong insns[2] __attribute__ ((aligned (8))); abi_ulong extramask[TARGET_NSIG_WORDS - 1]; abi_ulong extra_size; /* Should be 0 */ - qemu_siginfo_fpu_t fpu_state; + a_qemu_siginfo_fpu fpu_state; }; struct target_rt_signal_frame { struct sparc_stackf ss; @@ -1712,7 +1712,7 @@ struct target_rt_signal_frame { unsigned int insns[2]; stack_t stack; unsigned int extra_size; /* Should be 0 */ - qemu_siginfo_fpu_t fpu_state; + a_qemu_siginfo_fpu fpu_state; }; #define UREG_O0 16 @@ -1785,7 +1785,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) + a_target_sigset *set, CPUState *env) { abi_ulong sf_addr; struct target_signal_frame *sf; @@ -1874,7 +1874,7 @@ sigsegv: force_sig(TARGET_SIGSEGV); } static inline int -restore_fpu_state(CPUState *env, qemu_siginfo_fpu_t *fpu) +restore_fpu_state(CPUState *env, a_qemu_siginfo_fpu *fpu) { int err; #if 0 @@ -1914,8 +1914,8 @@ 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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } @@ -1925,7 +1925,7 @@ long do_sigreturn(CPUState *env) abi_ulong sf_addr; struct target_signal_frame *sf; uint32_t up_psr, pc, npc; - target_sigset_t set; + a_target_sigset set; sigset_t host_set; abi_ulong fpu_save_addr; int err, i; @@ -2021,8 +2021,8 @@ long do_rt_sigreturn(CPUState *env) #define MC_O7 18 #define MC_NGREG 19 -typedef abi_ulong target_mc_greg_t; -typedef target_mc_greg_t target_mc_gregset_t[MC_NGREG]; +typedef abi_ulong a_target_mc_greg; +typedef a_target_mc_greg a_target_mc_gregset[MC_NGREG]; struct target_mc_fq { abi_ulong *mcfq_addr; @@ -2043,20 +2043,20 @@ struct target_mc_fpu { unsigned char mcfpu_qentsz; unsigned char mcfpu_enab; }; -typedef struct target_mc_fpu target_mc_fpu_t; +typedef struct target_mc_fpu a_target_mc_fpu; typedef struct { - target_mc_gregset_t mc_gregs; - target_mc_greg_t mc_fp; - target_mc_greg_t mc_i7; - target_mc_fpu_t mc_fpregs; -} target_mcontext_t; + a_target_mc_gregset mc_gregs; + a_target_mc_greg mc_fp; + a_target_mc_greg mc_i7; + a_target_mc_fpu mc_fpregs; +} a_target_mcontext; struct target_ucontext { struct target_ucontext *uc_link; abi_ulong uc_flags; - target_sigset_t uc_sigmask; - target_mcontext_t uc_mcontext; + a_target_sigset uc_sigmask; + a_target_mcontext uc_mcontext; }; /* A V9 register window */ @@ -2072,7 +2072,7 @@ void sparc64_set_context(CPUSPARCState *env) { abi_ulong ucp_addr; struct target_ucontext *ucp; - target_mc_gregset_t *grp; + a_target_mc_gregset *grp; abi_ulong pc, npc, tstate; abi_ulong fp, i7, w_addr; unsigned char fenab; @@ -2088,7 +2088,7 @@ void sparc64_set_context(CPUSPARCState *env) if (err || ((pc | npc) & 3)) goto do_sigsegv; if (env->regwptr[UREG_I1]) { - target_sigset_t target_set; + a_target_sigset target_set; sigset_t set; if (TARGET_NSIG_WORDS == 1) { @@ -2098,7 +2098,7 @@ void sparc64_set_context(CPUSPARCState *env) abi_ulong *src, *dst; src = ucp->uc_sigmask.sig; dst = target_set.sig; - for (i = 0; i < sizeof(target_sigset_t) / sizeof(abi_ulong); + for (i = 0; i < sizeof(a_target_sigset) / sizeof(abi_ulong); i++, dst++, src++) err |= __get_user(*dst, src); if (err) @@ -2167,12 +2167,12 @@ void sparc64_get_context(CPUSPARCState *env) { abi_ulong ucp_addr; struct target_ucontext *ucp; - target_mc_gregset_t *grp; - target_mcontext_t *mcp; + a_target_mc_gregset *grp; + a_target_mcontext *mcp; abi_ulong fp, i7, w_addr; int err; unsigned int i; - target_sigset_t target_set; + a_target_sigset target_set; sigset_t set; ucp_addr = env->regwptr[UREG_I0]; @@ -2197,7 +2197,7 @@ void sparc64_get_context(CPUSPARCState *env) abi_ulong *src, *dst; src = target_set.sig; dst = ucp->uc_sigmask.sig; - for (i = 0; i < sizeof(target_sigset_t) / sizeof(abi_ulong); + for (i = 0; i < sizeof(a_target_sigset) / sizeof(abi_ulong); i++, dst++, src++) err |= __put_user(*src, dst); if (err) @@ -2262,14 +2262,14 @@ 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) + a_target_sigset *set, CPUState *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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } @@ -2291,14 +2291,14 @@ 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) + a_target_sigset *set, CPUState *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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } @@ -2343,16 +2343,16 @@ struct sigframe { uint32_t sf_ass[4]; /* argument save space for o32 */ uint32_t sf_code[2]; /* signal trampoline */ struct target_sigcontext sf_sc; - target_sigset_t sf_mask; + a_target_sigset sf_mask; }; struct target_ucontext { target_ulong uc_flags; target_ulong uc_link; - target_stack_t uc_stack; + a_target_stack uc_stack; target_ulong pad0; struct target_sigcontext uc_mcontext; - target_sigset_t uc_sigmask; + a_target_sigset uc_sigmask; }; struct target_rt_sigframe { @@ -2551,7 +2551,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) + a_target_sigset *set, CPUState *regs) { struct sigframe *frame; abi_ulong frame_addr; @@ -2604,7 +2604,7 @@ long do_sigreturn(CPUState *regs) struct sigframe *frame; abi_ulong frame_addr; sigset_t blocked; - target_sigset_t target_set; + a_target_sigset target_set; int i; #if defined(DEBUG_SIGNAL) @@ -2649,8 +2649,8 @@ badframe: } static void setup_rt_frame(int sig, struct target_sigaction *ka, - target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -2782,9 +2782,9 @@ struct target_sigframe struct target_ucontext { target_ulong uc_flags; struct target_ucontext *uc_link; - target_stack_t uc_stack; + a_target_stack uc_stack; struct target_sigcontext uc_mcontext; - target_sigset_t uc_sigmask; /* mask last for extensibility */ + a_target_sigset uc_sigmask; /* mask last for extensibility */ }; struct target_rt_sigframe @@ -2861,7 +2861,7 @@ static int restore_sigcontext(CPUState *regs, } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *regs) + a_target_sigset *set, CPUState *regs) { struct target_sigframe *frame; abi_ulong frame_addr; @@ -2912,8 +2912,8 @@ give_sigsegv: } static void setup_rt_frame(int sig, struct target_sigaction *ka, - target_siginfo_t *info, - target_sigset_t *set, CPUState *regs) + a_target_siginfo *info, + a_target_sigset *set, CPUState *regs) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -2979,7 +2979,7 @@ long do_sigreturn(CPUState *regs) struct target_sigframe *frame; abi_ulong frame_addr; sigset_t blocked; - target_sigset_t target_set; + a_target_sigset target_set; int i; int err = 0; @@ -3151,7 +3151,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) + a_target_sigset *set, CPUState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; @@ -3214,8 +3214,8 @@ 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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { fprintf(stderr, "Microblaze setup_rt_frame: not implemented\n"); } @@ -3224,7 +3224,7 @@ long do_sigreturn(CPUState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; - target_sigset_t target_set; + a_target_sigset target_set; sigset_t set; int i; @@ -3339,7 +3339,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) + a_target_sigset *set, CPUState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; @@ -3389,8 +3389,8 @@ 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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { fprintf(stderr, "CRIS setup_rt_frame: not implemented\n"); } @@ -3399,7 +3399,7 @@ long do_sigreturn(CPUState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; - target_sigset_t target_set; + a_target_sigset target_set; sigset_t set; int i; @@ -3537,7 +3537,7 @@ struct target_mcontext { #else #define QEMU_NVRREG 33 #endif - ppc_avr_t altivec[QEMU_NVRREG]; + union ppc_avr altivec[QEMU_NVRREG]; #undef QEMU_NVRREG } mc_vregs __attribute__((__aligned__(16))); }; @@ -3551,9 +3551,9 @@ struct target_ucontext { target_ulong uc_regs; /* struct mcontext __user * points to uc_mcontext field */ #endif - target_sigset_t uc_sigmask; + a_target_sigset uc_sigmask; #if defined(TARGET_PPC64) - target_sigset_t unused[15]; /* Allow for uc_sigmask growth */ + a_target_sigset unused[15]; /* Allow for uc_sigmask growth */ struct target_sigcontext uc_mcontext; #else int32_t uc_maskext[30]; @@ -3630,8 +3630,8 @@ static int save_user_regs(CPUState *env, struct target_mcontext *frame, /* Save Altivec registers if necessary. */ if (env->insns_flags & PPC_ALTIVEC) { for (i = 0; i < ARRAY_SIZE(env->avr); i++) { - ppc_avr_t *avr = &env->avr[i]; - ppc_avr_t *vreg = &frame->mc_vregs.altivec[i]; + union ppc_avr *avr = &env->avr[i]; + union ppc_avr *vreg = &frame->mc_vregs.altivec[i]; if (__put_user(avr->u64[0], &vreg->u64[0]) || __put_user(avr->u64[1], &vreg->u64[1])) { @@ -3739,8 +3739,8 @@ static int restore_user_regs(CPUState *env, /* Restore Altivec registers if necessary. */ if (env->insns_flags & PPC_ALTIVEC) { for (i = 0; i < ARRAY_SIZE(env->avr); i++) { - ppc_avr_t *avr = &env->avr[i]; - ppc_avr_t *vreg = &frame->mc_vregs.altivec[i]; + union ppc_avr *avr = &env->avr[i]; + union ppc_avr *vreg = &frame->mc_vregs.altivec[i]; if (__get_user(avr->u64[0], &vreg->u64[0]) || __get_user(avr->u64[1], &vreg->u64[1])) { @@ -3793,7 +3793,7 @@ static int restore_user_regs(CPUState *env, } static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + a_target_sigset *set, CPUState *env) { struct target_sigframe *frame; struct target_sigcontext *sc; @@ -3854,8 +3854,8 @@ sigsegv: } static void setup_rt_frame(int sig, struct target_sigaction *ka, - target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { struct target_rt_sigframe *rt_sf; struct target_mcontext *frame; @@ -3929,7 +3929,7 @@ long do_sigreturn(CPUState *env) struct target_mcontext *sr = NULL; target_ulong sr_addr, sc_addr; sigset_t blocked; - target_sigset_t set; + a_target_sigset set; sc_addr = env->gpr[1] + SIGNAL_FRAMESIZE; if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1)) @@ -3971,7 +3971,7 @@ static int do_setcontext(struct target_ucontext *ucp, CPUState *env, int sig) struct target_mcontext *mcp; target_ulong mcp_addr; sigset_t blocked; - target_sigset_t set; + a_target_sigset set; if (copy_from_user(&set, h2g(ucp) + offsetof(struct target_ucontext, uc_sigmask), sizeof (set))) @@ -4052,19 +4052,19 @@ struct target_sigframe struct target_sigcontext sc; }; -typedef int target_greg_t; +typedef int a_target_greg; #define TARGET_NGREG 18 -typedef target_greg_t target_gregset_t[TARGET_NGREG]; +typedef a_target_greg a_target_gregset[TARGET_NGREG]; typedef struct target_fpregset { int f_fpcntl[3]; int f_fpregs[8*3]; -} target_fpregset_t; +} a_target_fpregset; struct target_mcontext { int version; - target_gregset_t gregs; - target_fpregset_t fpregs; + a_target_gregset gregs; + a_target_fpregset fpregs; }; #define TARGET_MCONTEXT_VERSION 2 @@ -4072,10 +4072,10 @@ struct target_mcontext { struct target_ucontext { abi_ulong uc_flags; abi_ulong uc_link; - target_stack_t uc_stack; + a_target_stack uc_stack; struct target_mcontext uc_mcontext; abi_long uc_filler[80]; - target_sigset_t uc_sigmask; + a_target_sigset uc_sigmask; }; struct target_rt_sigframe @@ -4144,7 +4144,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) + a_target_sigset *set, CPUState *env) { struct target_sigframe *frame; abi_ulong frame_addr; @@ -4200,7 +4200,7 @@ give_sigsegv: static inline int target_rt_setup_ucontext(struct target_ucontext *uc, CPUState *env) { - target_greg_t *gregs = uc->uc_mcontext.gregs; + a_target_greg *gregs = uc->uc_mcontext.gregs; int err; err = __put_user(TARGET_MCONTEXT_VERSION, &uc->uc_mcontext.version); @@ -4232,7 +4232,7 @@ static inline int target_rt_restore_ucontext(CPUState *env, { int temp; int err; - target_greg_t *gregs = uc->uc_mcontext.gregs; + a_target_greg *gregs = uc->uc_mcontext.gregs; err = __get_user(temp, &uc->uc_mcontext.version); if (temp != TARGET_MCONTEXT_VERSION) @@ -4267,8 +4267,8 @@ badframe: } static void setup_rt_frame(int sig, struct target_sigaction *ka, - target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr; @@ -4343,7 +4343,7 @@ long do_sigreturn(CPUState *env) { struct target_sigframe *frame; abi_ulong frame_addr = env->aregs[7] - 4; - target_sigset_t target_set; + a_target_sigset target_set; sigset_t set; int d0, i; @@ -4381,7 +4381,7 @@ long do_rt_sigreturn(CPUState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr = env->aregs[7] - 4; - target_sigset_t target_set; + a_target_sigset target_set; sigset_t set; int d0; @@ -4413,14 +4413,14 @@ badframe: #else static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + a_target_sigset *set, CPUState *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) + a_target_siginfo *info, + a_target_sigset *set, CPUState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } @@ -4444,7 +4444,7 @@ void process_pending_signals(CPUState *cpu_env) int sig; abi_ulong handler; sigset_t set, old_set; - target_sigset_t target_old_set; + a_target_sigset target_old_set; struct emulated_sigtable *k; struct target_sigaction *sa; struct sigqueue *q; diff --git a/linux-user/sparc/target_signal.h b/linux-user/sparc/target_signal.h index c7de300..a63ee7f 100644 --- a/linux-user/sparc/target_signal.h +++ b/linux-user/sparc/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/sparc64/target_signal.h b/linux-user/sparc64/target_signal.h index c7de300..a63ee7f 100644 --- a/linux-user/sparc64/target_signal.h +++ b/linux-user/sparc64/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bf06d14..0fd6f78 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4255,10 +4255,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, info.si_pid = 0; ret = get_errno(waitid(arg1, arg2, &info, arg4)); if (!is_error(ret) && arg3 && info.si_pid != 0) { - if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_siginfo_t), 0))) + if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(a_target_siginfo), 0))) goto efault; host_to_target_siginfo(p, &info); - unlock_user(p, arg3, sizeof(target_siginfo_t)); + unlock_user(p, arg3, sizeof(a_target_siginfo)); } } break; @@ -4888,7 +4888,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = -TARGET_EINVAL; goto fail; } - if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1))) + if (!(p = lock_user(VERIFY_READ, arg2, sizeof(a_target_sigset), 1))) goto efault; target_to_host_old_sigset(&set, p); unlock_user(p, arg2, 0); @@ -4899,10 +4899,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, } ret = get_errno(sigprocmask(arg1, set_ptr, &oldset)); if (!is_error(ret) && arg3) { - if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0))) + if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(a_target_sigset), 0))) goto efault; host_to_target_old_sigset(p, &oldset); - unlock_user(p, arg3, sizeof(target_sigset_t)); + unlock_user(p, arg3, sizeof(a_target_sigset)); } } break; @@ -4927,7 +4927,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = -TARGET_EINVAL; goto fail; } - if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1))) + if (!(p = lock_user(VERIFY_READ, arg2, sizeof(a_target_sigset), 1))) goto efault; target_to_host_sigset(&set, p); unlock_user(p, arg2, 0); @@ -4938,10 +4938,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, } ret = get_errno(sigprocmask(how, set_ptr, &oldset)); if (!is_error(ret) && arg3) { - if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0))) + if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(a_target_sigset), 0))) goto efault; host_to_target_sigset(p, &oldset); - unlock_user(p, arg3, sizeof(target_sigset_t)); + unlock_user(p, arg3, sizeof(a_target_sigset)); } } break; @@ -4951,10 +4951,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, sigset_t set; ret = get_errno(sigpending(&set)); if (!is_error(ret)) { - if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0))) + if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(a_target_sigset), 0))) goto efault; host_to_target_old_sigset(p, &set); - unlock_user(p, arg1, sizeof(target_sigset_t)); + unlock_user(p, arg1, sizeof(a_target_sigset)); } } break; @@ -4964,10 +4964,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, sigset_t set; ret = get_errno(sigpending(&set)); if (!is_error(ret)) { - if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0))) + if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(a_target_sigset), 0))) goto efault; host_to_target_sigset(p, &set); - unlock_user(p, arg1, sizeof(target_sigset_t)); + unlock_user(p, arg1, sizeof(a_target_sigset)); } } break; @@ -4975,7 +4975,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_sigsuspend: { sigset_t set; - if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1))) + if (!(p = lock_user(VERIFY_READ, arg1, sizeof(a_target_sigset), 1))) goto efault; target_to_host_old_sigset(&set, p); unlock_user(p, arg1, 0); @@ -4986,7 +4986,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_rt_sigsuspend: { sigset_t set; - if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1))) + if (!(p = lock_user(VERIFY_READ, arg1, sizeof(a_target_sigset), 1))) goto efault; target_to_host_sigset(&set, p); unlock_user(p, arg1, 0); @@ -4999,7 +4999,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, struct timespec uts, *puts; siginfo_t uinfo; - if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1))) + if (!(p = lock_user(VERIFY_READ, arg1, sizeof(a_target_sigset), 1))) goto efault; target_to_host_sigset(&set, p); unlock_user(p, arg1, 0); @@ -5011,17 +5011,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, } ret = get_errno(sigtimedwait(&set, &uinfo, puts)); if (!is_error(ret) && arg2) { - if (!(p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t), 0))) + if (!(p = lock_user(VERIFY_WRITE, arg2, sizeof(a_target_siginfo), 0))) goto efault; host_to_target_siginfo(p, &uinfo); - unlock_user(p, arg2, sizeof(target_siginfo_t)); + unlock_user(p, arg2, sizeof(a_target_siginfo)); } } break; case TARGET_NR_rt_sigqueueinfo: { siginfo_t uinfo; - if (!(p = lock_user(VERIFY_READ, arg3, sizeof(target_sigset_t), 1))) + if (!(p = lock_user(VERIFY_READ, arg3, sizeof(a_target_sigset), 1))) goto efault; target_to_host_siginfo(&uinfo, p); unlock_user(p, arg1, 0); diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index c018165..fa3950a 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -148,15 +148,15 @@ struct target_itimerval { struct target_timeval it_value; }; -typedef abi_long target_clock_t; +typedef abi_long a_target_clock; #define TARGET_HZ 100 struct target_tms { - target_clock_t tms_utime; - target_clock_t tms_stime; - target_clock_t tms_cutime; - target_clock_t tms_cstime; + a_target_clock tms_utime; + a_target_clock tms_stime; + a_target_clock tms_cutime; + a_target_clock tms_cstime; }; struct target_utimbuf { @@ -235,7 +235,7 @@ struct target_rusage { typedef struct { int val[2]; -} kernel_fsid_t; +} a_kernel_fsid; struct kernel_statfs { int f_type; @@ -245,7 +245,7 @@ struct kernel_statfs { int f_bavail; int f_files; int f_ffree; - kernel_fsid_t f_fsid; + a_kernel_fsid f_fsid; int f_namelen; int f_spare[6]; }; @@ -281,23 +281,23 @@ struct target_dirent64 { typedef struct { abi_ulong sig[TARGET_NSIG_WORDS]; -} target_sigset_t; +} a_target_sigset; #ifdef BSWAP_NEEDED -static inline void tswap_sigset(target_sigset_t *d, const target_sigset_t *s) +static inline void tswap_sigset(a_target_sigset *d, const a_target_sigset *s) { int i; for(i = 0;i < TARGET_NSIG_WORDS; i++) d->sig[i] = tswapl(s->sig[i]); } #else -static inline void tswap_sigset(target_sigset_t *d, const target_sigset_t *s) +static inline void tswap_sigset(a_target_sigset *d, const a_target_sigset *s) { *d = *s; } #endif -static inline void target_siginitset(target_sigset_t *d, abi_ulong set) +static inline void target_siginitset(a_target_sigset *d, abi_ulong set) { int i; d->sig[0] = set; @@ -305,8 +305,8 @@ static inline void target_siginitset(target_sigset_t *d, abi_ulong set) d->sig[i] = 0; } -void host_to_target_sigset(target_sigset_t *d, const sigset_t *s); -void target_to_host_sigset(sigset_t *d, const target_sigset_t *s); +void host_to_target_sigset(a_target_sigset *d, const sigset_t *s); +void target_to_host_sigset(sigset_t *d, const a_target_sigset *s); void host_to_target_old_sigset(abi_ulong *old_sigset, const sigset_t *sigset); void target_to_host_old_sigset(sigset_t *sigset, @@ -481,7 +481,7 @@ struct target_sigaction { #else abi_ulong _sa_handler; #endif - target_sigset_t sa_mask; + a_target_sigset sa_mask; }; #else @@ -496,14 +496,14 @@ struct target_sigaction { abi_ulong _sa_handler; abi_ulong sa_flags; abi_ulong sa_restorer; - target_sigset_t sa_mask; + a_target_sigset sa_mask; }; #endif typedef union target_sigval { int sival_int; abi_ulong sival_ptr; -} target_sigval_t; +} a_target_sigval; #if 0 #if defined (TARGET_SPARC) typedef struct { @@ -562,7 +562,7 @@ typedef struct target_siginfo { struct { pid_t _pid; /* sender's pid */ uid_t _uid; /* sender's uid */ - target_sigval_t _sigval; + a_target_sigval _sigval; } _rt; /* SIGCHLD */ @@ -570,8 +570,8 @@ typedef struct target_siginfo { pid_t _pid; /* which child */ uid_t _uid; /* sender's uid */ int _status; /* exit code */ - target_clock_t _utime; - target_clock_t _stime; + a_target_clock _utime; + a_target_clock _stime; } _sigchld; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ @@ -585,7 +585,7 @@ typedef struct target_siginfo { int _fd; } _sigpoll; } _sifields; -} target_siginfo_t; +} a_target_siginfo; /* * si_code values @@ -1623,7 +1623,7 @@ struct target_stat { typedef struct { int val[2]; -} target_fsid_t; +} a_target_fsid; #ifdef TARGET_MIPS #ifdef TARGET_ABI_MIPSN32 @@ -1638,7 +1638,7 @@ struct target_statfs { int32_t f_bavail; /* Linux specials */ - target_fsid_t f_fsid; + a_target_fsid f_fsid; int32_t f_namelen; int32_t f_spare[6]; }; @@ -1654,7 +1654,7 @@ struct target_statfs { abi_long f_bavail; /* Linux specials */ - target_fsid_t f_fsid; + a_target_fsid f_fsid; abi_long f_namelen; abi_long f_spare[6]; }; @@ -1670,7 +1670,7 @@ struct target_statfs64 { uint64_t f_files; uint64_t f_ffree; uint64_t f_bavail; - target_fsid_t f_fsid; + a_target_fsid f_fsid; uint32_t f_namelen; uint32_t f_spare[6]; }; @@ -1684,7 +1684,7 @@ struct target_statfs { abi_long f_bavail; abi_long f_files; abi_long f_ffree; - target_fsid_t f_fsid; + a_target_fsid f_fsid; abi_long f_namelen; abi_long f_frsize; abi_long f_spare[5]; @@ -1698,7 +1698,7 @@ struct target_statfs64 { abi_long f_bavail; abi_long f_files; abi_long f_ffree; - target_fsid_t f_fsid; + a_target_fsid f_fsid; abi_long f_namelen; abi_long f_frsize; abi_long f_spare[5]; @@ -1712,7 +1712,7 @@ struct target_statfs { uint32_t f_bavail; uint32_t f_files; uint32_t f_ffree; - target_fsid_t f_fsid; + a_target_fsid f_fsid; uint32_t f_namelen; uint32_t f_frsize; uint32_t f_spare[5]; @@ -1726,7 +1726,7 @@ struct target_statfs64 { uint64_t f_bavail; uint64_t f_files; uint64_t f_ffree; - target_fsid_t f_fsid; + a_target_fsid f_fsid; uint32_t f_namelen; uint32_t f_frsize; uint32_t f_spare[5]; diff --git a/linux-user/x86_64/target_signal.h b/linux-user/x86_64/target_signal.h index 9baf7fb..da86689 100644 --- a/linux-user/x86_64/target_signal.h +++ b/linux-user/x86_64/target_signal.h @@ -9,7 +9,7 @@ typedef struct target_sigaltstack { abi_ulong ss_sp; abi_long ss_flags; abi_ulong ss_size; -} target_stack_t; +} a_target_stack; /* diff --git a/linux-user/x86_64/termbits.h b/linux-user/x86_64/termbits.h index 1c3445c..b958549 100644 --- a/linux-user/x86_64/termbits.h +++ b/linux-user/x86_64/termbits.h @@ -1,15 +1,15 @@ #define TARGET_NCCS 19 -typedef unsigned char target_cc_t; -typedef unsigned int target_speed_t; -typedef unsigned int target_tcflag_t; +typedef unsigned char a_target_cc; +typedef unsigned int a_target_speed; +typedef unsigned int a_target_tcflag; struct target_termios { - target_tcflag_t c_iflag; /* input mode flags */ - target_tcflag_t c_oflag; /* output mode flags */ - target_tcflag_t c_cflag; /* control mode flags */ - target_tcflag_t c_lflag; /* local mode flags */ - target_cc_t c_line; /* line discipline */ - target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + a_target_tcflag c_iflag; /* input mode flags */ + a_target_tcflag c_oflag; /* output mode flags */ + a_target_tcflag c_cflag; /* control mode flags */ + a_target_tcflag c_lflag; /* local mode flags */ + a_target_cc c_line; /* line discipline */ + a_target_cc c_cc[TARGET_NCCS]; /* control characters */ }; /* c_cc characters */ |