Add sparc patches from Jakub Jelinek

This commit is contained in:
Wichert Akkerman 1999-06-03 14:21:07 +00:00
parent 8783c011ea
commit dacfb6ebd6
15 changed files with 126 additions and 43 deletions

View File

@ -33,4 +33,4 @@ porting to new systems:
David Mosberger-Tang <davidm@AZStarNet.com>
Ulrich Drepper <drepper@cygnus.com>
Nate Eldredge <nate@cartsys.com>
Jakub Jelinek <jj@ultra.linux.cz>

View File

@ -1,3 +1,17 @@
Wed Jun 2 18:30:12 CEST 1999 Jakub Jelinek <jj@ultra.linux.cz>
* system.c: sys_umount2 syscall support.
* linux/sparc/errnoent.h: Update sparc-linux errnos.
* linux/sparc/syscall.h: Update used sparc-linux syscalls.
* linux/sparc/syscallent.h: Match 2.2.9 system calls.
* file.c: sparc-linux asm/stat.h uses dev_t etc. types,
so it needs strace's own copy of the stat structure.
* util.c: Make it compile on sparc-linux.
* strace.c: Fix strace -f and -ff operation on sparc-linux.
* signal.c: rt_sigaction has different arguments on sparc*-linux
and alpha-linux.
* syscall.c: Recognize sparc64-linux binaries.
Fri May 28 21:09:00 PST Ulrich Drepper <drepper@cygnus.com>
* configure.in: Fix typo (CFLAG -> CFLAGS).

27
file.c
View File

@ -42,7 +42,32 @@
#endif
#ifdef linux
# include <asm/stat.h>
# ifdef LINUXSPARC
struct stat {
unsigned short st_dev;
unsigned int st_ino;
unsigned short st_mode;
short st_nlink;
unsigned short st_uid;
unsigned short st_gid;
unsigned short st_rdev;
unsigned int st_size;
int st_atime;
unsigned int __unused1;
int st_mtime;
unsigned int __unused2;
int st_ctime;
unsigned int __unused3;
int st_blksize;
int st_blocks;
unsigned int __unused4[2];
};
# define stat kernel_stat
# include <asm/stat.h>
# undef stat
# else
# include <asm/stat.h>
# endif
# define stat libc_stat
# include <sys/stat.h>
# undef stat

View File

@ -50,7 +50,7 @@
{ 3, TF, sys_lseek, "lseek" }, /* 19 */
{ 0, 0, sys_getpid, "getxpid" }, /* 20 */
{ 4, 0, printargs, "osf_mount" }, /* 21 */
{ 2, 0, sys_umount, "umount" }, /* 22 */
{ 2, 0, sys_umount2, "umount" }, /* 22 */
{ 1, 0, sys_setuid, "setuid" }, /* 23 */
{ 0, 0, sys_getuid, "getxuid" }, /* 24 */
{ 5, 0, printargs, "SYS_25" }, /* 25 */
@ -349,7 +349,7 @@
{ 1, 0, sys_sysinfo, "sysinfo" }, /* 318 */
{ 1, 0, sys_sysctl, "sysctl" }, /* 319 */
{ 0, 0, sys_idle, "idle" }, /* 320 */
{ 1, 0, printargs, "oldumount" }, /* 321 */
{ 1, 0, sys_umount, "oldumount" }, /* 321 */
{ 1, 0, sys_swapon, "swapon" }, /* 322 */
{ 1, 0, sys_times, "times" }, /* 323 */
{ 1, 0, sys_personality, "personality" }, /* 324 */

View File

