Commit a315a14547b07377eb30a517ffcd2344a819266d
1 parent
4fa5d772
initial sparc64 support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1256 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
6 changed files
with
664 additions
and
18 deletions
linux-user/elfload.c
| @@ -94,11 +94,33 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i | @@ -94,11 +94,33 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i | ||
| 94 | #endif | 94 | #endif |
| 95 | 95 | ||
| 96 | #ifdef TARGET_SPARC | 96 | #ifdef TARGET_SPARC |
| 97 | +#ifdef TARGET_SPARC64 | ||
| 97 | 98 | ||
| 98 | #define ELF_START_MMAP 0x80000000 | 99 | #define ELF_START_MMAP 0x80000000 |
| 99 | 100 | ||
| 100 | #define elf_check_arch(x) ( (x) == EM_SPARC ) | 101 | #define elf_check_arch(x) ( (x) == EM_SPARC ) |
| 101 | 102 | ||
| 103 | +#define ELF_CLASS ELFCLASS64 | ||
| 104 | +#define ELF_DATA ELFDATA2MSB | ||
| 105 | +#define ELF_ARCH EM_SPARC | ||
| 106 | + | ||
| 107 | +/*XXX*/ | ||
| 108 | +#define ELF_PLAT_INIT(_r) | ||
| 109 | + | ||
| 110 | +static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) | ||
| 111 | +{ | ||
| 112 | + regs->tstate = 0; | ||
| 113 | + regs->pc = infop->entry; | ||
| 114 | + regs->npc = regs->pc + 4; | ||
| 115 | + regs->y = 0; | ||
| 116 | + regs->u_regs[14] = infop->start_stack - 16 * 4; | ||
| 117 | +} | ||
| 118 | + | ||
| 119 | +#else | ||
| 120 | +#define ELF_START_MMAP 0x80000000 | ||
| 121 | + | ||
| 122 | +#define elf_check_arch(x) ( (x) == EM_SPARC ) | ||
| 123 | + | ||
| 102 | #define ELF_CLASS ELFCLASS32 | 124 | #define ELF_CLASS ELFCLASS32 |
| 103 | #define ELF_DATA ELFDATA2MSB | 125 | #define ELF_DATA ELFDATA2MSB |
| 104 | #define ELF_ARCH EM_SPARC | 126 | #define ELF_ARCH EM_SPARC |
| @@ -116,6 +138,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i | @@ -116,6 +138,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i | ||
| 116 | } | 138 | } |
| 117 | 139 | ||
| 118 | #endif | 140 | #endif |
| 141 | +#endif | ||
| 119 | 142 | ||
| 120 | #ifdef TARGET_PPC | 143 | #ifdef TARGET_PPC |
| 121 | 144 |
linux-user/signal.c
| @@ -131,7 +131,7 @@ static void host_to_target_sigset_internal(target_sigset_t *d, | @@ -131,7 +131,7 @@ static void host_to_target_sigset_internal(target_sigset_t *d, | ||
| 131 | d->sig[0] = target_sigmask; | 131 | d->sig[0] = target_sigmask; |
| 132 | d->sig[1] = sigmask >> 32; | 132 | d->sig[1] = sigmask >> 32; |
| 133 | #else | 133 | #else |
| 134 | -#error host_to_target_sigset | 134 | +#warning host_to_target_sigset |
| 135 | #endif | 135 | #endif |
| 136 | } | 136 | } |
| 137 | 137 | ||
| @@ -165,7 +165,7 @@ void target_to_host_sigset_internal(sigset_t *d, const target_sigset_t *s) | @@ -165,7 +165,7 @@ void target_to_host_sigset_internal(sigset_t *d, const target_sigset_t *s) | ||
| 165 | #elif TARGET_LONG_BITS == 32 && HOST_LONG_BITS == 64 && TARGET_NSIG_WORDS == 2 | 165 | #elif TARGET_LONG_BITS == 32 && HOST_LONG_BITS == 64 && TARGET_NSIG_WORDS == 2 |
| 166 | ((unsigned long *)d)[0] = sigmask | ((unsigned long)(s->sig[1]) << 32); | 166 | ((unsigned long *)d)[0] = sigmask | ((unsigned long)(s->sig[1]) << 32); |
| 167 | #else | 167 | #else |
| 168 | -#error target_to_host_sigset | 168 | +#warning target_to_host_sigset |
| 169 | #endif /* TARGET_LONG_BITS */ | 169 | #endif /* TARGET_LONG_BITS */ |
| 170 | } | 170 | } |
| 171 | 171 | ||
| @@ -1391,10 +1391,10 @@ setup___siginfo(__siginfo_t *si, CPUState *env, target_ulong mask) | @@ -1391,10 +1391,10 @@ setup___siginfo(__siginfo_t *si, CPUState *env, target_ulong mask) | ||
| 1391 | err |= __put_user(env->pc, &si->si_regs.pc); | 1391 | err |= __put_user(env->pc, &si->si_regs.pc); |
| 1392 | err |= __put_user(env->npc, &si->si_regs.npc); | 1392 | err |= __put_user(env->npc, &si->si_regs.npc); |
| 1393 | err |= __put_user(env->y, &si->si_regs.y); | 1393 | err |= __put_user(env->y, &si->si_regs.y); |
| 1394 | - for (i=0; i < 7; i++) { | 1394 | + for (i=0; i < 8; i++) { |
| 1395 | err |= __put_user(env->gregs[i], &si->si_regs.u_regs[i]); | 1395 | err |= __put_user(env->gregs[i], &si->si_regs.u_regs[i]); |
| 1396 | } | 1396 | } |
| 1397 | - for (i=0; i < 7; i++) { | 1397 | + for (i=0; i < 8; i++) { |
| 1398 | err |= __put_user(env->regwptr[UREG_I0 + i], &si->si_regs.u_regs[i+8]); | 1398 | err |= __put_user(env->regwptr[UREG_I0 + i], &si->si_regs.u_regs[i+8]); |
| 1399 | } | 1399 | } |
| 1400 | err |= __put_user(mask, &si->si_mask); | 1400 | err |= __put_user(mask, &si->si_mask); |
| @@ -1452,10 +1452,10 @@ static void setup_frame(int sig, struct emulated_sigaction *ka, | @@ -1452,10 +1452,10 @@ static void setup_frame(int sig, struct emulated_sigaction *ka, | ||
| 1452 | err |= __put_user(set->sig[i + 1], &sf->extramask[i]); | 1452 | err |= __put_user(set->sig[i + 1], &sf->extramask[i]); |
| 1453 | } | 1453 | } |
| 1454 | 1454 | ||
| 1455 | - for (i = 0; i < 7; i++) { | 1455 | + for (i = 0; i < 8; i++) { |
| 1456 | err |= __put_user(env->regwptr[i + UREG_L0], &sf->ss.locals[i]); | 1456 | err |= __put_user(env->regwptr[i + UREG_L0], &sf->ss.locals[i]); |
| 1457 | } | 1457 | } |
| 1458 | - for (i = 0; i < 7; i++) { | 1458 | + for (i = 0; i < 8; i++) { |
| 1459 | err |= __put_user(env->regwptr[i + UREG_I0], &sf->ss.ins[i]); | 1459 | err |= __put_user(env->regwptr[i + UREG_I0], &sf->ss.ins[i]); |
| 1460 | } | 1460 | } |
| 1461 | if (err) | 1461 | if (err) |
| @@ -1488,7 +1488,6 @@ static void setup_frame(int sig, struct emulated_sigaction *ka, | @@ -1488,7 +1488,6 @@ static void setup_frame(int sig, struct emulated_sigaction *ka, | ||
| 1488 | //flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); | 1488 | //flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); |
| 1489 | // tb_flush(env); | 1489 | // tb_flush(env); |
| 1490 | } | 1490 | } |
| 1491 | - //cpu_dump_state(env, stderr, fprintf, 0); | ||
| 1492 | return; | 1491 | return; |
| 1493 | 1492 | ||
| 1494 | //sigill_and_return: | 1493 | //sigill_and_return: |
| @@ -1569,7 +1568,6 @@ long do_sigreturn(CPUState *env) | @@ -1569,7 +1568,6 @@ long do_sigreturn(CPUState *env) | ||
| 1569 | err = __get_user(pc, &sf->info.si_regs.pc); | 1568 | err = __get_user(pc, &sf->info.si_regs.pc); |
| 1570 | err |= __get_user(npc, &sf->info.si_regs.npc); | 1569 | err |= __get_user(npc, &sf->info.si_regs.npc); |
| 1571 | 1570 | ||
| 1572 | - // fprintf(stderr, "pc: %lx npc %lx\n", pc, npc); | ||
| 1573 | if ((pc | npc) & 3) | 1571 | if ((pc | npc) & 3) |
| 1574 | goto segv_and_exit; | 1572 | goto segv_and_exit; |
| 1575 | 1573 | ||
| @@ -1577,16 +1575,16 @@ long do_sigreturn(CPUState *env) | @@ -1577,16 +1575,16 @@ long do_sigreturn(CPUState *env) | ||
| 1577 | err |= __get_user(up_psr, &sf->info.si_regs.psr); | 1575 | err |= __get_user(up_psr, &sf->info.si_regs.psr); |
| 1578 | 1576 | ||
| 1579 | /* User can only change condition codes and FPU enabling in %psr. */ | 1577 | /* User can only change condition codes and FPU enabling in %psr. */ |
| 1580 | - env->psr = (up_psr & ~(PSR_ICC /* | PSR_EF */)) | ||
| 1581 | - | (env->psr & (PSR_ICC /* | PSR_EF */)); | ||
| 1582 | - fprintf(stderr, "psr: %x\n", env->psr); | ||
| 1583 | - env->pc = pc-4; | ||
| 1584 | - env->npc = pc; | 1578 | + env->psr = (up_psr & (PSR_ICC /* | PSR_EF */)) |
| 1579 | + | (env->psr & ~(PSR_ICC /* | PSR_EF */)); | ||
| 1580 | + | ||
| 1581 | + env->pc = pc; | ||
| 1582 | + env->npc = npc; | ||
| 1585 | err |= __get_user(env->y, &sf->info.si_regs.y); | 1583 | err |= __get_user(env->y, &sf->info.si_regs.y); |
| 1586 | - for (i=0; i < 7; i++) { | 1584 | + for (i=0; i < 8; i++) { |
| 1587 | err |= __get_user(env->gregs[i], &sf->info.si_regs.u_regs[i]); | 1585 | err |= __get_user(env->gregs[i], &sf->info.si_regs.u_regs[i]); |
| 1588 | } | 1586 | } |
| 1589 | - for (i=0; i < 7; i++) { | 1587 | + for (i=0; i < 8; i++) { |
| 1590 | err |= __get_user(env->regwptr[i + UREG_I0], &sf->info.si_regs.u_regs[i+8]); | 1588 | err |= __get_user(env->regwptr[i + UREG_I0], &sf->info.si_regs.u_regs[i+8]); |
| 1591 | } | 1589 | } |
| 1592 | 1590 | ||
| @@ -1609,7 +1607,6 @@ long do_sigreturn(CPUState *env) | @@ -1609,7 +1607,6 @@ long do_sigreturn(CPUState *env) | ||
| 1609 | if (err) | 1607 | if (err) |
| 1610 | goto segv_and_exit; | 1608 | goto segv_and_exit; |
| 1611 | 1609 | ||
| 1612 | - // fprintf(stderr, "returning %lx\n", env->regwptr[0]); | ||
| 1613 | return env->regwptr[0]; | 1610 | return env->regwptr[0]; |
| 1614 | 1611 | ||
| 1615 | segv_and_exit: | 1612 | segv_and_exit: |
linux-user/sparc64/syscall.h
0 โ 100644
linux-user/sparc64/syscall_nr.h
0 โ 100644
| 1 | +#define TARGET_NR_restart_syscall 0 /* Linux Specific */ | ||
| 2 | +#define TARGET_NR_exit 1 /* Common */ | ||
| 3 | +#define TARGET_NR_fork 2 /* Common */ | ||
| 4 | +#define TARGET_NR_read 3 /* Common */ | ||
| 5 | +#define TARGET_NR_write 4 /* Common */ | ||
| 6 | +#define TARGET_NR_open 5 /* Common */ | ||
| 7 | +#define TARGET_NR_close 6 /* Common */ | ||
| 8 | +#define TARGET_NR_wait4 7 /* Common */ | ||
| 9 | +#define TARGET_NR_creat 8 /* Common */ | ||
| 10 | +#define TARGET_NR_link 9 /* Common */ | ||
| 11 | +#define TARGET_NR_unlink 10 /* Common */ | ||
| 12 | +#define TARGET_NR_execv 11 /* SunOS Specific */ | ||
| 13 | +#define TARGET_NR_chdir 12 /* Common */ | ||
| 14 | +#define TARGET_NR_chown 13 /* Common */ | ||
| 15 | +#define TARGET_NR_mknod 14 /* Common */ | ||
| 16 | +#define TARGET_NR_chmod 15 /* Common */ | ||
| 17 | +#define TARGET_NR_lchown 16 /* Common */ | ||
| 18 | +#define TARGET_NR_brk 17 /* Common */ | ||
| 19 | +#define TARGET_NR_perfctr 18 /* Performance counter operations */ | ||
| 20 | +#define TARGET_NR_lseek 19 /* Common */ | ||
| 21 | +#define TARGET_NR_getpid 20 /* Common */ | ||
| 22 | +#define TARGET_NR_capget 21 /* Linux Specific */ | ||
| 23 | +#define TARGET_NR_capset 22 /* Linux Specific */ | ||
| 24 | +#define TARGET_NR_setuid 23 /* Implemented via setreuid in SunOS */ | ||
| 25 | +#define TARGET_NR_getuid 24 /* Common */ | ||
| 26 | +/* #define TARGET_NR_time alias 25 ENOSYS under SunOS */ | ||
| 27 | +#define TARGET_NR_ptrace 26 /* Common */ | ||
| 28 | +#define TARGET_NR_alarm 27 /* Implemented via setitimer in SunOS */ | ||
| 29 | +#define TARGET_NR_sigaltstack 28 /* Common */ | ||
| 30 | +#define TARGET_NR_pause 29 /* Is sigblock(0)->sigpause() in SunOS */ | ||
| 31 | +#define TARGET_NR_utime 30 /* Implemented via utimes() under SunOS */ | ||
| 32 | +/* #define TARGET_NR_lchown32 31 Linux sparc32 specific */ | ||
| 33 | +/* #define TARGET_NR_fchown32 32 Linux sparc32 specific */ | ||
| 34 | +#define TARGET_NR_access 33 /* Common */ | ||
| 35 | +#define TARGET_NR_nice 34 /* Implemented via get/setpriority() in SunOS */ | ||
| 36 | +/* #define TARGET_NR_chown32 35 Linux sparc32 specific */ | ||
| 37 | +#define TARGET_NR_sync 36 /* Common */ | ||
| 38 | +#define TARGET_NR_kill 37 /* Common */ | ||
| 39 | +#define TARGET_NR_stat 38 /* Common */ | ||
| 40 | +#define TARGET_NR_sendfile 39 /* Linux Specific */ | ||
| 41 | +#define TARGET_NR_lstat 40 /* Common */ | ||
| 42 | +#define TARGET_NR_dup 41 /* Common */ | ||
| 43 | +#define TARGET_NR_pipe 42 /* Common */ | ||
| 44 | +#define TARGET_NR_times 43 /* Implemented via getrusage() in SunOS */ | ||
| 45 | +/* #define TARGET_NR_getuid32 44 Linux sparc32 specific */ | ||
| 46 | +#define TARGET_NR_umount2 45 /* Linux Specific */ | ||
| 47 | +#define TARGET_NR_setgid 46 /* Implemented via setregid() in SunOS */ | ||
| 48 | +#define TARGET_NR_getgid 47 /* Common */ | ||
| 49 | +#define TARGET_NR_signal 48 /* Implemented via sigvec() in SunOS */ | ||
| 50 | +#define TARGET_NR_geteuid 49 /* SunOS calls getuid() */ | ||
| 51 | +#define TARGET_NR_getegid 50 /* SunOS calls getgid() */ | ||
| 52 | +#define TARGET_NR_acct 51 /* Common */ | ||
| 53 | +#define TARGET_NR_memory_ordering 52 /* Linux Specific */ | ||
| 54 | +/* #define TARGET_NR_getgid32 53 Linux sparc32 specific */ | ||
| 55 | +#define TARGET_NR_ioctl 54 /* Common */ | ||
| 56 | +#define TARGET_NR_reboot 55 /* Common */ | ||
| 57 | +/* #define TARGET_NR_mmap2 56 Linux sparc32 Specific */ | ||
| 58 | +#define TARGET_NR_symlink 57 /* Common */ | ||
| 59 | +#define TARGET_NR_readlink 58 /* Common */ | ||
| 60 | +#define TARGET_NR_execve 59 /* Common */ | ||
| 61 | +#define TARGET_NR_umask 60 /* Common */ | ||
| 62 | +#define TARGET_NR_chroot 61 /* Common */ | ||
| 63 | +#define TARGET_NR_fstat 62 /* Common */ | ||
| 64 | +/* #define TARGET_NR_fstat64 63 Linux sparc32 Specific */ | ||
| 65 | +#define TARGET_NR_getpagesize 64 /* Common */ | ||
| 66 | +#define TARGET_NR_msync 65 /* Common in newer 1.3.x revs... */ | ||
| 67 | +#define TARGET_NR_vfork 66 /* Common */ | ||
| 68 | +#define TARGET_NR_pread64 67 /* Linux Specific */ | ||
| 69 | +#define TARGET_NR_pwrite64 68 /* Linux Specific */ | ||
| 70 | +/* #define TARGET_NR_geteuid32 69 Linux sparc32, sbrk under SunOS */ | ||
| 71 | +/* #define TARGET_NR_getegid32 70 Linux sparc32, sstk under SunOS */ | ||
| 72 | +#define TARGET_NR_mmap 71 /* Common */ | ||
| 73 | +/* #define TARGET_NR_setreuid32 72 Linux sparc32, vadvise under SunOS */ | ||
| 74 | +#define TARGET_NR_munmap 73 /* Common */ | ||
| 75 | +#define TARGET_NR_mprotect 74 /* Common */ | ||
| 76 | +#define TARGET_NR_madvise 75 /* Common */ | ||
| 77 | +#define TARGET_NR_vhangup 76 /* Common */ | ||
| 78 | +/* #define TARGET_NR_truncate64 77 Linux sparc32 Specific */ | ||
| 79 | +#define TARGET_NR_mincore 78 /* Common */ | ||
| 80 | +#define TARGET_NR_getgroups 79 /* Common */ | ||
| 81 | +#define TARGET_NR_setgroups 80 /* Common */ | ||
| 82 | +#define TARGET_NR_getpgrp 81 /* Common */ | ||
| 83 | +/* #define TARGET_NR_setgroups32 82 Linux sparc32, setpgrp under SunOS */ | ||
| 84 | +#define TARGET_NR_setitimer 83 /* Common */ | ||
| 85 | +/* #define TARGET_NR_ftruncate64 84 Linux sparc32 Specific */ | ||
| 86 | +#define TARGET_NR_swapon 85 /* Common */ | ||
| 87 | +#define TARGET_NR_getitimer 86 /* Common */ | ||
| 88 | +/* #define TARGET_NR_setuid32 87 Linux sparc32, gethostname under SunOS */ | ||
| 89 | +#define TARGET_NR_sethostname 88 /* Common */ | ||
| 90 | +/* #define TARGET_NR_setgid32 89 Linux sparc32, getdtablesize under SunOS */ | ||
| 91 | +#define TARGET_NR_dup2 90 /* Common */ | ||
| 92 | +/* #define TARGET_NR_setfsuid32 91 Linux sparc32, getdopt under SunOS */ | ||
| 93 | +#define TARGET_NR_fcntl 92 /* Common */ | ||
| 94 | +#define TARGET_NR_select 93 /* Common */ | ||
| 95 | +/* #define TARGET_NR_setfsgid32 94 Linux sparc32, setdopt under SunOS */ | ||
| 96 | +#define TARGET_NR_fsync 95 /* Common */ | ||
| 97 | +#define TARGET_NR_setpriority 96 /* Common */ | ||
| 98 | +#define TARGET_NR_socket 97 /* Common */ | ||
| 99 | +#define TARGET_NR_connect 98 /* Common */ | ||
| 100 | +#define TARGET_NR_accept 99 /* Common */ | ||
| 101 | +#define TARGET_NR_getpriority 100 /* Common */ | ||
| 102 | +#define TARGET_NR_rt_sigreturn 101 /* Linux Specific */ | ||
| 103 | +#define TARGET_NR_rt_sigaction 102 /* Linux Specific */ | ||
| 104 | +#define TARGET_NR_rt_sigprocmask 103 /* Linux Specific */ | ||
| 105 | +#define TARGET_NR_rt_sigpending 104 /* Linux Specific */ | ||
| 106 | +#define TARGET_NR_rt_sigtimedwait 105 /* Linux Specific */ | ||
| 107 | +#define TARGET_NR_rt_sigqueueinfo 106 /* Linux Specific */ | ||
| 108 | +#define TARGET_NR_rt_sigsuspend 107 /* Linux Specific */ | ||
| 109 | +#define TARGET_NR_setresuid 108 /* Linux Specific, sigvec under SunOS */ | ||
| 110 | +#define TARGET_NR_getresuid 109 /* Linux Specific, sigblock under SunOS */ | ||
| 111 | +#define TARGET_NR_setresgid 110 /* Linux Specific, sigsetmask under SunOS */ | ||
| 112 | +#define TARGET_NR_getresgid 111 /* Linux Specific, sigpause under SunOS */ | ||
| 113 | +/* #define TARGET_NR_setregid32 75 Linux sparc32, sigstack under SunOS */ | ||
| 114 | +#define TARGET_NR_recvmsg 113 /* Common */ | ||
| 115 | +#define TARGET_NR_sendmsg 114 /* Common */ | ||
| 116 | +/* #define TARGET_NR_getgroups32 115 Linux sparc32, vtrace under SunOS */ | ||
| 117 | +#define TARGET_NR_gettimeofday 116 /* Common */ | ||
| 118 | +#define TARGET_NR_getrusage 117 /* Common */ | ||
| 119 | +#define TARGET_NR_getsockopt 118 /* Common */ | ||
| 120 | +#define TARGET_NR_getcwd 119 /* Linux Specific */ | ||
| 121 | +#define TARGET_NR_readv 120 /* Common */ | ||
| 122 | +#define TARGET_NR_writev 121 /* Common */ | ||
| 123 | +#define TARGET_NR_settimeofday 122 /* Common */ | ||
| 124 | +#define TARGET_NR_fchown 123 /* Common */ | ||
| 125 | +#define TARGET_NR_fchmod 124 /* Common */ | ||
| 126 | +#define TARGET_NR_recvfrom 125 /* Common */ | ||
| 127 | +#define TARGET_NR_setreuid 126 /* Common */ | ||
| 128 | +#define TARGET_NR_setregid 127 /* Common */ | ||
| 129 | +#define TARGET_NR_rename 128 /* Common */ | ||
| 130 | +#define TARGET_NR_truncate 129 /* Common */ | ||
| 131 | +#define TARGET_NR_ftruncate 130 /* Common */ | ||
| 132 | +#define TARGET_NR_flock 131 /* Common */ | ||
| 133 | +/* #define TARGET_NR_lstat64 132 Linux sparc32 Specific */ | ||
| 134 | +#define TARGET_NR_sendto 133 /* Common */ | ||
| 135 | +#define TARGET_NR_shutdown 134 /* Common */ | ||
| 136 | +#define TARGET_NR_socketpair 135 /* Common */ | ||
| 137 | +#define TARGET_NR_mkdir 136 /* Common */ | ||
| 138 | +#define TARGET_NR_rmdir 137 /* Common */ | ||
| 139 | +#define TARGET_NR_utimes 138 /* SunOS Specific */ | ||
| 140 | +/* #define TARGET_NR_stat64 139 Linux sparc32 Specific */ | ||
| 141 | +#define TARGET_NR_sendfile64 140 /* adjtime under SunOS */ | ||
| 142 | +#define TARGET_NR_getpeername 141 /* Common */ | ||
| 143 | +#define TARGET_NR_futex 142 /* gethostid under SunOS */ | ||
| 144 | +#define TARGET_NR_gettid 143 /* ENOSYS under SunOS */ | ||
| 145 | +#define TARGET_NR_getrlimit 144 /* Common */ | ||
| 146 | +#define TARGET_NR_setrlimit 145 /* Common */ | ||
| 147 | +#define TARGET_NR_pivot_root 146 /* Linux Specific, killpg under SunOS */ | ||
| 148 | +#define TARGET_NR_prctl 147 /* ENOSYS under SunOS */ | ||
| 149 | +#define TARGET_NR_pciconfig_read 148 /* ENOSYS under SunOS */ | ||
| 150 | +#define TARGET_NR_pciconfig_write 149 /* ENOSYS under SunOS */ | ||
| 151 | +#define TARGET_NR_getsockname 150 /* Common */ | ||
| 152 | +/* #define TARGET_NR_getmsg 151 SunOS Specific */ | ||
| 153 | +/* #define TARGET_NR_putmsg 152 SunOS Specific */ | ||
| 154 | +#define TARGET_NR_poll 153 /* Common */ | ||
| 155 | +#define TARGET_NR_getdents64 154 /* Linux specific */ | ||
| 156 | +/* #define TARGET_NR_fcntl64 155 Linux sparc32 Specific */ | ||
| 157 | +/* #define TARGET_NR_getdirentries 156 SunOS Specific */ | ||
| 158 | +#define TARGET_NR_statfs 157 /* Common */ | ||
| 159 | +#define TARGET_NR_fstatfs 158 /* Common */ | ||
| 160 | +#define TARGET_NR_umount 159 /* Common */ | ||
| 161 | +#define TARGET_NR_sched_set_affinity 160 /* Linux specific, async_daemon under SunOS */ | ||
| 162 | +#define TARGET_NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */ | ||
| 163 | +#define TARGET_NR_getdomainname 162 /* SunOS Specific */ | ||
| 164 | +#define TARGET_NR_setdomainname 163 /* Common */ | ||
| 165 | +#define TARGET_NR_utrap_install 164 /* SYSV ABI/v9 required */ | ||
| 166 | +#define TARGET_NR_quotactl 165 /* Common */ | ||
| 167 | +#define TARGET_NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */ | ||
| 168 | +#define TARGET_NR_mount 167 /* Common */ | ||
| 169 | +#define TARGET_NR_ustat 168 /* Common */ | ||
| 170 | +#define TARGET_NR_setxattr 169 /* SunOS: semsys */ | ||
| 171 | +#define TARGET_NR_lsetxattr 170 /* SunOS: msgsys */ | ||
| 172 | +#define TARGET_NR_fsetxattr 171 /* SunOS: shmsys */ | ||
| 173 | +#define TARGET_NR_getxattr 172 /* SunOS: auditsys */ | ||
| 174 | +#define TARGET_NR_lgetxattr 173 /* SunOS: rfssys */ | ||
| 175 | +#define TARGET_NR_getdents 174 /* Common */ | ||
| 176 | +#define TARGET_NR_setsid 175 /* Common */ | ||
| 177 | +#define TARGET_NR_fchdir 176 /* Common */ | ||
| 178 | +#define TARGET_NR_fgetxattr 177 /* SunOS: fchroot */ | ||
| 179 | +#define TARGET_NR_listxattr 178 /* SunOS: vpixsys */ | ||
| 180 | +#define TARGET_NR_llistxattr 179 /* SunOS: aioread */ | ||
| 181 | +#define TARGET_NR_flistxattr 180 /* SunOS: aiowrite */ | ||
| 182 | +#define TARGET_NR_removexattr 181 /* SunOS: aiowait */ | ||
| 183 | +#define TARGET_NR_lremovexattr 182 /* SunOS: aiocancel */ | ||
| 184 | +#define TARGET_NR_sigpending 183 /* Common */ | ||
| 185 | +#define TARGET_NR_query_module 184 /* Linux Specific */ | ||
| 186 | +#define TARGET_NR_setpgid 185 /* Common */ | ||
| 187 | +#define TARGET_NR_fremovexattr 186 /* SunOS: pathconf */ | ||
| 188 | +#define TARGET_NR_tkill 187 /* SunOS: fpathconf */ | ||
| 189 | +#define TARGET_NR_exit_group 188 /* Linux specific, sysconf undef SunOS */ | ||
| 190 | +#define TARGET_NR_uname 189 /* Linux Specific */ | ||
| 191 | +#define TARGET_NR_init_module 190 /* Linux Specific */ | ||
| 192 | +#define TARGET_NR_personality 191 /* Linux Specific */ | ||
| 193 | +#define TARGET_NR_remap_file_pages 192 /* Linux Specific */ | ||
| 194 | +#define TARGET_NR_epoll_create 193 /* Linux Specific */ | ||
| 195 | +#define TARGET_NR_epoll_ctl 194 /* Linux Specific */ | ||
| 196 | +#define TARGET_NR_epoll_wait 195 /* Linux Specific */ | ||
| 197 | +/* #define TARGET_NR_ulimit 196 Linux Specific */ | ||
| 198 | +#define TARGET_NR_getppid 197 /* Linux Specific */ | ||
| 199 | +#define TARGET_NR_sigaction 198 /* Linux Specific */ | ||
| 200 | +#define TARGET_NR_sgetmask 199 /* Linux Specific */ | ||
| 201 | +#define TARGET_NR_ssetmask 200 /* Linux Specific */ | ||
| 202 | +#define TARGET_NR_sigsuspend 201 /* Linux Specific */ | ||
| 203 | +#define TARGET_NR_oldlstat 202 /* Linux Specific */ | ||
| 204 | +#define TARGET_NR_uselib 203 /* Linux Specific */ | ||
| 205 | +#define TARGET_NR_readdir 204 /* Linux Specific */ | ||
| 206 | +#define TARGET_NR_readahead 205 /* Linux Specific */ | ||
| 207 | +#define TARGET_NR_socketcall 206 /* Linux Specific */ | ||
| 208 | +#define TARGET_NR_syslog 207 /* Linux Specific */ | ||
| 209 | +#define TARGET_NR_lookup_dcookie 208 /* Linux Specific */ | ||
| 210 | +#define TARGET_NR_fadvise64 209 /* Linux Specific */ | ||
| 211 | +#define TARGET_NR_fadvise64_64 210 /* Linux Specific */ | ||
| 212 | +#define TARGET_NR_tgkill 211 /* Linux Specific */ | ||
| 213 | +#define TARGET_NR_waitpid 212 /* Linux Specific */ | ||
| 214 | +#define TARGET_NR_swapoff 213 /* Linux Specific */ | ||
| 215 | +#define TARGET_NR_sysinfo 214 /* Linux Specific */ | ||
| 216 | +#define TARGET_NR_ipc 215 /* Linux Specific */ | ||
| 217 | +#define TARGET_NR_sigreturn 216 /* Linux Specific */ | ||
| 218 | +#define TARGET_NR_clone 217 /* Linux Specific */ | ||
| 219 | +/* #define TARGET_NR_modify_ldt 218 Linux Specific - i386 specific, unused */ | ||
| 220 | +#define TARGET_NR_adjtimex 219 /* Linux Specific */ | ||
| 221 | +#define TARGET_NR_sigprocmask 220 /* Linux Specific */ | ||
| 222 | +#define TARGET_NR_create_module 221 /* Linux Specific */ | ||
| 223 | +#define TARGET_NR_delete_module 222 /* Linux Specific */ | ||
| 224 | +#define TARGET_NR_get_kernel_syms 223 /* Linux Specific */ | ||
| 225 | +#define TARGET_NR_getpgid 224 /* Linux Specific */ | ||
| 226 | +#define TARGET_NR_bdflush 225 /* Linux Specific */ | ||
| 227 | +#define TARGET_NR_sysfs 226 /* Linux Specific */ | ||
| 228 | +#define TARGET_NR_afs_syscall 227 /* Linux Specific */ | ||
| 229 | +#define TARGET_NR_setfsuid 228 /* Linux Specific */ | ||
| 230 | +#define TARGET_NR_setfsgid 229 /* Linux Specific */ | ||
| 231 | +#define TARGET_NR__newselect 230 /* Linux Specific */ | ||
| 232 | +#ifdef __KERNEL__ | ||
| 233 | +#define TARGET_NR_time 231 /* Linux sparc32 */ | ||
| 234 | +#endif | ||
| 235 | +/* #define TARGET_NR_oldstat 232 Linux Specific */ | ||
| 236 | +#define TARGET_NR_stime 233 /* Linux Specific */ | ||
| 237 | +#define TARGET_NR_statfs64 234 /* Linux Specific */ | ||
| 238 | +#define TARGET_NR_fstatfs64 235 /* Linux Specific */ | ||
| 239 | +#define TARGET_NR__llseek 236 /* Linux Specific */ | ||
| 240 | +#define TARGET_NR_mlock 237 | ||
| 241 | +#define TARGET_NR_munlock 238 | ||
| 242 | +#define TARGET_NR_mlockall 239 | ||
| 243 | +#define TARGET_NR_munlockall 240 | ||
| 244 | +#define TARGET_NR_sched_setparam 241 | ||
| 245 | +#define TARGET_NR_sched_getparam 242 | ||
| 246 | +#define TARGET_NR_sched_setscheduler 243 | ||
| 247 | +#define TARGET_NR_sched_getscheduler 244 | ||
| 248 | +#define TARGET_NR_sched_yield 245 | ||
| 249 | +#define TARGET_NR_sched_get_priority_max 246 | ||
| 250 | +#define TARGET_NR_sched_get_priority_min 247 | ||
| 251 | +#define TARGET_NR_sched_rr_get_interval 248 | ||
| 252 | +#define TARGET_NR_nanosleep 249 | ||
| 253 | +#define TARGET_NR_mremap 250 | ||
| 254 | +#define TARGET_NR__sysctl 251 | ||
| 255 | +#define TARGET_NR_getsid 252 | ||
| 256 | +#define TARGET_NR_fdatasync 253 | ||
| 257 | +#define TARGET_NR_nfsservctl 254 | ||
| 258 | +#define TARGET_NR_aplib 255 | ||
| 259 | +#define TARGET_NR_clock_settime 256 | ||
| 260 | +#define TARGET_NR_clock_gettime 257 | ||
| 261 | +#define TARGET_NR_clock_getres 258 | ||
| 262 | +#define TARGET_NR_clock_nanosleep 259 | ||
| 263 | +#define TARGET_NR_sched_getaffinity 260 | ||
| 264 | +#define TARGET_NR_sched_setaffinity 261 | ||
| 265 | +#define TARGET_NR_timer_settime 262 | ||
| 266 | +#define TARGET_NR_timer_gettime 263 | ||
| 267 | +#define TARGET_NR_timer_getoverrun 264 | ||
| 268 | +#define TARGET_NR_timer_delete 265 | ||
| 269 | +#define TARGET_NR_timer_create 266 | ||
| 270 | +/* #define TARGET_NR_vserver 267 Reserved for VSERVER */ | ||
| 271 | +#define TARGET_NR_io_setup 268 | ||
| 272 | +#define TARGET_NR_io_destroy 269 | ||
| 273 | +#define TARGET_NR_io_submit 270 | ||
| 274 | +#define TARGET_NR_io_cancel 271 | ||
| 275 | +#define TARGET_NR_io_getevents 272 | ||
| 276 | +#define TARGET_NR_mq_open 273 | ||
| 277 | +#define TARGET_NR_mq_unlink 274 | ||
| 278 | +#define TARGET_NR_mq_timedsend 275 | ||
| 279 | +#define TARGET_NR_mq_timedreceive 276 | ||
| 280 | +#define TARGET_NR_mq_notify 277 | ||
| 281 | +#define TARGET_NR_mq_getsetattr 278 | ||
| 282 | +#define TARGET_NR_waitid 279 | ||
| 283 | +/*#define TARGET_NR_sys_setaltroot 280 available (was setaltroot) */ | ||
| 284 | +#define TARGET_NR_add_key 281 | ||
| 285 | +#define TARGET_NR_request_key 282 | ||
| 286 | +#define TARGET_NR_keyctl 283 |
linux-user/sparc64/termbits.h
0 โ 100644
| 1 | +/* from asm/termbits.h */ | ||
| 2 | + | ||
| 3 | +#define TARGET_NCCS 19 | ||
| 4 | + | ||
| 5 | +struct target_termios { | ||
| 6 | + unsigned int c_iflag; /* input mode flags */ | ||
| 7 | + unsigned int c_oflag; /* output mode flags */ | ||
| 8 | + unsigned int c_cflag; /* control mode flags */ | ||
| 9 | + unsigned int c_lflag; /* local mode flags */ | ||
| 10 | + unsigned char c_line; /* line discipline */ | ||
| 11 | + unsigned char c_cc[TARGET_NCCS]; /* control characters */ | ||
| 12 | +}; | ||
| 13 | + | ||
| 14 | +/* c_cc characters */ | ||
| 15 | +#define TARGET_VINTR 0 | ||
| 16 | +#define TARGET_VQUIT 1 | ||
| 17 | +#define TARGET_VERASE 2 | ||
| 18 | +#define TARGET_VKILL 3 | ||
| 19 | +#define TARGET_VEOF 4 | ||
| 20 | +#define TARGET_VEOL 5 | ||
| 21 | +#define TARGET_VEOL2 6 | ||
| 22 | +#define TARGET_VSWTC 7 | ||
| 23 | +#define TARGET_VSTART 8 | ||
| 24 | +#define TARGET_VSTOP 9 | ||
| 25 | + | ||
| 26 | +#define TARGET_VSUSP 10 | ||
| 27 | +#define TARGET_VDSUSP 11 /* SunOS POSIX nicety I do believe... */ | ||
| 28 | +#define TARGET_VREPRINT 12 | ||
| 29 | +#define TARGET_VDISCARD 13 | ||
| 30 | +#define TARGET_VWERASE 14 | ||
| 31 | +#define TARGET_VLNEXT 15 | ||
| 32 | + | ||
| 33 | +/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is | ||
| 34 | + * shared with eof/eol | ||
| 35 | + */ | ||
| 36 | +#define TARGET_VMIN TARGET_VEOF | ||
| 37 | +#define TARGET_VTIME TARGET_VEOL | ||
| 38 | + | ||
| 39 | +/* c_iflag bits */ | ||
| 40 | +#define TARGET_IGNBRK 0x00000001 | ||
| 41 | +#define TARGET_BRKINT 0x00000002 | ||
| 42 | +#define TARGET_IGNPAR 0x00000004 | ||
| 43 | +#define TARGET_PARMRK 0x00000008 | ||
| 44 | +#define TARGET_INPCK 0x00000010 | ||
| 45 | +#define TARGET_ISTRIP 0x00000020 | ||
| 46 | +#define TARGET_INLCR 0x00000040 | ||
| 47 | +#define TARGET_IGNCR 0x00000080 | ||
| 48 | +#define TARGET_ICRNL 0x00000100 | ||
| 49 | +#define TARGET_IUCLC 0x00000200 | ||
| 50 | +#define TARGET_IXON 0x00000400 | ||
| 51 | +#define TARGET_IXANY 0x00000800 | ||
| 52 | +#define TARGET_IXOFF 0x00001000 | ||
| 53 | +#define TARGET_IMAXBEL 0x00002000 | ||
| 54 | + | ||
| 55 | +/* c_oflag bits */ | ||
| 56 | +#define TARGET_OPOST 0x00000001 | ||
| 57 | +#define TARGET_OLCUC 0x00000002 | ||
| 58 | +#define TARGET_ONLCR 0x00000004 | ||
| 59 | +#define TARGET_OCRNL 0x00000008 | ||
| 60 | +#define TARGET_ONOCR 0x00000010 | ||
| 61 | +#define TARGET_ONLRET 0x00000020 | ||
| 62 | +#define TARGET_OFILL 0x00000040 | ||
| 63 | +#define TARGET_OFDEL 0x00000080 | ||
| 64 | +#define TARGET_NLDLY 0x00000100 | ||
| 65 | +#define TARGET_NL0 0x00000000 | ||
| 66 | +#define TARGET_NL1 0x00000100 | ||
| 67 | +#define TARGET_CRDLY 0x00000600 | ||
| 68 | +#define TARGET_CR0 0x00000000 | ||
| 69 | +#define TARGET_CR1 0x00000200 | ||
| 70 | +#define TARGET_CR2 0x00000400 | ||
| 71 | +#define TARGET_CR3 0x00000600 | ||
| 72 | +#define TARGET_TABDLY 0x00001800 | ||
| 73 | +#define TARGET_TAB0 0x00000000 | ||
| 74 | +#define TARGET_TAB1 0x00000800 | ||
| 75 | +#define TARGET_TAB2 0x00001000 | ||
| 76 | +#define TARGET_TAB3 0x00001800 | ||
| 77 | +#define TARGET_XTABS 0x00001800 | ||
| 78 | +#define TARGET_BSDLY 0x00002000 | ||
| 79 | +#define TARGET_BS0 0x00000000 | ||
| 80 | +#define TARGET_BS1 0x00002000 | ||
| 81 | +#define TARGET_VTDLY 0x00004000 | ||
| 82 | +#define TARGET_VT0 0x00000000 | ||
| 83 | +#define TARGET_VT1 0x00004000 | ||
| 84 | +#define TARGET_FFDLY 0x00008000 | ||
| 85 | +#define TARGET_FF0 0x00000000 | ||
| 86 | +#define TARGET_FF1 0x00008000 | ||
| 87 | +#define TARGET_PAGEOUT 0x00010000 /* SUNOS specific */ | ||
| 88 | +#define TARGET_WRAP 0x00020000 /* SUNOS specific */ | ||
| 89 | + | ||
| 90 | +/* c_cflag bit meaning */ | ||
| 91 | +#define TARGET_CBAUD 0x0000100f | ||
| 92 | +#define TARGET_B0 0x00000000 /* hang up */ | ||
| 93 | +#define TARGET_B50 0x00000001 | ||
| 94 | +#define TARGET_B75 0x00000002 | ||
| 95 | +#define TARGET_B110 0x00000003 | ||
| 96 | +#define TARGET_B134 0x00000004 | ||
| 97 | +#define TARGET_B150 0x00000005 | ||
| 98 | +#define TARGET_B200 0x00000006 | ||
| 99 | +#define TARGET_B300 0x00000007 | ||
| 100 | +#define TARGET_B600 0x00000008 | ||
| 101 | +#define TARGET_B1200 0x00000009 | ||
| 102 | +#define TARGET_B1800 0x0000000a | ||
| 103 | +#define TARGET_B2400 0x0000000b | ||
| 104 | +#define TARGET_B4800 0x0000000c | ||
| 105 | +#define TARGET_B9600 0x0000000d | ||
| 106 | +#define TARGET_B19200 0x0000000e | ||
| 107 | +#define TARGET_B38400 0x0000000f | ||
| 108 | +#define TARGET_EXTA B19200 | ||
| 109 | +#define TARGET_EXTB B38400 | ||
| 110 | +#define TARGET_CSIZE 0x00000030 | ||
| 111 | +#define TARGET_CS5 0x00000000 | ||
| 112 | +#define TARGET_CS6 0x00000010 | ||
| 113 | +#define TARGET_CS7 0x00000020 | ||
| 114 | +#define TARGET_CS8 0x00000030 | ||
| 115 | +#define TARGET_CSTOPB 0x00000040 | ||
| 116 | +#define TARGET_CREAD 0x00000080 | ||
| 117 | +#define TARGET_PARENB 0x00000100 | ||
| 118 | +#define TARGET_PARODD 0x00000200 | ||
| 119 | +#define TARGET_HUPCL 0x00000400 | ||
| 120 | +#define TARGET_CLOCAL 0x00000800 | ||
| 121 | +#define TARGET_CBAUDEX 0x00001000 | ||
| 122 | +/* We'll never see these speeds with the Zilogs, but for completeness... */ | ||
| 123 | +#define TARGET_B57600 0x00001001 | ||
| 124 | +#define TARGET_B115200 0x00001002 | ||
| 125 | +#define TARGET_B230400 0x00001003 | ||
| 126 | +#define TARGET_B460800 0x00001004 | ||
| 127 | +/* This is what we can do with the Zilogs. */ | ||
| 128 | +#define TARGET_B76800 0x00001005 | ||
| 129 | +/* This is what we can do with the SAB82532. */ | ||
| 130 | +#define TARGET_B153600 0x00001006 | ||
| 131 | +#define TARGET_B307200 0x00001007 | ||
| 132 | +#define TARGET_B614400 0x00001008 | ||
| 133 | +#define TARGET_B921600 0x00001009 | ||
| 134 | +/* And these are the rest... */ | ||
| 135 | +#define TARGET_B500000 0x0000100a | ||
| 136 | +#define TARGET_B576000 0x0000100b | ||
| 137 | +#define TARGET_B1000000 0x0000100c | ||
| 138 | +#define TARGET_B1152000 0x0000100d | ||
| 139 | +#define TARGET_B1500000 0x0000100e | ||
| 140 | +#define TARGET_B2000000 0x0000100f | ||
| 141 | +/* These have totally bogus values and nobody uses them | ||
| 142 | + so far. Later on we'd have to use say 0x10000x and | ||
| 143 | + adjust CBAUD constant and drivers accordingly. | ||
| 144 | +#define B2500000 0x00001010 | ||
| 145 | +#define B3000000 0x00001011 | ||
| 146 | +#define B3500000 0x00001012 | ||
| 147 | +#define B4000000 0x00001013 */ | ||
| 148 | +#define TARGET_CIBAUD 0x100f0000 /* input baud rate (not used) */ | ||
| 149 | +#define TARGET_CMSPAR 0x40000000 /* mark or space (stick) parity */ | ||
| 150 | +#define TARGET_CRTSCTS 0x80000000 /* flow control */ | ||
| 151 | + | ||
| 152 | +/* c_lflag bits */ | ||
| 153 | +#define TARGET_ISIG 0x00000001 | ||
| 154 | +#define TARGET_ICANON 0x00000002 | ||
| 155 | +#define TARGET_XCASE 0x00000004 | ||
| 156 | +#define TARGET_ECHO 0x00000008 | ||
| 157 | +#define TARGET_ECHOE 0x00000010 | ||
| 158 | +#define TARGET_ECHOK 0x00000020 | ||
| 159 | +#define TARGET_ECHONL 0x00000040 | ||
| 160 | +#define TARGET_NOFLSH 0x00000080 | ||
| 161 | +#define TARGET_TOSTOP 0x00000100 | ||
| 162 | +#define TARGET_ECHOCTL 0x00000200 | ||
| 163 | +#define TARGET_ECHOPRT 0x00000400 | ||
| 164 | +#define TARGET_ECHOKE 0x00000800 | ||
| 165 | +#define TARGET_DEFECHO 0x00001000 /* SUNOS thing, what is it? */ | ||
| 166 | +#define TARGET_FLUSHO 0x00002000 | ||
| 167 | +#define TARGET_PENDIN 0x00004000 | ||
| 168 | +#define TARGET_IEXTEN 0x00008000 | ||
| 169 | + | ||
| 170 | +/* ioctls */ | ||
| 171 | + | ||
| 172 | +/* Big T */ | ||
| 173 | +#define TARGET_TCGETA TARGET_IOR('T', 1, struct target_termio) | ||
| 174 | +#define TARGET_TCSETA TARGET_IOW('T', 2, struct target_termio) | ||
| 175 | +#define TARGET_TCSETAW TARGET_IOW('T', 3, struct target_termio) | ||
| 176 | +#define TARGET_TCSETAF TARGET_IOW('T', 4, struct target_termio) | ||
| 177 | +#define TARGET_TCSBRK TARGET_IO('T', 5) | ||
| 178 | +#define TARGET_TCXONC TARGET_IO('T', 6) | ||
| 179 | +#define TARGET_TCFLSH TARGET_IO('T', 7) | ||
| 180 | +#define TARGET_TCGETS TARGET_IOR('T', 8, struct target_termios) | ||
| 181 | +#define TARGET_TCSETS TARGET_IOW('T', 9, struct target_termios) | ||
| 182 | +#define TARGET_TCSETSW TARGET_IOW('T', 10, struct target_termios) | ||
| 183 | +#define TARGET_TCSETSF TARGET_IOW('T', 11, struct target_termios) | ||
| 184 | + | ||
| 185 | +/* Note that all the ioctls that are not available in Linux have a | ||
| 186 | + * double underscore on the front to: a) avoid some programs to | ||
| 187 | + * thing we support some ioctls under Linux (autoconfiguration stuff) | ||
| 188 | + */ | ||
| 189 | +/* Little t */ | ||
| 190 | +#define TARGET_TIOCGETD TARGET_IOR('t', 0, int) | ||
| 191 | +#define TARGET_TIOCSETD TARGET_IOW('t', 1, int) | ||
| 192 | +//#define __TIOCHPCL _IO('t', 2) /* SunOS Specific */ | ||
| 193 | +//#define __TIOCMODG _IOR('t', 3, int) /* SunOS Specific */ | ||
| 194 | +//#define __TIOCMODS _IOW('t', 4, int) /* SunOS Specific */ | ||
| 195 | +//#define __TIOCGETP _IOR('t', 8, struct sgttyb) /* SunOS Specific */ | ||
| 196 | +//#define __TIOCSETP _IOW('t', 9, struct sgttyb) /* SunOS Specific */ | ||
| 197 | +//#define __TIOCSETN _IOW('t', 10, struct sgttyb) /* SunOS Specific */ | ||
| 198 | +#define TARGET_TIOCEXCL TARGET_IO('t', 13) | ||
| 199 | +#define TARGET_TIOCNXCL TARGET_IO('t', 14) | ||
| 200 | +//#define __TIOCFLUSH _IOW('t', 16, int) /* SunOS Specific */ | ||
| 201 | +//#define __TIOCSETC _IOW('t', 17, struct tchars) /* SunOS Specific */ | ||
| 202 | +//#define __TIOCGETC _IOR('t', 18, struct tchars) /* SunOS Specific */ | ||
| 203 | +//#define __TIOCTCNTL _IOW('t', 32, int) /* SunOS Specific */ | ||
| 204 | +//#define __TIOCSIGNAL _IOW('t', 33, int) /* SunOS Specific */ | ||
| 205 | +//#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */ | ||
| 206 | +//#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */ | ||
| 207 | +#define TARGET_TIOCCONS TARGET_IO('t', 36) | ||
| 208 | +//#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */ | ||
| 209 | +//#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */ | ||
| 210 | +#define TARGET_TIOCGSOFTCAR TARGET_IOR('t', 100, int) | ||
| 211 | +#define TARGET_TIOCSSOFTCAR TARGET_IOW('t', 101, int) | ||
| 212 | +//#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */ | ||
| 213 | +#define TARGET_TIOCSWINSZ TARGET_IOW('t', 103, struct winsize) | ||
| 214 | +#define TARGET_TIOCGWINSZ TARGET_IOR('t', 104, struct winsize) | ||
| 215 | +//#define __TIOCREMOTE _IOW('t', 105, int) /* SunOS Specific */ | ||
| 216 | +#define TARGET_TIOCMGET TARGET_IOR('t', 106, int) | ||
| 217 | +#define TARGET_TIOCMBIC TARGET_IOW('t', 107, int) | ||
| 218 | +#define TARGET_TIOCMBIS TARGET_IOW('t', 108, int) | ||
| 219 | +#define TARGET_TIOCMSET TARGET_IOW('t', 109, int) | ||
| 220 | +#define TARGET_TIOCSTART TARGET_IO('t', 110) | ||
| 221 | +#define TARGET_TIOCSTOP TARGET_IO('t', 111) | ||
| 222 | +#define TARGET_TIOCPKT TARGET_IOW('t', 112, int) | ||
| 223 | +#define TARGET_TIOCNOTTY TARGET_IO('t', 113) | ||
| 224 | +#define TARGET_TIOCSTI TARGET_IOW('t', 114, char) | ||
| 225 | +#define TARGET_TIOCOUTQ TARGET_IOR('t', 115, int) | ||
| 226 | +//#define __TIOCGLTC _IOR('t', 116, struct ltchars) /* SunOS Specific */ | ||
| 227 | +//#define __TIOCSLTC _IOW('t', 117, struct ltchars) /* SunOS Specific */ | ||
| 228 | +/* 118 is the non-posix setpgrp tty ioctl */ | ||
| 229 | +/* 119 is the non-posix getpgrp tty ioctl */ | ||
| 230 | +//#define __TIOCCDTR TARGET_IO('t', 120) /* SunOS Specific */ | ||
| 231 | +//#define __TIOCSDTR TARGET_IO('t', 121) /* SunOS Specific */ | ||
| 232 | +#define TARGET_TIOCCBRK TARGET_IO('t', 122) | ||
| 233 | +#define TARGET_TIOCSBRK TARGET_IO('t', 123) | ||
| 234 | +//#define __TIOCLGET TARGET_IOW('t', 124, int) /* SunOS Specific */ | ||
| 235 | +//#define __TIOCLSET TARGET_IOW('t', 125, int) /* SunOS Specific */ | ||
| 236 | +//#define __TIOCLBIC TARGET_IOW('t', 126, int) /* SunOS Specific */ | ||
| 237 | +//#define __TIOCLBIS TARGET_IOW('t', 127, int) /* SunOS Specific */ | ||
| 238 | +//#define __TIOCISPACE TARGET_IOR('t', 128, int) /* SunOS Specific */ | ||
| 239 | +//#define __TIOCISIZE TARGET_IOR('t', 129, int) /* SunOS Specific */ | ||
| 240 | +#define TARGET_TIOCSPGRP TARGET_IOW('t', 130, int) | ||
| 241 | +#define TARGET_TIOCGPGRP TARGET_IOR('t', 131, int) | ||
| 242 | +#define TARGET_TIOCSCTTY TARGET_IO('t', 132) | ||
| 243 | +#define TARGET_TIOCGSID TARGET_IOR('t', 133, int) | ||
| 244 | +/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */ | ||
| 245 | +#define TARGET_TIOCGPTN TARGET_IOR('t', 134, unsigned int) /* Get Pty Number */ | ||
| 246 | +#define TARGET_TIOCSPTLCK TARGET_IOW('t', 135, int) /* Lock/unlock PTY */ | ||
| 247 | + | ||
| 248 | +/* Little f */ | ||
| 249 | +#define TARGET_FIOCLEX TARGET_IO('f', 1) | ||
| 250 | +#define TARGET_FIONCLEX TARGET_IO('f', 2) | ||
| 251 | +#define TARGET_FIOASYNC TARGET_IOW('f', 125, int) | ||
| 252 | +#define TARGET_FIONBIO TARGET_IOW('f', 126, int) | ||
| 253 | +#define TARGET_FIONREAD TARGET_IOR('f', 127, int) | ||
| 254 | +#define TARGET_TIOCINQ TARGET_FIONREAD | ||
| 255 | + | ||
| 256 | +/* SCARY Rutgers local SunOS kernel hackery, perhaps I will support it | ||
| 257 | + * someday. This is completely bogus, I know... | ||
| 258 | + */ | ||
| 259 | +//#define __TCGETSTAT TARGET_IO('T', 200) /* Rutgers specific */ | ||
| 260 | +//#define __TCSETSTAT TARGET_IO('T', 201) /* Rutgers specific */ | ||
| 261 | + | ||
| 262 | +/* Linux specific, no SunOS equivalent. */ | ||
| 263 | +#define TARGET_TIOCLINUX 0x541C | ||
| 264 | +#define TARGET_TIOCGSERIAL 0x541E | ||
| 265 | +#define TARGET_TIOCSSERIAL 0x541F | ||
| 266 | +#define TARGET_TCSBRKP 0x5425 | ||
| 267 | +#define TARGET_TIOCTTYGSTRUCT 0x5426 | ||
| 268 | +#define TARGET_TIOCSERCONFIG 0x5453 | ||
| 269 | +#define TARGET_TIOCSERGWILD 0x5454 | ||
| 270 | +#define TARGET_TIOCSERSWILD 0x5455 | ||
| 271 | +#define TARGET_TIOCGLCKTRMIOS 0x5456 | ||
| 272 | +#define TARGET_TIOCSLCKTRMIOS 0x5457 | ||
| 273 | +#define TARGET_TIOCSERGSTRUCT 0x5458 /* For debugging only */ | ||
| 274 | +#define TARGET_TIOCSERGETLSR 0x5459 /* Get line status register */ | ||
| 275 | +#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config */ | ||
| 276 | +#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */ | ||
| 277 | +#define TARGET_TIOCMIWAIT 0x545C /* Wait input */ | ||
| 278 | +#define TARGET_TIOCGICOUNT 0x545D /* Read serial port inline interrupt counts */ | ||
| 279 | + |
linux-user/syscall.c
| @@ -1674,6 +1674,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -1674,6 +1674,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 1674 | case TARGET_NR_chdir: | 1674 | case TARGET_NR_chdir: |
| 1675 | ret = get_errno(chdir((const char *)arg1)); | 1675 | ret = get_errno(chdir((const char *)arg1)); |
| 1676 | break; | 1676 | break; |
| 1677 | +#ifdef TARGET_NR_time | ||
| 1677 | case TARGET_NR_time: | 1678 | case TARGET_NR_time: |
| 1678 | { | 1679 | { |
| 1679 | int *time_ptr = (int *)arg1; | 1680 | int *time_ptr = (int *)arg1; |
| @@ -1682,6 +1683,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -1682,6 +1683,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 1682 | tswap32s(time_ptr); | 1683 | tswap32s(time_ptr); |
| 1683 | } | 1684 | } |
| 1684 | break; | 1685 | break; |
| 1686 | +#endif | ||
| 1685 | case TARGET_NR_mknod: | 1687 | case TARGET_NR_mknod: |
| 1686 | ret = get_errno(mknod((const char *)arg1, arg2, arg3)); | 1688 | ret = get_errno(mknod((const char *)arg1, arg2, arg3)); |
| 1687 | break; | 1689 | break; |
| @@ -2168,6 +2170,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2168,6 +2170,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2168 | arg6)); | 2170 | arg6)); |
| 2169 | #endif | 2171 | #endif |
| 2170 | break; | 2172 | break; |
| 2173 | +#ifdef TARGET_NR_mmap2 | ||
| 2171 | case TARGET_NR_mmap2: | 2174 | case TARGET_NR_mmap2: |
| 2172 | #if defined(TARGET_SPARC) | 2175 | #if defined(TARGET_SPARC) |
| 2173 | #define MMAP_SHIFT 12 | 2176 | #define MMAP_SHIFT 12 |
| @@ -2179,6 +2182,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2179,6 +2182,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2179 | arg5, | 2182 | arg5, |
| 2180 | arg6 << MMAP_SHIFT)); | 2183 | arg6 << MMAP_SHIFT)); |
| 2181 | break; | 2184 | break; |
| 2185 | +#endif | ||
| 2182 | case TARGET_NR_munmap: | 2186 | case TARGET_NR_munmap: |
| 2183 | ret = get_errno(target_munmap(arg1, arg2)); | 2187 | ret = get_errno(target_munmap(arg1, arg2)); |
| 2184 | break; | 2188 | break; |
| @@ -2471,7 +2475,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2471,7 +2475,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2471 | break; | 2475 | break; |
| 2472 | case TARGET_NR_getdents: | 2476 | case TARGET_NR_getdents: |
| 2473 | #if TARGET_LONG_SIZE != 4 | 2477 | #if TARGET_LONG_SIZE != 4 |
| 2474 | -#error not supported | 2478 | +#warning not supported |
| 2475 | #elif TARGET_LONG_SIZE == 4 && HOST_LONG_SIZE == 8 | 2479 | #elif TARGET_LONG_SIZE == 4 && HOST_LONG_SIZE == 8 |
| 2476 | { | 2480 | { |
| 2477 | struct target_dirent *target_dirp = (void *)arg2; | 2481 | struct target_dirent *target_dirp = (void *)arg2; |
| @@ -2746,16 +2750,25 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2746,16 +2750,25 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2746 | break; | 2750 | break; |
| 2747 | } | 2751 | } |
| 2748 | #endif | 2752 | #endif |
| 2753 | +#ifdef TARGET_NR_truncate64 | ||
| 2749 | case TARGET_NR_truncate64: | 2754 | case TARGET_NR_truncate64: |
| 2750 | goto unimplemented; | 2755 | goto unimplemented; |
| 2756 | +#endif | ||
| 2757 | +#ifdef TARGET_NR_ftruncate64 | ||
| 2751 | case TARGET_NR_ftruncate64: | 2758 | case TARGET_NR_ftruncate64: |
| 2752 | goto unimplemented; | 2759 | goto unimplemented; |
| 2760 | +#endif | ||
| 2761 | +#ifdef TARGET_NR_stat64 | ||
| 2753 | case TARGET_NR_stat64: | 2762 | case TARGET_NR_stat64: |
| 2754 | ret = get_errno(stat(path((const char *)arg1), &st)); | 2763 | ret = get_errno(stat(path((const char *)arg1), &st)); |
| 2755 | goto do_stat64; | 2764 | goto do_stat64; |
| 2765 | +#endif | ||
| 2766 | +#ifdef TARGET_NR_lstat64 | ||
| 2756 | case TARGET_NR_lstat64: | 2767 | case TARGET_NR_lstat64: |
| 2757 | ret = get_errno(lstat(path((const char *)arg1), &st)); | 2768 | ret = get_errno(lstat(path((const char *)arg1), &st)); |
| 2758 | goto do_stat64; | 2769 | goto do_stat64; |
| 2770 | +#endif | ||
| 2771 | +#ifdef TARGET_NR_fstat64 | ||
| 2759 | case TARGET_NR_fstat64: | 2772 | case TARGET_NR_fstat64: |
| 2760 | { | 2773 | { |
| 2761 | ret = get_errno(fstat(arg1, &st)); | 2774 | ret = get_errno(fstat(arg1, &st)); |
| @@ -2783,7 +2796,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2783,7 +2796,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2783 | } | 2796 | } |
| 2784 | } | 2797 | } |
| 2785 | break; | 2798 | break; |
| 2786 | - | 2799 | +#endif |
| 2787 | #ifdef USE_UID16 | 2800 | #ifdef USE_UID16 |
| 2788 | case TARGET_NR_lchown: | 2801 | case TARGET_NR_lchown: |
| 2789 | ret = get_errno(lchown((const char *)arg1, low2highuid(arg2), low2highgid(arg3))); | 2802 | ret = get_errno(lchown((const char *)arg1, low2highuid(arg2), low2highgid(arg3))); |
| @@ -2894,37 +2907,60 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2894,37 +2907,60 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2894 | break; | 2907 | break; |
| 2895 | #endif /* USE_UID16 */ | 2908 | #endif /* USE_UID16 */ |
| 2896 | 2909 | ||
| 2910 | +#ifdef TARGET_NR_lchown32 | ||
| 2897 | case TARGET_NR_lchown32: | 2911 | case TARGET_NR_lchown32: |
| 2898 | ret = get_errno(lchown((const char *)arg1, arg2, arg3)); | 2912 | ret = get_errno(lchown((const char *)arg1, arg2, arg3)); |
| 2899 | break; | 2913 | break; |
| 2914 | +#endif | ||
| 2915 | +#ifdef TARGET_NR_getuid32 | ||
| 2900 | case TARGET_NR_getuid32: | 2916 | case TARGET_NR_getuid32: |
| 2901 | ret = get_errno(getuid()); | 2917 | ret = get_errno(getuid()); |
| 2902 | break; | 2918 | break; |
| 2919 | +#endif | ||
| 2920 | +#ifdef TARGET_NR_getgid32 | ||
| 2903 | case TARGET_NR_getgid32: | 2921 | case TARGET_NR_getgid32: |
| 2904 | ret = get_errno(getgid()); | 2922 | ret = get_errno(getgid()); |
| 2905 | break; | 2923 | break; |
| 2924 | +#endif | ||
| 2925 | +#ifdef TARGET_NR_geteuid32 | ||
| 2906 | case TARGET_NR_geteuid32: | 2926 | case TARGET_NR_geteuid32: |
| 2907 | ret = get_errno(geteuid()); | 2927 | ret = get_errno(geteuid()); |
| 2908 | break; | 2928 | break; |
| 2929 | +#endif | ||
| 2930 | +#ifdef TARGET_NR_getegid32 | ||
| 2909 | case TARGET_NR_getegid32: | 2931 | case TARGET_NR_getegid32: |
| 2910 | ret = get_errno(getegid()); | 2932 | ret = get_errno(getegid()); |
| 2911 | break; | 2933 | break; |
| 2934 | +#endif | ||
| 2935 | +#ifdef TARGET_NR_setreuid32 | ||
| 2912 | case TARGET_NR_setreuid32: | 2936 | case TARGET_NR_setreuid32: |
| 2913 | ret = get_errno(setreuid(arg1, arg2)); | 2937 | ret = get_errno(setreuid(arg1, arg2)); |
| 2914 | break; | 2938 | break; |
| 2939 | +#endif | ||
| 2940 | +#ifdef TARGET_NR_setregid32 | ||
| 2915 | case TARGET_NR_setregid32: | 2941 | case TARGET_NR_setregid32: |
| 2916 | ret = get_errno(setregid(arg1, arg2)); | 2942 | ret = get_errno(setregid(arg1, arg2)); |
| 2917 | break; | 2943 | break; |
| 2944 | +#endif | ||
| 2945 | +#ifdef TARGET_NR_getgroups32 | ||
| 2918 | case TARGET_NR_getgroups32: | 2946 | case TARGET_NR_getgroups32: |
| 2919 | goto unimplemented; | 2947 | goto unimplemented; |
| 2948 | +#endif | ||
| 2949 | +#ifdef TARGET_NR_setgroups32 | ||
| 2920 | case TARGET_NR_setgroups32: | 2950 | case TARGET_NR_setgroups32: |
| 2921 | goto unimplemented; | 2951 | goto unimplemented; |
| 2952 | +#endif | ||
| 2953 | +#ifdef TARGET_NR_fchown32 | ||
| 2922 | case TARGET_NR_fchown32: | 2954 | case TARGET_NR_fchown32: |
| 2923 | ret = get_errno(fchown(arg1, arg2, arg3)); | 2955 | ret = get_errno(fchown(arg1, arg2, arg3)); |
| 2924 | break; | 2956 | break; |
| 2957 | +#endif | ||
| 2958 | +#ifdef TARGET_NR_setresuid32 | ||
| 2925 | case TARGET_NR_setresuid32: | 2959 | case TARGET_NR_setresuid32: |
| 2926 | ret = get_errno(setresuid(arg1, arg2, arg3)); | 2960 | ret = get_errno(setresuid(arg1, arg2, arg3)); |
| 2927 | break; | 2961 | break; |
| 2962 | +#endif | ||
| 2963 | +#ifdef TARGET_NR_getresuid32 | ||
| 2928 | case TARGET_NR_getresuid32: | 2964 | case TARGET_NR_getresuid32: |
| 2929 | { | 2965 | { |
| 2930 | int ruid, euid, suid; | 2966 | int ruid, euid, suid; |
| @@ -2936,9 +2972,13 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2936,9 +2972,13 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2936 | } | 2972 | } |
| 2937 | } | 2973 | } |
| 2938 | break; | 2974 | break; |
| 2975 | +#endif | ||
| 2976 | +#ifdef TARGET_NR_setresgid32 | ||
| 2939 | case TARGET_NR_setresgid32: | 2977 | case TARGET_NR_setresgid32: |
| 2940 | ret = get_errno(setresgid(arg1, arg2, arg3)); | 2978 | ret = get_errno(setresgid(arg1, arg2, arg3)); |
| 2941 | break; | 2979 | break; |
| 2980 | +#endif | ||
| 2981 | +#ifdef TARGET_NR_getresgid32 | ||
| 2942 | case TARGET_NR_getresgid32: | 2982 | case TARGET_NR_getresgid32: |
| 2943 | { | 2983 | { |
| 2944 | int rgid, egid, sgid; | 2984 | int rgid, egid, sgid; |
| @@ -2950,21 +2990,32 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2950,21 +2990,32 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2950 | } | 2990 | } |
| 2951 | } | 2991 | } |
| 2952 | break; | 2992 | break; |
| 2993 | +#endif | ||
| 2994 | +#ifdef TARGET_NR_chown32 | ||
| 2953 | case TARGET_NR_chown32: | 2995 | case TARGET_NR_chown32: |
| 2954 | ret = get_errno(chown((const char *)arg1, arg2, arg3)); | 2996 | ret = get_errno(chown((const char *)arg1, arg2, arg3)); |
| 2955 | break; | 2997 | break; |
| 2998 | +#endif | ||
| 2999 | +#ifdef TARGET_NR_setuid32 | ||
| 2956 | case TARGET_NR_setuid32: | 3000 | case TARGET_NR_setuid32: |
| 2957 | ret = get_errno(setuid(arg1)); | 3001 | ret = get_errno(setuid(arg1)); |
| 2958 | break; | 3002 | break; |
| 3003 | +#endif | ||
| 3004 | +#ifdef TARGET_NR_setgid32 | ||
| 2959 | case TARGET_NR_setgid32: | 3005 | case TARGET_NR_setgid32: |
| 2960 | ret = get_errno(setgid(arg1)); | 3006 | ret = get_errno(setgid(arg1)); |
| 2961 | break; | 3007 | break; |
| 3008 | +#endif | ||
| 3009 | +#ifdef TARGET_NR_setfsuid32 | ||
| 2962 | case TARGET_NR_setfsuid32: | 3010 | case TARGET_NR_setfsuid32: |
| 2963 | ret = get_errno(setfsuid(arg1)); | 3011 | ret = get_errno(setfsuid(arg1)); |
| 2964 | break; | 3012 | break; |
| 3013 | +#endif | ||
| 3014 | +#ifdef TARGET_NR_setfsgid32 | ||
| 2965 | case TARGET_NR_setfsgid32: | 3015 | case TARGET_NR_setfsgid32: |
| 2966 | ret = get_errno(setfsgid(arg1)); | 3016 | ret = get_errno(setfsgid(arg1)); |
| 2967 | break; | 3017 | break; |
| 3018 | +#endif | ||
| 2968 | 3019 | ||
| 2969 | case TARGET_NR_pivot_root: | 3020 | case TARGET_NR_pivot_root: |
| 2970 | goto unimplemented; | 3021 | goto unimplemented; |