@ -50,7 +50,7 @@
{ 3, TF, sys_lseek, "lseek" }, /* 19 */
{ 0, 0, sys_getpid, "getpid" }, /* 20 */
{ 5, TF, sys_mount, "mount" }, /* 21 */
{ 1, 0, sys_umount, "umount" }, /* 22 */
{ 1, 0, sys_umount, "oldumount" }, /* 22 */
{ 1, 0, sys_setuid, "setuid" }, /* 23 */
{ 0, 0, sys_getuid, "getuid" }, /* 24 */
{ 1, 0, sys_stime, "stime" }, /* 25 */
@ -80,7 +80,7 @@
{ 0, 0, printargs, "geteuid" }, /* 49 */
{ 0, 0, printargs, "getegid" }, /* 50 */
{ 1, TF, sys_acct, "acct" }, /* 51 */
{ 2, 0, printargs, "umount2" }, /* 52 */
{ 2, 0, sys_umount2, "umount" }, /* 52 */
{ 5, 0, printargs, "lock" }, /* 53 */
{ 3, 0, sys_ioctl, "ioctl" }, /* 54 */
{ 3, 0, sys_fcntl, "fcntl" }, /* 55 */

View File

@ -123,3 +123,5 @@
"EILSEQ", /* 122 */
"ELIBMAX", /* 123 */
"ELIBSCN", /* 124 */
"ENOMEDIUM", /* 125 */
"EMEDIUMTYPE", /* 126 */

View File

@ -44,7 +44,7 @@ int sys_uname(), sys_sysinfo();
/* 1.2 memory management */
int sys_brk(),sys_sbrk(),sys_sstk();
int sys_getpagesize(),sys_mmap(),sys_mctl(),sys_munmap(),sys_mprotect(),sys_mincore();
int sys_getpagesize(),sys_mmap(),sys_mctl(),sys_munmap(),sys_mprotect(),sys_mincore(), sys_mremap();
int sys_omsync(),sys_omadvise();
/* 1.3 signals */
@ -58,7 +58,7 @@ int sys_getitimer(),sys_setitimer();
/* 1.5 descriptors */
int sys_getdtablesize(),sys_dup(),sys_dup2(),sys_close();
int sys_select(),sys_getdopt(),sys_setdopt(),sys_fcntl(),sys_flock();
int sys_oldselect(),sys_select(),sys_getdopt(),sys_setdopt(),sys_fcntl(),sys_flock();
/* 1.6 resource controls */
int sys_getpriority(),sys_setpriority(),sys_getrusage(),sys_getrlimit(),sys_setrlimit();
@ -84,7 +84,7 @@ int sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents(),sys_readdir();
int sys_creat(),sys_open(),sys_mknod(),sys_unlink(),sys_stat(),sys_fstat(),sys_lstat();
int sys_chown(),sys_fchown(),sys_chmod(),sys_fchmod(),sys_utimes();
int sys_link(),sys_symlink(),sys_readlink(),sys_rename();
int sys_lseek(),sys_truncate(),sys_ftruncate(),sys_access(),sys_fsync();
int sys_lseek(),sys_truncate(),sys_ftruncate(),sys_access(),sys_fsync(),sys_sysctl();
int sys_statfs(),sys_fstatfs(),sys_msync();
/* 2.3 communications */
@ -93,6 +93,13 @@ int sys_socketpair(),sys_sendto(),sys_send(),sys_recvfrom(),sys_recv();
int sys_sendmsg(),sys_recvmsg(),sys_shutdown(),sys_setsockopt(),sys_getsockopt();
int sys_getsockname(),sys_getpeername(),sys_pipe();
int sys_setresuid(), sys_setresgid(), sys_getresuid(), sys_getresgid(), sys_pread();
int sys_pwrite(), sys_getcwd();
int sys_sigaltstack(), sys_rt_sigprocmask(), sys_rt_sigaction();
int sys_rt_sigpending(), sys_rt_sigsuspend(), sys_rt_sigqueueinfo();
int sys_rt_sigtimedwait(), sys_prctl(), sys_poll();
int sys_sendfile(), sys_query_module(), sys_capget(), sys_capset();
int sys_umask(); /* XXX */
/* 2.3.1 SystemV-compatible IPC */
@ -150,6 +157,7 @@ int sys_ustat(); /* System V compatibility */
int sys_owait(); /* should use wait4 interface */
int sys_owait3(); /* should use wait4 interface */
int sys_umount(); /* still more Sys V (and 4.2?) compatibility */
int sys_umount2();
int sys_pathconf(); /* posix */
int sys_fpathconf(); /* posix */
int sys_sysconf(); /* posix */

View File

@ -11,22 +11,22 @@
{ 1, TF, sys_unlink, "unlink" }, /* 10 */
{ 2, TF|TP, sys_execv, "execv" }, /* 11 */
{ 1, TF, sys_chdir, "chdir" }, /* 12 */
{ 0, 0, printargs, "sunos-time!"}, /* 13 */
{ 3, TF, sys_chown, "chown"}, /* 13 */
{ 3, TF, sys_mknod, "mknod" }, /* 14 */
{ 2, TF, sys_chmod, "chmod" }, /* 15 */
{ 3, TF, sys_chown, "chown" }, /* 16 */
{ 3, TF, sys_chown, "lchown" }, /* 16 */
{ 1, 0, sys_brk, "brk" }, /* 17 */
{ 2, 0, printargs, "SYS_18" }, /* 18 */
{ 2, 0, printargs, "perfctr" }, /* 18 */
{ 3, 0, sys_lseek, "lseek" }, /* 19 */
{ 0, 0, sys_getpid, "getpid" }, /* 20 */
{ 0, 0, printargs, "SYS_21" }, /* 21 */
{ 1, TF, printargs, "SYS_22" }, /* 22 */
{ 2, 0, sys_capget, "capget" }, /* 21 */
{ 2, 0, sys_capset, "capset" }, /* 22 */
{ 1, 0, sys_setuid, "setuid" }, /* 23 */
{ 0, 0, sys_getuid, "getuid" }, /* 24 */
{ 1, 0, printargs, "SYS_25" }, /* 25 */
{ 1, 0, sys_time, "time" }, /* 25 */
{ 5, 0, sys_ptrace, "ptrace" }, /* 26 */
{ 1, 0, sys_alarm, "alarm" }, /* 27 */
{ 2, 0, printargs, "SYS_28" }, /* 28 */
{ 2, TS, sys_sigaltstack,"sigaltstack" }, /* 28 */
{ 0, TS, sys_pause, "pause" }, /* 29 */
{ 2, TF, sys_utime, "utime" }, /* 30 */
{ 2, 0, sys_stty, "stty" }, /* 31 */
@ -37,13 +37,13 @@
{ 0, 0, sys_sync, "sync" }, /* 36 */
{ 2, TS, sys_kill, "kill" }, /* 37 */
{ 2, TF, sys_stat, "stat" }, /* 38 */
{ 2, 0, printargs, "SYS_39" }, /* 39 */
{ 4, TF, sys_sendfile, "sendfile" }, /* 39 */
{ 2, TF, sys_lstat, "lstat" }, /* 40 */
{ 2, 0, sys_dup, "dup" }, /* 41 */
{ 0, 0, sys_pipe, "pipe" }, /* 42 */
{ 1, 0, sys_times, "times" }, /* 43 */
{ 4, 0, sys_profil, "profil" }, /* 44 */
{ 0, 0, printargs, "SYS_45" }, /* 45 */
{ 2, TF, sys_umount2, "umount" }, /* 45 */
{ 1, 0, sys_setgid, "setgid" }, /* 46 */
{ 0, 0, sys_getgid, "getgid" }, /* 47 */
{ 2, 0, sys_signal, "signal" }, /* 48 */
@ -64,10 +64,10 @@
{ 0, 0, printargs, "SYS_63" }, /* 63 */
{ 1, 0, sys_getpagesize,"getpagesize" }, /* 64 */
{ 3, 0, sys_msync, "msync" }, /* 65 */
{ 0, TP, printargs, "SYS_66" }, /* 66 */
{ 0, 0, printargs, "SYS_67" }, /* 67 */
{ 0, 0, printargs, "SYS_68" }, /* 68 */
{ 1, 0, sys_sbrk, "sbrk" }, /* 69 */
{ 0, TP, sys_vfork, "vfork" }, /* 66 */
{ 5, TF, sys_pread, "pread" }, /* 67 */
{ 5, TF, sys_pwrite, "pwrite" }, /* 68 */
{ 1, 0, sys_sbrk, "sbrk" }, /* 69 */
{ 1, 0, printargs, "sstk" }, /* 70 */
{ 6, 0, sys_mmap, "mmap" }, /* 71 */
{ 1, 0, printargs, "vadvise" }, /* 72 */
@ -91,7 +91,7 @@
{ 2, 0, sys_dup2, "dup2" }, /* 90 */
{ 2, 0, printargs, "getdopt" }, /* 91 */
{ 3, 0, sys_fcntl, "fcntl" }, /* 92 */
{ 5, 0, sys_select, "select" }, /* 93 */
{ 5, 0, sys_oldselect, "select" }, /* 93 */
{ 2, 0, printargs, "setdopt" }, /* 94 */
{ 1, 0, sys_fsync, "fsync" }, /* 95 */
{ 3, 0, sys_setpriority,"setpriority" }, /* 96 */
@ -99,13 +99,13 @@
{ 3, TN, sys_connect, "connect" }, /* 98 */
{ 3, TN, sys_accept, "accept" }, /* 99 */
{ 2, 0, sys_getpriority,"getpriority" }, /* 100 */
{ 4, TN, sys_send, "send" }, /* 101 */
{ 4, TN, sys_recv, "recv" }, /* 102 */
{ 0, 0, printargs, "SYS_103" }, /* 103 */
{ 3, TN, sys_bind, "bind" }, /* 104 */
{ 5, TN, sys_setsockopt, "setsockopt" }, /* 105 */
{ 2, TN, sys_listen, "listen" }, /* 106 */
{ 2, 0, printargs, "SYS_107" }, /* 107 */
{ 0, TS, printargs, "rt_sigreturn" }, /* 101 */
{ 5, TS, sys_rt_sigaction,"rt_sigaction" }, /* 102 */
{ 4, TS, sys_rt_sigprocmask,"rt_sigprocmask" }, /* 103 */
{ 2, TS, sys_rt_sigpending,"rt_sigpending" }, /* 104 */
{ 4, TS, sys_rt_sigtimedwait,"rt_sigtimedwait" },/* 105 */
{ 3, TS, sys_rt_sigqueueinfo,"rt_sigqueueinfo" },/* 106 */
{ 2, TS, sys_rt_sigsuspend,"rt_sigsuspend" }, /* 107 */
{ 3, TS, printargs, "sigvec" }, /* 108 */
{ 1, TS, sys_sigblock, "sigblock" }, /* 109 */
{ 1, TS, sys_sigsetmask, "sigsetmask" }, /* 110 */
@ -117,7 +117,7 @@
{ 2, 0, sys_gettimeofday,"gettimeofday" }, /* 116 */
{ 2, 0, sys_getrusage, "getrusage" }, /* 117 */
{ 5, TN, sys_getsockopt, "getsockopt" }, /* 118 */
{ 0, 0, printargs, "SYS_119" }, /* 119 */
{ 2, 0, sys_getcwd, "getcwd" }, /* 119 */
{ 3, 0, sys_readv, "readv" }, /* 120 */
{ 3, 0, sys_writev, "writev" }, /* 121 */
{ 2, 0, sys_settimeofday,"settimeofday" }, /* 122 */
@ -145,19 +145,19 @@
{ 2, 0, sys_getrlimit, "getrlimit" }, /* 144 */
{ 2, 0, sys_setrlimit, "setrlimit" }, /* 145 */
{ 2, TS, sys_killpg, "killpg" }, /* 146 */
{ 0, 0, printargs, "SYS_147" }, /* 147 */
{ 0, 0, printargs, "SYS_148" }, /* 148 */
{ 0, 0, printargs, "SYS_149" }, /* 149 */
{ 5, 0, printargs, "prctl" }, /* 147 */
{ 5, 0, printargs, "pciconfig_read" }, /* 148 */
{ 5, 0, printargs, "pciconfig_write" }, /* 149 */
{ 3, TN, sys_getsockname,"getsockname" }, /* 150 */
{ 4, TN, sys_getmsg, "getmsg" }, /* 151 */
{ 4, TN, sys_putmsg, "putmsg" }, /* 152 */
{ 4, TN, printargs, "poll" }, /* 153 */
{ 3, 0, sys_poll, "poll" }, /* 153 */
{ 0, 0, printargs, "SYS_154" }, /* 154 */
{ 1, 0, printargs, "nfssvc" }, /* 155 */
{ 4, 0, printargs, "getdirentries" }, /* 156 */
{ 2, TF, sys_statfs, "statfs" }, /* 157 */
{ 2, 0, sys_fstatfs, "fstatfs" }, /* 158 */
{ 1, TF, sys_umount, "umount" }, /* 159 */
{ 1, TF, sys_umount, "oldumount" }, /* 159 */
{ 0, 0, printargs, "async_daemon" }, /* 160 */
{ 2, 0, printargs, "getfh" }, /* 161 */
{ 2, 0, printargs, "getdomainname" }, /* 162 */
@ -182,7 +182,7 @@
{ 1, 0, printargs, "aiowait" }, /* 181 */
{ 1, 0, printargs, "aiocancel" }, /* 182 */
{ 1, TS, sys_sigpending, "sigpending" }, /* 183 */
{ 0, 0, printargs, "SYS_184" }, /* 184 */
{ 5, 0, sys_query_module,"query_module" }, /* 184 */
{ 2, 0, sys_setpgid, "setpgid" }, /* 185 */
{ 2, TF, printargs, "pathconf" }, /* 186 */
{ 2, 0, printargs, "fpathconf" }, /* 187 */
@ -231,7 +231,7 @@
{ 5, 0, sys_afs_syscall,"afs_syscall" }, /* 227 */
{ 1, 0, sys_setfsuid, "setfsuid" }, /* 228 */
{ 1, 0, sys_setfsgid, "setfsgid" }, /* 229 */
{ 5, 0, printargs, "_newselect" }, /* 230 */
{ 5, 0, sys_select, "select" }, /* 230 */
{ 1, 0, sys_time, "time" }, /* 231 */
{ 2, TF, printargs, "nis_syscall" }, /* 232 */
{ 1, 0, sys_stime, "stime" }, /* 233 */

View File

@ -36,7 +36,7 @@ int sys_setup(), sys_exit(), sys_fork(), sys_read(), sys_write();
int sys_open(), sys_close(), sys_waitpid(), sys_creat(), sys_link();
int sys_unlink(), sys_execve(), sys_chdir(), sys_time(), sys_mknod();
int sys_chmod(), sys_chown(), sys_break(), sys_oldstat();
int sys_lseek(), sys_getpid(), sys_mount(), sys_umount();
int sys_lseek(), sys_getpid(), sys_mount(), sys_umount(), sys_umount2();
int sys_setuid(), sys_getuid(), sys_stime(), sys_ptrace();
int sys_alarm(), sys_oldfstat(), sys_pause(), sys_utime();
int sys_stty(), sys_gtty(), sys_access(), sys_nice(), sys_ftime();

View File

@ -54,7 +54,7 @@
{ 3, 0, sys_lseek, "lseek" }, /* 19 */
{ 0, 0, sys_getpid, "getpid" }, /* 20 */
{ 5, TF, sys_mount, "mount" }, /* 21 */
{ 1, TF, sys_umount, "umount" }, /* 22 */
{ 1, TF, sys_umount, "oldumount" }, /* 22 */
{ 1, 0, sys_setuid, "setuid" }, /* 23 */
{ 0, 0, sys_getuid, "getuid" }, /* 24 */
{ 1, 0, sys_stime, "stime" }, /* 25 */
@ -84,7 +84,7 @@
{ 0, 0, sys_geteuid, "geteuid" }, /* 49 */
{ 0, 0, sys_getegid, "getegid" }, /* 50 */
{ 1, TF, sys_acct, "acct" }, /* 51 */
{ 0, 0, sys_phys, "phys" }, /* 52 */
{ 2, TF, sys_umount2, "umount" }, /* 52 */
{ 0, 0, sys_lock, "lock" }, /* 53 */
{ 3, 0, sys_ioctl, "ioctl" }, /* 54 */
{ 3, 0, sys_fcntl, "fcntl" }, /* 55 */
@ -145,7 +145,7 @@
{ 1, 0, sys_iopl, "iopl" }, /* 110 */
{ 0, 0, sys_vhangup, "vhangup" }, /* 111 */
{ 0, 0, sys_idle, "idle" }, /* 112 */
{ 1, 0, sys_vm86old, "vm86old" }, /* 113 */
{ 1, 0, sys_vm86old, "vm86old" }, /* 113 */
{ 4, TP, sys_wait4, "wait4" }, /* 114 */
{ 1, 0, sys_swapoff, "swapoff" }, /* 115 */
{ 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */

View File

@ -1243,8 +1243,13 @@ sys_rt_sigaction(tcp)
tprintf("{%#lx, ",
(long) sa.__sigaction_handler.__sa_handler);
sigemptyset(&sigset);
#ifdef LINUXSPARC
if (tcp->u_arg[4] <= sizeof(sigset))
memcpy(&sigset, &sa.sa_mask, tcp->u_arg[4]);
#else
if (tcp->u_arg[3] <= sizeof(sigset))
memcpy(&sigset, &sa.sa_mask, tcp->u_arg[3]);
#endif
else
memcpy(&sigset, &sa.sa_mask, sizeof(sigset));
printsigmask(&sigset, 1);
@ -1257,7 +1262,13 @@ sys_rt_sigaction(tcp)
if (entering(tcp))
tprintf(", ");
else
#ifdef LINUXSPARC
tprintf(", %#lx, %lu", tcp->u_arg[3], tcp->u_arg[4]);
#elif defined(ALPHA)
tprintf(", %lu, %#lx", tcp->u_arg[3], tcp->u_arg[4]);
#else
tprintf(", %lu", addr = tcp->u_arg[3]);
#endif
return 0;
}

View File

@ -820,6 +820,10 @@ int sig;
* before detaching. Arghh. We go through hoops
* to make a clean break of things.
*/
#if defined(SPARC)
#undef PTRACE_DETACH
#define PTRACE_DETACH PTRACE_SUNDETACH
#endif
if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) == 0) {
/* On a clear day, you can see forever. */
}

View File

@ -653,6 +653,10 @@ struct tcb *tcp;
/* Linux/SPARC syscall trap. */
set_personality(0);
break;
case 0x91d0206d:
/* Linux/SPARC64 syscall trap. */
fprintf(stderr,"syscall: Linux/SPARC64 not supported yet\n");
return -1;
case 0x91d02000:
/* SunOS syscall trap. (pers 1) */
fprintf(stderr,"syscall: SunOS no support\n");

View File

@ -96,6 +96,21 @@ struct tcb *tcp;
return 0;
}
int
sys_umount2(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
printstr(tcp, tcp->u_arg[0], -1);
tprintf(", ");
if (tcp->u_arg[1] & 1)
tprintf("MNT_FORCE");
else
tprintf("0");
}
return 0;
}
static struct xlat personality_options[] = {
#ifdef PER_LINUX
{ PER_LINUX, "PER_LINUX" },

2
util.c
View File

@ -44,7 +44,7 @@
# define PTRACE_PEEKUSR PTRACE_PEEKUSER
#endif
#ifdef LINUX
#ifndef __GLIBC__
#if !defined(__GLIBC__) || defined(SPARC)
#include <linux/ptrace.h>
#endif
#endif /* LINUX */