diff options
-rw-r--r-- | ChangeLog | 67 | ||||
-rw-r--r-- | bjm.c | 34 | ||||
-rw-r--r-- | defs.h | 11 | ||||
-rw-r--r-- | desc.c | 2 | ||||
-rw-r--r-- | file.c | 6 | ||||
-rw-r--r-- | linux/ia64/Makefile.in | 12 | ||||
-rw-r--r-- | linux/ia64/ioctlent.h | 143 | ||||
-rw-r--r-- | linux/ia64/syscallent.h | 504 | ||||
-rw-r--r-- | linux/ioctlent.sh | 10 | ||||
-rw-r--r-- | linux/syscall.h | 71 | ||||
-rw-r--r-- | process.c | 37 | ||||
-rw-r--r-- | resource.c | 4 | ||||
-rw-r--r-- | signal.c | 60 | ||||
-rw-r--r-- | strace.c | 21 | ||||
-rw-r--r-- | syscall.c | 107 | ||||
-rw-r--r-- | util.c | 85 |
16 files changed, 803 insertions, 371 deletions
@@ -1,3 +1,70 @@ +2001-10-03 David Mosberger <davidm@hpl.hp.com> + + * process.c (internal_clone): Avoid race condition by clearing + breakpoint after attaching to child. + +2001-10-02 David Mosberger <davidm@hpl.hp.com> + + * linux/ia64/syscallent.h: Define ia32 syscall numbers (originally + by Don Dugger, with my refinements). + + * linux/ia64/ioctlent.h: Regenerate and manually merge conflicting + ioctls (TCGETS & SNDCTL_TMR_TIMEBASE, etc.). + + * linux/ia64/Makefile.in (ioctldefs.h ioctls.h): Update for + new ioctlent.h generation scheme. + + * linux/syscall.h (sys_clone2): Declare. + [IA64] Define ia32 socket, ipc, and extra syscall numbers. + + * linux/ioctlent.sh (regexp): Also handle <asm/ioctls.h> so we + don't miss the tty ioctls (unfortunately, some of the sound timer + ioctls are in conflict with them!). + + * util.c (setbpt) [IA64]: Add ia32 support (by Don Dugger). + (clrbpt) [IA64]: Ditto. + + * syscall.c (internal_syscall): Handle SYS_clone2, SYS32_wait4, + and SYS32_exit. + (get_scno): Get ia32 syscall number from r1 (orig eax) instead of + r8 (eax). Handle TCB_WAITEXECVE. + (syscall_fixup): Handle ia64. + (syscall_enter): Fix argument fetching for ia64. + + * strace.c [IA64 && LINUX]: Include <asm/ptrace_offsets.h>. + (trace) [PT_GETSIGINFO]: Print signal address and pc if possible. + + * process.c (tcp): New function. + (change_syscall): Add support for ia64 linux. + (sys_execve): Turn on TCB_WAITEXECVE for ia64 linux. + + * desc.c (getlk): Cast l_len to "long long" to avoid warnings when + type is narrower. + * resource.c (sprintrlim64): Ditto. + + * defs.h (TCB_WAITEXECVE) [IA64]: Define. + [IA64]: Declare "ia32" variable. + + * bjm.c: Do not include <linux/module.h>. It's not safe to include + kernel headers. Declare the necessary constants and structures + directly instead. + +2001-10-01 David Mosberger <davidm@hpl.hp.com> + + * signal.c (parse_sigset_t): New function. + (sigishandled): Fix off-by-one bug by using parse_sigset_t() and + avoiding relying on internal layout of sigset_t datastructure. + +2001-04-26 David Mosberger <davidm@hpl.hp.com> + + * linux/ia64/syscallent.h: Add getunwind(). + +2001-04-11 David Mosberger <davidm@hpl.hp.com> + + * syscall.c (syscall_enter): Use PT_RBS_END instead of deprecated + PT_AR_BSP. Pick up arguments starting with out0, which is not + always the same as r32 (e.g., consider inlined syscalls). + 2001-09-28 John Hughes <john@Calva.COM> * process.c: FreeBSD-CURRENT no longer has PT_READ_U, and anyway we @@ -42,7 +42,39 @@ #include <sys/user.h> #include <sys/syscall.h> #include <signal.h> -#include <linux/module.h> + +/* Bits of module.flags. */ + +#define MOD_UNINITIALIZED 0 +#define MOD_RUNNING 1 +#define MOD_DELETED 2 +#define MOD_AUTOCLEAN 4 +#define MOD_VISITED 8 +#define MOD_USED_ONCE 16 +#define MOD_JUST_FREED 32 +#define MOD_INITIALIZING 64 + +/* Values for query_module's which. */ + +#define QM_MODULES 1 +#define QM_DEPS 2 +#define QM_REFS 3 +#define QM_SYMBOLS 4 +#define QM_INFO 5 + +struct module_symbol +{ + unsigned long value; + const char *name; +}; + +struct module_info +{ + unsigned long addr; + unsigned long size; + unsigned long flags; + long usecount; +}; static struct xlat which[] = { { 0, "0" }, @@ -176,7 +176,6 @@ extern int ptrace(); #define SUPPORTED_PERSONALITIES 2 #endif /* LINUXSPARC */ - #ifdef SVR4 #ifdef HAVE_MP_PROCFS extern int mp_ioctl (int f, int c, void *a, int s); @@ -284,9 +283,9 @@ struct tcb { #define TCB_FOLLOWFORK 00400 /* Process should have forks followed */ #define TCB_REPRINT 01000 /* We should reprint this syscall on exit */ #ifdef LINUX -#if defined(ALPHA) || defined(SPARC) || defined(POWERPC) || defined(HPPA) -#define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */ -#endif /* ALPHA */ +# if defined(ALPHA) || defined(SPARC) || defined(POWERPC) || defined(IA64) || defined(HPPA) +# define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */ +# endif #endif /* LINUX */ /* qualifier flags */ @@ -532,3 +531,7 @@ do { \ ((long long)((unsigned long long)(_h) | ((unsigned long long)(_l)<<32))) #endif #endif + +#ifdef IA64 +extern long ia32; +#endif @@ -225,7 +225,7 @@ int getlk; printxval(lockfcmds, fl.l_type, "F_???"); tprintf(", whence="); printxval(whence, fl.l_whence, "SEEK_???"); - tprintf(", start=%lld, len=%lld", fl.l_start, fl.l_len); + tprintf(", start=%lld, len=%lld", (long long) fl.l_start, (long long) fl.l_len); if (getlk) tprintf(", pid=%lu}", (unsigned long) fl.l_pid); else @@ -990,7 +990,7 @@ struct tcb *tcp; } return 0; } -# endif /* !IA64 */ +# endif /* !IA64 && !HPPA*/ #endif /* linux */ #ifndef HAVE_LONG_LONG_OFF_T @@ -1036,7 +1036,7 @@ struct tcb *tcp; } return 0; } -# endif /* !IA64 */ +# endif /* !IA64 && !HPPA*/ #endif #ifndef HAVE_LONG_LONG_OFF_T @@ -1085,7 +1085,7 @@ struct tcb *tcp; } return 0; } -# endif /* !IA64 */ +# endif /* !IA64 && !HPPA */ #endif diff --git a/linux/ia64/Makefile.in b/linux/ia64/Makefile.in index 4c5344d..72b0383 100644 --- a/linux/ia64/Makefile.in +++ b/linux/ia64/Makefile.in @@ -23,19 +23,17 @@ includedir = @includedir@ all: ioctlent.h errnoent.h signalent.h syscallent.h -ioctlent.raw: ioctlent.sh - $(SHELL) $(srcdir)/ioctlent.sh $(includedir) >$@ - -ioctlent.h: ioctlent.raw ioctlsort +ioctlent.h: ioctlsort ./ioctlsort >$@ ioctlsort: ioctlsort.o $(CC) $(LDFLAGS) ioctlsort.o -o ioctlsort -ioctlsort.o: ../../ioctlsort.c - $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $(srcdir)/../../ioctlsort.c +ioctlsort.o: ../ioctlsort.c ioctldefs.h ioctls.h + $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $< -ioctlsort.o: ioctlent.raw +ioctldefs.h ioctls.h: $(srcdir)/../ioctlent.sh + sh $(srcdir)/../ioctlent.sh errnoent.h: ../../errnoent.sh $(includedir)/asm/errno.h $(SHELL) $(srcdir)/../../errnoent.sh $(includedir)/asm/errno.h >$@ diff --git a/linux/ia64/ioctlent.h b/linux/ia64/ioctlent.h index 7b78080..7574bc3 100644 --- a/linux/ia64/ioctlent.h +++ b/linux/ia64/ioctlent.h @@ -54,6 +54,8 @@ {"linux/fs.h", "BLKELVGET", 0x126a}, {"linux/elevator.h", "BLKELVSET", 0x126b}, {"linux/fs.h", "BLKELVSET", 0x126b}, + {"linux/fs.h", "BLKGETLASTSECT", 0x126c}, + {"linux/fs.h", "BLKSETLASTSECT", 0x126d}, {"linux/agpgart.h", "AGPIOC_INFO", 0x4100}, {"linux/agpgart.h", "AGPIOC_ACQUIRE", 0x4101}, {"linux/apm_bios.h", "APM_IOC_STANDBY", 0x4101}, @@ -82,11 +84,21 @@ {"linux/cciss_ioctl.h", "CCISS_GETDRIVVER", 0x4209}, {"linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", 0x420a}, {"linux/cciss_ioctl.h", "CCISS_PASSTHRU", 0x420b}, + {"linux/soundcard.h", "SNDCTL_COPR_RESET", 0x4300}, {"linux/capi.h", "CAPI_REGISTER", 0x4301}, + {"linux/soundcard.h", "SNDCTL_COPR_LOAD", 0x4301}, + {"linux/soundcard.h", "SNDCTL_COPR_RDATA", 0x4302}, + {"linux/soundcard.h", "SNDCTL_COPR_RCODE", 0x4303}, + {"linux/soundcard.h", "SNDCTL_COPR_WDATA", 0x4304}, + {"linux/soundcard.h", "SNDCTL_COPR_WCODE", 0x4305}, {"linux/capi.h", "CAPI_GET_MANUFACTURER", 0x4306}, + {"linux/soundcard.h", "SNDCTL_COPR_RUN", 0x4306}, {"linux/capi.h", "CAPI_GET_VERSION", 0x4307}, + {"linux/soundcard.h", "SNDCTL_COPR_HALT", 0x4307}, {"linux/capi.h", "CAPI_GET_SERIAL", 0x4308}, + {"linux/soundcard.h", "SNDCTL_COPR_SENDMSG", 0x4308}, {"linux/capi.h", "CAPI_GET_PROFILE", 0x4309}, + {"linux/soundcard.h", "SNDCTL_COPR_RCVMSG", 0x4309}, {"linux/capi.h", "CAPI_MANUFACTURER_CMD", 0x4320}, {"linux/capi.h", "CAPI_GET_ERRCODE", 0x4321}, {"linux/capi.h", "CAPI_INSTALLED", 0x4322}, @@ -132,14 +144,139 @@ {"linux/isdn.h", "IIOCNETGPN", 0x4922}, {"linux/isdn.h", "IIOCDBGVAR", 0x497f}, {"linux/isdn.h", "IIOCDRVCTL", 0x4980}, + {"linux/soundcard.h", "SOUND_MIXER_INFO", 0x4d65}, + {"linux/soundcard.h", "SOUND_OLD_MIXER_INFO", 0x4d65}, + {"linux/soundcard.h", "SOUND_MIXER_ACCESS", 0x4d66}, + {"linux/soundcard.h", "SOUND_MIXER_AGC", 0x4d67}, + {"linux/soundcard.h", "SOUND_MIXER_3DSE", 0x4d68}, + {"linux/soundcard.h", "SOUND_MIXER_PRIVATE1", 0x4d6f}, + {"linux/soundcard.h", "SOUND_MIXER_PRIVATE2", 0x4d70}, + {"linux/soundcard.h", "SOUND_MIXER_PRIVATE3", 0x4d71}, + {"linux/soundcard.h", "SOUND_MIXER_PRIVATE4", 0x4d72}, + {"linux/soundcard.h", "SOUND_MIXER_PRIVATE5", 0x4d73}, + {"linux/soundcard.h", "SOUND_MIXER_GETLEVELS", 0x4d74}, + {"linux/soundcard.h", "SOUND_MIXER_SETLEVELS", 0x4d75}, + {"linux/soundcard.h", "OSS_GETVERSION", 0x4d76}, + {"linux/soundcard.h", "SNDCTL_DSP_RESET", 0x5000}, + {"linux/soundcard.h", "SNDCTL_DSP_SYNC", 0x5001}, + {"linux/soundcard.h", "SNDCTL_DSP_SPEED", 0x5002}, + {"linux/soundcard.h", "SOUND_PCM_READ_RATE", 0x5002}, + {"linux/soundcard.h", "SNDCTL_DSP_STEREO", 0x5003}, + {"linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", 0x5004}, + {"linux/soundcard.h", "SNDCTL_DSP_SETFMT", 0x5005}, + {"linux/soundcard.h", "SOUND_PCM_READ_BITS", 0x5005}, + {"linux/soundcard.h", "SNDCTL_DSP_CHANNELS", 0x5006}, + {"linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", 0x5006}, + {"linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", 0x5007}, + {"linux/soundcard.h", "SOUND_PCM_READ_FILTER", 0x5007}, + {"linux/soundcard.h", "SNDCTL_DSP_POST", 0x5008}, + {"linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", 0x5009}, + {"linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", 0x500a}, + {"linux/soundcard.h", "SNDCTL_DSP_GETFMTS", 0x500b}, + {"linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", 0x500c}, + {"linux/soundcard.h", "SNDCTL_DSP_GETISPACE", 0x500d}, + {"linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", 0x500e}, + {"linux/soundcard.h", "SNDCTL_DSP_GETCAPS", 0x500f}, + {"linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", 0x5010}, + {"linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", 0x5010}, + {"linux/soundcard.h", "SNDCTL_DSP_GETIPTR", 0x5011}, + {"linux/soundcard.h", "SNDCTL_DSP_GETOPTR", 0x5012}, + {"linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", 0x5013}, + {"linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", 0x5014}, + {"linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", 0x5015}, + {"linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", 0x5016}, + {"linux/soundcard.h", "SNDCTL_DSP_GETODELAY", 0x5017}, + {"linux/soundcard.h", "SNDCTL_DSP_PROFILE", 0x5017}, + {"linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", 0x5040}, + {"linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", 0x5041}, + {"linux/soundcard.h", "SNDCTL_SEQ_RESET", 0x5100}, + {"linux/soundcard.h", "SNDCTL_SEQ_SYNC", 0x5101}, + {"linux/soundcard.h", "SNDCTL_SYNTH_INFO", 0x5102}, + {"linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", 0x5103}, + {"linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", 0x5104}, + {"linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", 0x5105}, + {"linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", 0x5106}, + {"linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", 0x5107}, + {"linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", 0x5108}, + {"linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", 0x5109}, + {"linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", 0x510a}, + {"linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", 0x510b}, + {"linux/soundcard.h", "SNDCTL_MIDI_INFO", 0x510c}, + {"linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", 0x510d}, + {"linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", 0x510e}, + {"linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", 0x510f}, + {"linux/soundcard.h", "SNDCTL_SEQ_PANIC", 0x5111}, + {"linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", 0x5112}, + {"linux/soundcard.h", "SNDCTL_SEQ_GETTIME", 0x5113}, + {"linux/soundcard.h", "SNDCTL_SYNTH_ID", 0x5114}, + {"linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", 0x5115}, + {"linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", 0x5116}, {"linux/random.h", "RNDGETENTCNT", 0x5200}, {"linux/random.h", "RNDADDTOENTCNT", 0x5201}, {"linux/random.h", "RNDGETPOOL", 0x5202}, {"linux/random.h", "RNDADDENTROPY", 0x5203}, {"linux/random.h", "RNDZAPENTCNT", 0x5204}, {"linux/random.h", "RNDCLEARPOOL", 0x5206}, + {"asm/ioctls.h", "TCGETS|SNDCTL_TMR_TIMEBASE", 0x5401}, + {"asm/ioctls.h", "TCSETS|SNDCTL_TMR_START", 0x5402}, + {"asm/ioctls.h", "TCSETSW|SNDCTL_TMR_STOP", 0x5403}, + {"asm/ioctls.h", "TCSETSF|SNDCTL_TMR_CONTINUE", 0x5404}, + {"asm/ioctls.h", "TCGETA|SNDCTL_TMR_TEMPO", 0x5405}, + {"asm/ioctls.h", "TCSETA|SNDCTL_TMR_SOURCE", 0x5406}, + {"asm/ioctls.h", "TCSETAW|SNDCTL_TMR_METRONOME", 0x5407}, + {"asm/ioctls.h", "TCSETAF|SNDCTL_TMR_SELECT", 0x5408}, + {"asm/ioctls.h", "TCSBRK", 0x5409}, + {"asm/ioctls.h", "TCXONC", 0x540a}, + {"asm/ioctls.h", "TCFLSH", 0x540b}, + {"asm/ioctls.h", "TIOCEXCL", 0x540c}, + {"asm/ioctls.h", "TIOCNXCL", 0x540d}, + {"asm/ioctls.h", "TIOCSCTTY", 0x540e}, + {"asm/ioctls.h", "TIOCGPGRP", 0x540f}, + {"asm/ioctls.h", "TIOCSPGRP", 0x5410}, + {"asm/ioctls.h", "TIOCOUTQ", 0x5411}, + {"asm/ioctls.h", "TIOCSTI", 0x5412}, + {"asm/ioctls.h", "TIOCGWINSZ", 0x5413}, + {"asm/ioctls.h", "TIOCSWINSZ", 0x5414}, + {"asm/ioctls.h", "TIOCMGET", 0x5415}, + {"asm/ioctls.h", "TIOCMBIS", 0x5416}, + {"asm/ioctls.h", "TIOCMBIC", 0x5417}, + {"asm/ioctls.h", "TIOCMSET", 0x5418}, + {"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419}, + {"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a}, + {"asm/ioctls.h", "FIONREAD", 0x541b}, + {"asm/ioctls.h", "TIOCLINUX", 0x541c}, + {"asm/ioctls.h", "TIOCCONS", 0x541d}, + {"asm/ioctls.h", "TIOCGSERIAL", 0x541e}, + {"asm/ioctls.h", "TIOCSSERIAL", 0x541f}, + {"asm/ioctls.h", "TIOCPKT", 0x5420}, + {"asm/ioctls.h", "FIONBIO", 0x5421}, + {"asm/ioctls.h", "TIOCNOTTY", 0x5422}, + {"asm/ioctls.h", "TIOCSETD", 0x5423}, + {"asm/ioctls.h", "TIOCGETD", 0x5424}, + {"asm/ioctls.h", "TCSBRKP", 0x5425}, + {"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426}, + {"asm/ioctls.h", "TIOCSBRK", 0x5427}, + {"asm/ioctls.h", "TIOCCBRK", 0x5428}, + {"asm/ioctls.h", "TIOCGSID", 0x5429}, {"asm/ioctls.h", "TIOCGPTN", 0x5430}, {"asm/ioctls.h", "TIOCSPTLCK", 0x5431}, + {"asm/ioctls.h", "FIONCLEX", 0x5450}, + {"asm/ioctls.h", "FIOCLEX", 0x5451}, + {"asm/ioctls.h", "FIOASYNC", 0x5452}, + {"asm/ioctls.h", "TIOCSERCONFIG", 0x5453}, + {"asm/ioctls.h", "TIOCSERGWILD", 0x5454}, + {"asm/ioctls.h", "TIOCSERSWILD", 0x5455}, + {"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456}, + {"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457}, + {"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458}, + {"asm/ioctls.h", "TIOCSERGETLSR", 0x5459}, + {"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a}, + {"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b}, + {"asm/ioctls.h", "TIOCMIWAIT", 0x545c}, + {"asm/ioctls.h", "TIOCGICOUNT", 0x545d}, + {"asm/ioctls.h", "TIOCGHAYESESP", 0x545e}, + {"asm/ioctls.h", "TIOCSHAYESESP", 0x545f}, + {"asm/ioctls.h", "FIOQSIZE", 0x5460}, {"linux/usbdevice_fs.h", "USBDEVFS_CONTROL", 0x5500}, {"linux/usbdevice_fs.h", "USBDEVFS_BULK", 0x5502}, {"linux/usbdevice_fs.h", "USBDEVFS_RESETEP", 0x5503}, @@ -265,10 +402,13 @@ {"linux/udf_fs_i.h", "UDF_GETEASIZE", 0x6c40}, {"linux/udf_fs_i.h", "UDF_GETEABLOCK", 0x6c41}, {"linux/udf_fs_i.h", "UDF_GETVOLIDENT", 0x6c42}, + {"linux/soundcard.h", "SNDCTL_MIDI_PRETIME", 0x6d00}, {"linux/synclink.h", "MGSL_IOCSPARAMS", 0x6d00}, {"linux/mtio.h", "MTIOCTOP", 0x6d01}, + {"linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", 0x6d01}, {"linux/synclink.h", "MGSL_IOCGPARAMS", 0x6d01}, {"linux/mtio.h", "MTIOCGET", 0x6d02}, + {"linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", 0x6d02}, {"linux/synclink.h", "MGSL_IOCSTXIDLE", 0x6d02}, {"linux/mtio.h", "MTIOCPOS", 0x6d03}, {"linux/synclink.h", "MGSL_IOCGTXIDLE", 0x6d03}, @@ -541,7 +681,7 @@ {"linux/if_pppox.h", "PPPOEIOCSFWD", 0xb100}, {"linux/if_pppox.h", "PPPOEIOCDFWD", 0xb101}, {"linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", 0xcd01}, - {"linux/lvm.h", "VG_CREATE_OLD", 0xfe00}, + {"linux/lvm.h", "VG_CREATE", 0xfe00}, {"linux/lvm.h", "VG_REMOVE", 0xfe01}, {"linux/lvm.h", "VG_EXTEND", 0xfe03}, {"linux/lvm.h", "VG_REDUCE", 0xfe04}, @@ -550,7 +690,6 @@ {"linux/lvm.h", "VG_STATUS_GET_NAMELIST", 0xfe07}, {"linux/lvm.h", "VG_SET_EXTENDABLE", 0xfe08}, {"linux/lvm.h", "VG_RENAME", 0xfe09}, - {"linux/lvm.h", "VG_CREATE", 0xfe0a}, {"linux/lvm.h", "LV_CREATE", 0xfe20}, {"linux/lvm.h", "LV_REMOVE", 0xfe21}, {"linux/lvm.h", "LV_ACTIVATE", 0xfe22}, diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index 85bb3db..3bf3b82 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 1999 David Mosberger-Tang <davidm@hpl.hp.com> + * Copyright (c) 1999, 2001 Hewlett-Packard Co + * David Mosberger-Tang <davidm@hpl.hp.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,284 +27,223 @@ * * $Id$ */ - { 0, 0, sys_setup, "setup" }, /* 0 */ - { 1, TP, sys_exit, "_exit" }, /* 1 */ - { 0, TP, sys_fork, "fork" }, /* 2 */ - { 3, 0, sys_read, "read" }, /* 3 */ - { 3, 0, sys_write, "write" }, /* 4 */ - { 3, TF, sys_open, "open" }, /* 5 */ - { 1, 0, sys_close, "close" }, /* 6 */ - { 3, TP, sys_waitpid, "waitpid" }, /* 7 */ - { 2, TF, sys_creat, "creat" }, /* 8 */ - { 2, TF, sys_link, "link" }, /* 9 */ - { 1, TF, sys_unlink, "unlink" }, /* 10 */ - { 3, TF|TP, sys_execve, "execve" }, /* 11 */ - { 1, TF, sys_chdir, "chdir" }, /* 12 */ - { 8, 0, printargs, "SYS_13" }, /* 13 */ - { 3, TF, sys_mknod, "mknod" }, /* 14 */ - { 2, TF, sys_chmod, "chmod" }, /* 15 */ - { 3, TF, sys_chown, "lchown" }, /* 16 */ - { 8, 0, printargs, "SYS_17" }, /* 17 */ - { 8, 0, printargs, "SYS_18" }, /* 18 */ - { 3, 0, sys_lseek, "lseek" }, /* 19 */ - { 0, 0, sys_getpid, "getpid" }, /* 20 */ - { 5, TF, sys_mount, "mount" }, /* 21 */ - { 1, TF, sys_umount, "oldumount" }, /* 22 */ - { 1, 0, sys_setuid, "setuid" }, /* 23 */ - { 0, 0, sys_getuid, "getuid" }, /* 24 */ - { 8, 0, printargs, "SYS_25" }, /* 25 */ - { 4, 0, sys_ptrace, "ptrace" }, /* 26 */ - { 1, 0, sys_alarm, "alarm" }, /* 27 */ - { 8, 0, printargs, "SYS_28" }, /* 28 */ - { 8, 0, printargs, "SYS_29" }, /* 29 */ - { 8, 0, printargs, "SYS_30" }, /* 30 */ - { 8, 0, printargs, "SYS_31" }, /* 31 */ - { 8, 0, printargs, "SYS_32" }, /* 32 */ - { 2, TF, sys_access, "access" }, /* 33 */ - { 1, 0, sys_nice, "nice" }, /* 34 */ - { 8, 0, printargs, "SYS_35" }, /* 35 */ - { 0, 0, sys_sync, "sync" }, /* 36 */ - { 2, TS, sys_kill, "kill" }, /* 37 */ - { 2, TF, sys_rename, "rename" }, /* 38 */ - { 2, TF, sys_mkdir, "mkdir" }, /* 39 */ - { 1, TF, sys_rmdir, "rmdir" }, /* 40 */ - { 1, 0, sys_dup, "dup" }, /* 41 */ - { 1, 0, sys_pipe, "pipe" }, /* 42 */ - { 1, 0, sys_times, "times" }, /* 43 */ - { 8, 0, printargs, "SYS_44" }, /* 44 */ - { 1, 0, sys_brk, "brk" }, /* 45 */ - { 1, 0, sys_setgid, "setgid" }, /* 46 */ - { 0, 0, sys_getgid, "getgid" }, /* 47 */ - { 3, TS, sys_signal, "signal" }, /* 48 */ - { 0, 0, sys_geteuid, "geteuid" }, /* 49 */ - { 0, 0, sys_getegid, "getegid" }, /* 50 */ - { 1, TF, sys_acct, "acct" }, /* 51 */ - { 2, TF, sys_umount2, "umount" }, /* 52 */ - { 8, 0, printargs, "SYS_53" }, /* 53 */ - { 3, 0, sys_ioctl, "ioctl" }, /* 54 */ - { 3, 0, sys_fcntl, "fcntl" }, /* 55 */ - { 8, 0, printargs, "SYS_56" }, /* 56 */ - { 2, 0, sys_setpgid, "setpgid" }, /* 57 */ - { 8, 0, printargs, "SYS_58" }, /* 58 */ - { 8, 0, printargs, "SYS_59" }, /* 59 */ - { 1, 0, sys_umask, "umask" }, /* 60 */ - { 1, TF, sys_chroot, "chroot" }, /* 61 */ - { 2, 0, sys_ustat, "ustat" }, /* 62 */ - { 2, 0, sys_dup2, "dup2" }, /* 63 */ - { 0, 0, sys_getppid, "getppid" }, /* 64 */ - { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */ - { 0, 0, sys_setsid, "setsid" }, /* 66 */ - { 8, 0, printargs, "SYS_67" }, /* 67 */ - { 8, 0, printargs, "SYS_68" }, /* 68 */ - { 8, 0, printargs, "SYS_69" }, /* 69 */ - { 2, 0, sys_setreuid, "setreuid" }, /* 70 */ - { 2, 0, sys_setregid, "setregid" }, /* 71 */ - { 8, 0, printargs, "SYS_72" }, /* 72 */ - { 1, TS, sys_sigpending, "sigpending" }, /* 73 */ - { 2, 0, sys_sethostname, "sethostname" }, /* 74 */ - { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */ - { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */ - { 2, 0, sys_getrusage, "getrusage" }, /* 77 */ - { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */ - { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */ - { 2, 0, sys_getgroups, "getgroups" }, /* 80 */ - { 2, 0, sys_setgroups, "setgroups" }, /* 81 */ - { 8, 0, printargs, "SYS_82" }, /* 82 */ - { 2, TF, sys_symlink, "symlink" }, /* 83 */ - { 8, 0, printargs, "SYS_84" }, /* 84 */ - { 3, TF, sys_readlink, "readlink" }, /* 85 */ - { 1, TF, sys_uselib, "uselib" }, /* 86 */ - { 1, TF, sys_swapon, "swapon" }, /* 87 */ - { 3, 0, sys_reboot, "reboot" }, /* 88 */ - { 3, 0, sys_readdir, "readdir" }, /* 89 */ - { 6, 0, sys_old_mmap, "mmap" }, /* 90 */ - { 2, 0, sys_munmap, "munmap" }, /* 91 */ - { 2, TF, sys_truncate, "truncate" }, /* 92 */ - { 2, 0, sys_ftruncate, "ftruncate" }, /* 93 */ - { 2, 0, sys_fchmod, "fchmod" }, /* 94 */ - { 3, 0, sys_fchown, "fchown" }, /* 95 */ - { 2, 0, sys_getpriority, "getpriority" }, /* 96 */ - { 3, 0, sys_setpriority, "setpriority" }, /* 97 */ - { 8, 0, printargs, "SYS_98" }, /* 98 */ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, 0, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ - { 2, 0, sys_socketcall, "socketcall" }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ - { 2, TF, sys_stat, "stat" }, /* 106 */ - { 2, TF, sys_lstat, "lstat" }, /* 107 */ - { 2, 0, sys_fstat, "fstat" }, /* 108 */ - { 8, 0, printargs, "SYS_109" }, /* 109 */ - { 1, 0, sys_iopl, "iopl" }, /* 110 */ - { 0, 0, sys_vhangup, "vhangup" }, /* 111 */ - { 8, 0, printargs, "SYS_112" }, /* 112 */ - { 8, 0, printargs, "SYS_113" }, /* 113 */ - { 4, TP, sys_wait4, "wait4" }, /* 114 */ - { 1, 0, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ - { 8, 0, printargs, "SYS_117" }, /* 117 */ - { 1, 0, sys_fsync, "fsync" }, /* 118 */ - { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 2, TP, sys_clone, "clone" }, /* 120 */ - { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */ - { 1, 0, sys_uname, "uname" }, /* 122 */ - { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 123 */ - { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */ - { 3, 0, sys_mprotect, "mprotect" }, /* 125 */ - { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */ - { 2, 0, sys_create_module, "create_module" }, /* 127 */ - { 2, 0, sys_init_module, "init_module" }, /* 128 */ - { 1, 0, sys_delete_module, "delete_module" }, /* 129 */ - { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */ - { 4, 0, sys_quotactl, "quotactl" }, /* 131 */ - { 1, 0, sys_getpgid, "getpgid" }, /* 132 */ - { 1, 0, sys_fchdir, "fchdir" }, /* 133 */ - { 0, 0, sys_bdflush, "bdflush" }, /* 134 */ - { 3, 0, sys_sysfs, "sysfs" }, /* 135 */ - { 1, 0, sys_personality, "personality" }, /* 136 */ - { 8, 0, printargs, "SYS_137" }, /* 137 */ - { 1, 0, sys_setfsuid, "setfsuid" }, /* 138 */ - { 1, 0, sys_setfsgid, "setfsgid" }, /* 139 */ - { 5, 0, sys_llseek, "_llseek" }, /* 140 */ - { 3, 0, sys_getdents, "getdents" }, /* 141 */ - { 5, 0, sys_select, "select" }, /* 142 */ - { 2, 0, sys_flock, "flock" }, /* 143 */ - { 3, 0, sys_msync, "msync" }, /* 144 */ - { 3, 0, sys_readv, "readv" }, /* 145 */ - { 3, 0, sys_writev, "writev" }, /* 146 */ - { 1, 0, sys_getsid, "getsid" }, /* 147 */ - { 1, 0, sys_fdatasync, "fdatasync" }, /* 148 */ - { 1, 0, sys_sysctl, "_sysctl" }, /* 149 */ - { 1, 0, sys_mlock, "mlock" }, /* 150 */ - { 2, 0, sys_munlock, "munlock" }, /* 151 */ - { 2, 0, sys_mlockall, "mlockall" }, /* 152 */ - { 1, 0, sys_munlockall, "munlockall" }, /* 153 */ - { 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */ - { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */ - { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */ - { 1, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */ - { 0, 0, sys_sched_yield, "sched_yield"}, /* 158 */ - { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */ - { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */ - { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */ - { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */ - { 4, 0, sys_mremap, "mremap" }, /* 163 */ - { 3, 0, sys_setresuid, "setresuid" }, /* 164 */ - { 3, 0, sys_getresuid, "getresuid" }, /* 165 */ - { 5, 0, printargs, "vm86" }, /* 166 */ - { 5, 0, sys_query_module, "query_module" }, /* 167 */ - { 3, 0, sys_poll, "poll" }, /* 168 */ - { 3, 0, printargs, "nfsservctl" }, /* 169 */ - { 3, 0, sys_setresgid, "setresgid" }, /* 170 */ - { 3, 0, sys_getresgid, "getresgid" }, /* 171 */ - { 5, 0, sys_prctl, "prctl" }, /* 172 */ - { 1, TS, printargs, "rt_sigreturn" }, /* 173 */ - { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */ - { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */ - { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */ - { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */ - { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */ - { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */ - { 5, TF, sys_pread, "pread" }, /* 180 */ - { 5, TF, sys_pwrite, "pwrite" }, /* 181 */ - { 3, TF, sys_chown, "chown" }, /* 182 */ - { 2, 0, sys_getcwd, "getcwd" }, /* 183 */ - { 2, 0, sys_capget, "capget" }, /* 184 */ - { 2, 0, sys_capset, "capset" }, /* 185 */ - { 2, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */ - { 4, TF, sys_sendfile, "sendfile" }, /* 187 */ - { 5, 0, printargs, "SYS_188" }, /* 188 */ - { 5, 0, printargs, "SYS_189" }, /* 189 */ - { 0, TP, sys_vfork, "vfork" }, /* 190 */ - { 5, 0, printargs, "getrlimit" }, /* 191 */ - { 6, 0, sys_mmap, "mmap2" }, /* 192 */ - { 5, 0, printargs, "truncate64" }, /* 193 */ - { 5, 0, printargs, "ftruncate64" }, /* 194 */ - { 2, TF, sys_stat64, "stat64" }, /* 195 */ - { 2, TF, sys_lstat64, "lstat64" }, /* 196 */ - { 2, TF, sys_fstat64, "fstat64" }, /* 197 */ - { 5, 0, printargs, "SYS_198" }, /* 198 */ - { 5, 0, printargs, "SYS_199" }, /* 199 */ +/* + * IA-32 syscalls that have pointer arguments which are incompatible + * with 64-bit layout get redirected to printargs. + */ +#define sys_getrlimit printargs +#define sys_afs_syscall printargs +#define sys_getpmsg printargs +#define sys_putpmsg printargs +#define sys_ugetrlimit printargs +#define sys_fork printargs +#define sys_waitpid printargs +#define sys_time printargs +#define sys_break printargs +#define sys_oldstat printargs +#define sys_lseek printargs +#define sys_stime printargs +#define sys_ptrace printargs +#define sys_alarm printargs +#define sys_oldfstat printargs +#define sys_pause printargs +#define sys_utime printargs +#define sys_stty printargs +#define sys_gtty printargs +#define sys_ftime printargs +#define sys_pipe printargs +#define sys_times printargs +#define sys_prof printargs +#define sys_signal printargs +#define sys_lock printargs +#define sys_ioctl printargs +#define sys_fcntl printargs +#define sys_mpx printargs +#define sys_ulimit printargs +#define sys_oldolduname printargs +#define sys_sigaction printargs +#define sys_sgetmask printargs +#define sys_ssetmask printargs +#define sys_sigsuspend printargs +#define sys_sigpending printargs +#define sys_setrlimit printargs +#define sys_getrusage printargs +#define sys_gettimeofday printargs +#define sys_settimeofday printargs +#define sys_getgroups printargs +#define sys_setgroups printargs +#define sys_select printargs +#define sys_oldlstat printargs +#define sys_readdir printargs +#define sys_profil printargs +#define sys_statfs printargs +#define sys_fstatfs printargs +#define sys_ioperm printargs +#define sys_socketcall printargs +#define sys_setitimer printargs +#define sys_getitimer printargs +#define sys_stat printargs +#define sys_lstat printargs +#define sys_fstat printargs +#define sys_olduname printargs +#define sys_iopl printargs +#define sys_idle printargs +#define sys_vm86old printargs +#define sys_wait4 printargs +#define sys_sysinfo printargs +#define sys_ipc printargs +#define sys_sigreturn printargs +#define sys_uname printargs +#define sys_modify_ldt printargs +#define sys_adjtimex printargs +#define sys_sigprocmask printargs +#define sys_create_module printargs +#define sys_init_module printargs +#define sys_delete_module printargs +#define sys_get_kernel_syms printargs +#define sys_quotactl printargs +#define sys_bdflush printargs +#define sys_personality printargs +#define sys_getdents printargs +#define sys__newselect printargs +#define sys_msync printargs +#define sys_readv printargs +#define sys_writev printargs +#define sys__sysctl printargs +#define sys_sched_rr_get_interval printargs +#define sys_nanosleep printargs +#define sys_getresuid printargs +#define sys_vm86 printargs +#define sys_query_module printargs +#define sys_nfsservctl printargs +#define sys_getresgid printargs +#define sys_rt_sigreturn printargs +#define sys_rt_sigaction printargs +#define sys_rt_sigprocmask printargs +#define sys_rt_sigtimedwait printargs +#define sys_rt_sigqueueinfo printargs +#define sys_rt_sigsuspend printargs +#define sys_pread printargs +#define sys_pwrite printargs +#define sys_sigaltstack printargs +#define sys_sendfile printargs +#define sys_vfork printargs +#define sys_truncate64 printargs +#define sys_ftruncate64 printargs +#define sys_stat64 printargs +#define sys_lstat64 printargs +#define sys_fstat64 printargs +#define sys_fcntl64 printargs + +#include "../syscallent.h" + +#undef sys_getrlimit +#undef sys_afs_syscall +#undef sys_getpmsg +#undef sys_putpmsg +#undef sys_ugetrlimit +#undef sys_fork +#undef sys_waitpid +#undef sys_time +#undef sys_break +#undef sys_oldstat +#undef sys_lseek +#undef sys_stime +#undef sys_ptrace +#undef sys_alarm +#undef sys_oldfstat +#undef sys_pause +#undef sys_utime +#undef sys_stty +#undef sys_gtty +#undef sys_ftime +#undef sys_pipe +#undef sys_times +#undef sys_prof +#undef sys_signal +#undef sys_lock +#undef sys_ioctl +#undef sys_fcntl +#undef sys_mpx +#undef sys_ulimit +#undef sys_oldolduname +#undef sys_sigaction +#undef sys_sgetmask +#undef sys_ssetmask +#undef sys_sigsuspend +#undef sys_sigpending +#undef sys_setrlimit +#undef sys_getrusage +#undef sys_gettimeofday +#undef sys_settimeofday +#undef sys_getgroups +#undef sys_setgroups +#undef sys_select +#undef sys_oldlstat +#undef sys_readdir +#undef sys_profil +#undef sys_statfs +#undef sys_fstatfs +#undef sys_ioperm +#undef sys_socketcall +#undef sys_setitimer +#undef sys_getitimer +#undef sys_stat +#undef sys_lstat +#undef sys_fstat +#undef sys_olduname +#undef sys_iopl +#undef sys_idle +#undef sys_vm86old +#undef sys_wait4 +#undef sys_sysinfo +#undef sys_ipc +#undef sys_sigreturn +#undef sys_uname +#undef sys_modify_ldt +#undef sys_adjtimex +#undef sys_sigprocmask +#undef sys_create_module +#undef sys_init_module +#undef sys_delete_module +#undef sys_get_kernel_syms +#undef sys_quotactl +#undef sys_bdflush +#undef sys_personality +#undef sys_getdents +#undef sys__newselect +#undef sys_msync +#undef sys_readv +#undef sys_writev +#undef sys__sysctl +#undef sys_sched_rr_get_interval +#undef sys_nanosleep +#undef sys_getresuid +#undef sys_vm86 +#undef sys_query_module +#undef sys_nfsservctl +#undef sys_getresgid +#undef sys_rt_sigreturn +#undef sys_rt_sigaction +#undef sys_rt_sigprocmask +#undef sys_rt_sigtimedwait +#undef sys_rt_sigqueueinfo +#undef sys_rt_sigsuspend +#undef sys_pread +#undef sys_pwrite +#undef sys_sigaltstack +#undef sys_sendfile +#undef sys_vfork +#undef sys_truncate64 +#undef sys_ftruncate64 +#undef sys_stat64 +#undef sys_lstat64 +#undef sys_fstat64 +#undef sys_fcntl64 - { 4, 0, printargs, "ipc_subcall" }, /* 200 */ - { 4, TI, sys_semop, "semop" }, /* 201 */ - { 4, TI, sys_semget, "semget" }, /* 202 */ - { 4, TI, sys_semctl, "semctl" }, /* 203 */ - { 4, 0, printargs, "ipc_subcall" }, /* 204 */ - { 4, 0, printargs, "ipc_subcall" }, /* 205 */ - { 4, 0, printargs, "ipc_subcall" }, /* 206 */ - { 4, 0, printargs, "ipc_subcall" }, /* 207 */ - { 4, 0, printargs, "ipc_subcall" }, /* 208 */ - { 4, 0, printargs, "ipc_subcall" }, /* 209 */ - { 4, 0, printargs, "ipc_subcall" }, /* 210 */ - { 4, TI, sys_msgsnd, "msgsnd" }, /* 211 */ - { 4, TI, sys_msgrcv, "msgrcv" }, /* 212 */ - { 4, TI, sys_msgget, "msgget" }, /* 213 */ - { 4, TI, sys_msgctl, "msgctl" }, /* 214 */ - { 4, 0, printargs, "ipc_subcall" }, /* 215 */ - { 4, 0, printargs, "ipc_subcall" }, /* 216 */ - { 4, 0, printargs, "ipc_subcall" }, /* 217 */ - { 4, 0, printargs, "ipc_subcall" }, /* 218 */ - { 4, 0, printargs, "ipc_subcall" }, /* 219 */ - { 4, 0, printargs, "ipc_subcall" }, /* 220 */ - { 4, TI, sys_shmat, "shmat" }, /* 221 */ - { 4, TI, sys_shmdt, "shmdt" }, /* 222 */ - { 4, TI, sys_shmget, "shmget" }, /* 223 */ - { 4, TI, sys_shmctl, "shmctl" }, /* 224 */ - { 5, 0, printargs, "SYS_225" }, /* 225 */ - { 5, 0, printargs, "SYS_226" }, /* 226 */ - { 5, 0, printargs, "SYS_227" }, /* 227 */ - { 5, 0, printargs, "SYS_228" }, /* 228 */ - { 5, 0, printargs, "SYS_229" }, /* 229 */ +#include "../dummy.h" - { 8, 0, printargs, "socket_subcall"}, /* 230 */ - { 3, TN, sys_socket, "socket" }, /* 231 */ - { 3, TN, sys_bind, "bind" }, /* 232 */ - { 3, TN, sys_connect, "connect" }, /* 233 */ - { 2, TN, sys_listen, "listen" }, /* 234 */ - { 3, TN, sys_accept, "accept" }, /* 235 */ - { 3, TN, sys_getsockname, "getsockname" }, /* 236 */ - { 3, TN, sys_getpeername, "getpeername" }, /* 237 */ - { 4, TN, sys_socketpair, "socketpair" }, /* 238 */ - { 4, TN, sys_send, "send" }, /* 239 */ - { 4, TN, sys_recv, "recv" }, /* 240 */ - { 6, TN, sys_sendto, "sendto" }, /* 241 */ - { 6, TN, sys_recvfrom, "recvfrom" }, /* 242 */ - { 2, TN, sys_shutdown, "shutdown" }, /* 243 */ - { 5, TN, sys_setsockopt, "setsockopt" }, /* 244 */ - { 5, TN, sys_getsockopt, "getsockopt" }, /* 245 */ - { 5, TN, sys_sendmsg, "sendmsg" }, /* 246 */ - { 5, TN, sys_recvmsg, "recvmsg" }, /* 247 */ - { 5, 0, printargs, "SYS_248" }, /* 248 */ - { 5, 0, printargs, "SYS_249" }, /* 249 */ - { 8, 0, printargs, "SYS_250" }, /* 250 */ - { 8, 0, printargs, "SYS_251" }, /* 251 */ - { 8, 0, printargs, "SYS_252" }, /* 252 */ - { 8, 0, printargs, "SYS_253" }, /* 253 */ - { 8, 0, printargs, "SYS_254" }, /* 254 */ - { 8, 0, printargs, "SYS_255" }, /* 255 */ - { 8, 0, printargs, "SYS_256" }, /* 256 */ - { 8, 0, printargs, "SYS_257" }, /* 257 */ - { 8, 0, printargs, "SYS_258" }, /* 258 */ - { 8, 0, printargs, "SYS_259" }, /* 259 */ - { 8, 0, printargs, "SYS_260" }, /* 260 */ - { 8, 0, printargs, "SYS_261" }, /* 261 */ - { 8, 0, printargs, "SYS_262" }, /* 262 */ - { 8, 0, printargs, "SYS_263" }, /* 263 */ - { 8, 0, printargs, "SYS_264" }, /* 264 */ - { 8, 0, printargs, "SYS_265" }, /* 265 */ - { 8, 0, printargs, "SYS_266" }, /* 266 */ - { 8, 0, printargs, "SYS_267" }, /* 267 */ - { 8, 0, printargs, "SYS_268" }, /* 268 */ - { 8, 0, printargs, "SYS_269" }, /* 269 */ - { 8, 0, printargs, "SYS_270" }, /* 270 */ - { 8, 0, printargs, "SYS_271" }, /* 271 */ - { 8, 0, printargs, "SYS_272" }, /* 272 */ - { 8, 0, printargs, "SYS_273" }, /* 273 */ - { 8, 0, printargs, "SYS_274" }, /* 274 */ { 8, 0, printargs, "SYS_275" }, /* 275 */ { 8, 0, printargs, "SYS_276" }, /* 276 */ { 8, 0, printargs, "SYS_277" }, /* 277 */ @@ -1239,12 +1179,12 @@ { 2, TF, sys_pivotroot, "pivot_root" }, /* 1207 */ { 3, 0, printargs, "mincore" }, /* 1208 */ { 3, 0, sys_madvise, "madvise" }, /* 1209 */ - { 8, 0, printargs, "SYS_1210" }, /* 1210 */ - { 8, 0, printargs, "SYS_1211" }, /* 1211 */ - { 8, 0, printargs, "SYS_1212" }, /* 1212 */ - { 8, 0, printargs, "SYS_1213" }, /* 1213 */ - { 8, 0, printargs, "SYS_1214" }, /* 1214 */ - { 8, 0, printargs, "SYS_1215" }, /* 1215 */ + { 2, TF, sys_stat, "stat" }, /* 1210 */ + { 2, 0, sys_lstat, "lstat" }, /* 1211 */ + { 2, TF, sys_fstat, "fstat" }, /* 1212 */ + { 2, TP, sys_clone2, "clone2" }, /* 1213 */ + { 3, 0, printargs, "getdents64" }, /* 1214 */ + { 2, 0, printargs, "getunwind" }, /* 1215 */ { 8, 0, printargs, "SYS_1216" }, /* 1216 */ { 8, 0, printargs, "SYS_1217" }, /* 1217 */ { 8, 0, printargs, "SYS_1218" }, /* 1218 */ diff --git a/linux/ioctlent.sh b/linux/ioctlent.sh index b1aa026..b55d224 100644 --- a/linux/ioctlent.sh +++ b/linux/ioctlent.sh @@ -29,13 +29,21 @@ # dir="/usr/include" + +files="asm/ioctls.h /dev/null" +# Build the list of all ioctls +regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+0x54..\>' +(cd $dir ; grep $regexp $files 2>/dev/null ) | \ + sed -ne 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*\(0x54..\).*/ { "\1", "\2", \3 },/p' \ + > ioctls.h + files="linux/* asm/* scsi/*" # Build the list of all ioctls regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+_S\?\(IO\|IOW\|IOR\|IOWR\)\>' (cd $dir ; grep $regexp $files 2>/dev/null ) | \ sed -ne 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_S\?I.*(\([^[,]*\)[[:space:]]*,[[:space:]]*\([^,)]*\).*/ { "\1", "\2", _IOC(_IOC_NONE,\3,\4,0) },/p' \ - > ioctls.h + >> ioctls.h # Some use a special base to offset their ioctls on. Extract that as well. : > ioctldefs.h diff --git a/linux/syscall.h b/linux/syscall.h index 8efa8ae..15eb87b 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -83,6 +83,7 @@ int sys_rt_sigpending(), sys_rt_sigsuspend(), sys_rt_sigqueueinfo(); int sys_rt_sigtimedwait(), sys_prctl(), sys_poll(), sys_vfork(); int sys_sendfile(), sys_old_mmap(), sys_stat64(), sys_lstat64(), sys_fstat64(); int sys_truncate64(), sys_ftruncate64(), sys_pivotroot(); +int sys_clone2(); /* sys_socketcall subcalls */ @@ -109,7 +110,33 @@ int sys_osf_utimes(); #endif -#if !defined(ALPHA) && !defined(IA64) && !defined(MIPS) &&!defined(HPPA) +#if !defined(ALPHA) && !defined(MIPS) &&!defined(HPPA) +# ifdef IA64 +/* + * IA64 syscall numbers (the only ones available from standard header + * files) are disjoint from IA32 syscall numbers. We need to define + * the IA32 socket call number here. + */ +# define SYS_socketcall 102 + +# undef SYS_socket +# undef SYS_bind +# undef SYS_connect +# undef SYS_listen +# undef SYS_accept +# undef SYS_getsockname +# undef SYS_getpeername +# undef SYS_socketpair +# undef SYS_send +# undef SYS_recv +# undef SYS_sendto +# undef SYS_recvfrom +# undef SYS_shutdown +# undef SYS_setsockopt +# undef SYS_getsockopt +# undef SYS_sendmsg +# undef SYS_recvmsg +#endif /* IA64 */ #ifdef POWERPC # define SYS_socket_subcall 256 #else @@ -134,7 +161,7 @@ int sys_osf_utimes(); #define SYS_recvmsg (SYS_socket_subcall + 17) #define SYS_socket_nsubcalls 18 -#endif /* !(ALPHA || IA64 || MIPS || HPPA) */ +#endif /* !(ALPHA || MIPS || HPPA) */ /* sys_ipc subcalls */ @@ -142,7 +169,29 @@ int sys_semget(), sys_semctl(), sys_semop(); int sys_msgsnd(), sys_msgrcv(), sys_msgget(), sys_msgctl(); int sys_shmat(), sys_shmdt(), sys_shmget(), sys_shmctl(); -#if !defined(ALPHA) && !defined(IA64) && !defined(MIPS) && !defined(SPARC) &&!defined(HPPA) +#if !defined(ALPHA) && !defined(MIPS) && !defined(SPARC) &&!defined(HPPA) +# ifdef IA64 + /* + * IA64 syscall numbers (the only ones available from standard + * header files) are disjoint from IA32 syscall numbers. We need + * to define the IA32 socket call number here. Fortunately, this + * symbol, `SYS_ipc', is not used by any of the IA64 code so + * re-defining this symbol will not cause a problem. + */ +# undef SYS_ipc +# define SYS_ipc 117 +# undef SYS_semop +# undef SYS_semget +# undef SYS_semctl +# undef SYS_msgsnd +# undef SYS_msgrcv +# undef SYS_msgget +# undef SYS_msgctl +# undef SYS_shmat +# undef SYS_shmdt +# undef SYS_shmget +# undef SYS_shmctl +# endif /* IA64 */ #ifdef POWERPC # define SYS_ipc_subcall ((SYS_socket_subcall)+(SYS_socket_nsubcalls)) #else @@ -161,7 +210,21 @@ int sys_shmat(), sys_shmdt(), sys_shmget(), sys_shmctl(); #define SYS_shmctl (SYS_ipc_subcall + 24) #define SYS_ipc_nsubcalls 25 -#endif /* !(ALPHA || IA64 || MIPS || HPPA) */ +#endif /* !(ALPHA || MIPS || HPPA) */ + +#ifdef IA64 + /* + * IA64 syscall numbers (the only ones available from standard header + * files) are disjoint from IA32 syscall numbers. We need to define + * some IA32 specific syscalls here. + */ +# define SYS_fork 2 +# define SYS_vfork 190 +# define SYS32_exit 1 +# define SYS_waitpid 7 +# define SYS32_wait4 114 +# define SYS32_execve 11 +#endif /* IA64 */ #if defined(ALPHA) || defined(IA64) int sys_getpagesize(); @@ -457,6 +457,19 @@ struct tcb *tcp; return 0; } +int +sys_clone2(tcp) +struct tcb *tcp; +{ + if (exiting(tcp)) { + tprintf("child_stack=%#lx, stack_size=%#lx, flags=", + tcp->u_arg[1], tcp->u_arg[2]); + if (printflags(clone_flags, tcp->u_arg[0]) == 0) + tprintf("0"); + } + return 0; +} + #endif int @@ -509,6 +522,10 @@ int new; if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), new)<0) return -1; return 0; +#elif defined(IA64) + if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_R15), new)<0) + return -1; + return 0; #elif defined(HPPA) if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GR20), new)<0) return -1; @@ -534,7 +551,7 @@ setarg(tcp, argnum) ap = ia64_rse_skip_regs(bsp, argnum); errno = 0; - ptrace(PTRACE_POKEDATA, tcp->pid, ap, tcp->u_arg[argnum]); + ptrace(PTRACE_POKEDATA, tcp->pid, (char *) ap, tcp->u_arg[argnum]); if (errno) return -1; @@ -595,14 +612,16 @@ struct tcb *tcp; if (!(tcp->flags & TCB_FOLLOWFORK)) return 0; - if (bpt) - clearbpt(tcp); - - if (syserror(tcp)) + if (syserror(tcp)) { + if (bpt) + clearbpt(tcp); return 0; + } pid = tcp->u_rval; if ((tcpchild = alloctcb(pid)) == NULL) { + if (bpt) + clearbpt(tcp); fprintf(stderr, " [tcb table full]\n"); kill(pid, SIGKILL); /* XXX */ return 0; @@ -610,12 +629,17 @@ struct tcb *tcp; /* Attach to the new child */ if (ptrace(PTRACE_ATTACH, pid, (char *) 1, 0) < 0) { + if (bpt) + clearbpt(tcp); perror("PTRACE_ATTACH"); fprintf(stderr, "Too late?\n"); droptcb(tcpchild); return 0; } + if (bpt) + clearbpt(tcp); + tcpchild->flags |= TCB_ATTACHED; if (bpt) { tcpchild->flags |= TCB_BPTSET; @@ -624,6 +648,7 @@ struct tcb *tcp; sizeof tcpchild->inst); } newoutf(tcpchild); + tcpchild->parent = tcp; tcp->nchildren++; if (!qflag) fprintf(stderr, "Process %d attached\n", pid); @@ -1198,7 +1223,7 @@ struct tcb *tcp; } } #ifdef LINUX -#if defined(ALPHA) || defined(SPARC) || defined(POWERPC) || defined(HPPA) +#if defined(ALPHA) || defined(SPARC) || defined(POWERPC) || defined(IA64) || defined(HPPA) tcp->flags |= TCB_WAITEXECVE; #endif /* ALPHA || SPARC || POWERPC */ #endif /* LINUX */ @@ -167,9 +167,9 @@ rlim64_t lim; if (lim == RLIM64_INFINITY) sprintf(buf, "RLIM64_INFINITY"); else if (lim > 1024 && lim%1024 == 0) - sprintf(buf, "%lld*1024", lim/1024); + sprintf(buf, "%lld*1024", (long long) lim/1024); else - sprintf(buf, "%lld", lim); + sprintf(buf, "%lld", (long long) lim); return buf; } @@ -365,6 +365,34 @@ int nr; tprintf(signame(nr)); } +#ifdef LINUX + +static void +parse_sigset_t (const char *str, sigset_t *set) +{ + unsigned int digit; + int i; + + sigemptyset(set); + + for (i = _NSIG - 4; i >= 0; i -= 4, ++str) { + if (*str >= 'a') + digit = (*str - 'a') + 10; + else + digit = *str - '0'; + if (digit & 1) + sigaddset(set, i + 1); + if (digit & 2) + sigaddset(set, i + 2); + if (digit & 4) + sigaddset(set, i + 3); + if (digit & 8) + sigaddset(set, i + 4); + } +} + +#endif + /* * Check process TCP for the disposition of signal SIG. * Return 1 if the process would somehow manage to survive signal SIG, @@ -381,8 +409,7 @@ int sig; char buf[2048]; char *s; int i; - /* We also need to handle RT signals */ - unsigned long long signalled, blocked, ignored, caught; + sigset_t ignored, caught; #endif #ifdef SVR4 /* @@ -427,32 +454,27 @@ int sig; * Skip the extraneous fields. We need to skip * command name has any spaces in it. So be it. */ - s = strstr(buf, "SigPnd:\t"); - + s = strstr(buf, "SigIgn:\t"); if (!s) { fprintf(stderr, "/proc/pid/status format error\n"); return 1; } + parse_sigset_t(s + 8, &ignored); - while (*s && *s++ != '\t') - ; - s += sscanf(s, "%qx", &signalled); - while (*s && *s++ != '\t') - ; - s += sscanf(s, "%qx", &blocked); - while (*s && *s++ != '\t') - ; - s += sscanf(s, "%qx", &ignored); - while (*s && *s++ != '\t') - ; - s += sscanf(s, "%qx", &caught); + s = strstr(buf, "SigCgt:\t"); + if (!s) + { + fprintf(stderr, "/proc/pid/status format error\n"); + return 1; + } + parse_sigset_t(s + 8, &caught); #ifdef DEBUG - fprintf(stderr, "sigs: %08x %08x %08x %08x\n", - signalled, blocked, ignored, caught); + fprintf(stderr, "sigs: %016qx %016qx (sig=%d)\n", + *(long long *) &ignored, *(long long *) &caught, sig); #endif - if ((ignored & (1ULL << sig)) || (caught & (1ULL << sig))) + if (sigismember(&ignored, sig) || sigismember(&caught, sig)) return 1; #endif /* LINUX */ @@ -44,6 +44,10 @@ #include <grp.h> #include <string.h> +#if defined(IA64) && defined(LINUX) +# include <asm/ptrace_offsets.h> +#endif + #ifdef USE_PROCFS #include <poll.h> #endif @@ -1805,10 +1809,23 @@ trace() } if (!cflag && (qual_flags[WSTOPSIG(status)] & QUAL_SIGNAL)) { + unsigned long addr = 0, pc = 0; +#ifdef PT_GETSIGINFO +# define PSR_RI 41 + struct siginfo si; + unsigned long psr; + + upeek(pid, PT_CR_IPSR, &psr); + upeek(pid, PT_CR_IIP, &pc); + + pc += (psr >> PSR_RI) & 0x3; + ptrace(PT_GETSIGINFO, pid, 0, (long) &si); + addr = (unsigned long) si.si_addr; +#endif printleader(tcp); - tprintf("--- %s (%s) ---", + tprintf("--- %s (%s) @ %lx (%lx) ---", signame(WSTOPSIG(status)), - strsignal(WSTOPSIG(status))); + strsignal(WSTOPSIG(status)), pc, addr); printtrailer(tcp); } if ((tcp->flags & TCB_ATTACHED) && @@ -455,7 +455,7 @@ const struct subcall subcalls_table[] = { }; #endif /* FREEBSD */ -#if !(defined(LINUX) && ( defined(ALPHA) || defined(IA64) || defined(MIPS) )) +#if !(defined(LINUX) && ( defined(ALPHA) || defined(MIPS) )) const int socket_map [] = { /* SYS_SOCKET */ 97, @@ -610,6 +610,11 @@ struct tcb *tcp; internal_clone(tcp); break; #endif +#ifdef SYS_clone2 + case SYS_clone2: + internal_clone(tcp); + break; +#endif #ifdef SYS_execv case SYS_execv: #endif @@ -628,6 +633,9 @@ struct tcb *tcp; #ifdef SYS_wait4 case SYS_wait4: #endif +#ifdef SYS32_wait4 + case SYS32_wait4: +#endif #ifdef SYS_waitpid case SYS_waitpid: #endif @@ -640,6 +648,9 @@ struct tcb *tcp; #ifdef SYS_exit case SYS_exit: #endif +#ifdef SYS32_exit + case SYS32_exit: +#endif internal_exit(tcp); break; } @@ -710,13 +721,14 @@ struct tcb *tcp; if (upeek(pid, 4*ORIG_EAX, &scno) < 0) return -1; #elif defined(IA64) -#define IA64_PSR_IS ((long)1 << 34) +# define IA64_PSR_IS ((long)1 << 34) if (upeek (pid, PT_CR_IPSR, &psr) >= 0) - ia32 = (psr & IA64_PSR_IS); + ia32 = (psr & IA64_PSR_IS) != 0; if (!(tcp->flags & TCB_INSYSCALL)) { if (ia32) { - if (upeek(pid, PT_R8, &scno) < 0) + if (upeek(pid, PT_R1, &scno) < 0) /* orig eax */ return -1; + /* Check if we return from execve. */ } else { if (upeek (pid, PT_R15, &scno) < 0) return -1; @@ -728,6 +740,11 @@ struct tcb *tcp; if (upeek (pid, PT_R10, &r10) < 0) return -1; } + if (tcp->flags & TCB_WAITEXECVE) { + tcp->flags &= ~TCB_WAITEXECVE; + return 0; + } + #elif defined (ARM) { long pc; @@ -1003,6 +1020,16 @@ struct tcb *tcp; #elif defined (HPPA) if (upeek(pid, PT_GR28, &r28) < 0) return -1; +#elif defined(IA64) + if (upeek(pid, PT_R10, &r10) < 0) + return -1; + if (upeek(pid, PT_R8, &r8) < 0) + return -1; + if (ia32 && r8 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) { + if (debug) + fprintf(stderr, "stray syscall exit: r8 = %ld\n", r8); + return 0; + } #endif #endif /* LINUX */ return 1; @@ -1236,24 +1263,58 @@ struct tcb *tcp; } #elif defined (IA64) { - unsigned long *bsp, cfm, i; - - if (upeek(pid, PT_AR_BSP, (long *) &bsp) < 0) - return -1; - if (upeek(pid, PT_CFM, (long *) &cfm) < 0) - return -1; + if (!ia32) { + unsigned long *out0, *rbs_end, cfm, sof, sol, i; + /* be backwards compatible with kernel < 2.4.4... */ +# ifndef PT_RBS_END +# define PT_RBS_END PT_AR_BSP +# endif + + if (upeek(pid, PT_RBS_END, (long *) &rbs_end) < 0) + return -1; + if (upeek(pid, PT_CFM, (long *) &cfm) < 0) + return -1; - bsp = ia64_rse_skip_regs(bsp, -(cfm & 0x7f)); + sof = (cfm >> 0) & 0x7f; + sol = (cfm >> 7) & 0x7f; + out0 = ia64_rse_skip_regs(rbs_end, -sof + sol); - if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1) - tcp->u_nargs = sysent[tcp->scno].nargs; - else - tcp->u_nargs = MAX_ARGS; - for (i = 0; i < tcp->u_nargs; ++i) { - if (umoven(tcp, (unsigned long) ia64_rse_skip_regs(bsp, i), sizeof(long), - (char *) &tcp->u_arg[i]) - < 0) + if (tcp->scno >= 0 && tcp->scno < nsyscalls + && sysent[tcp->scno].nargs != -1) + tcp->u_nargs = sysent[tcp->scno].nargs; + else + tcp->u_nargs = MAX_ARGS; + for (i = 0; i < tcp->u_nargs; ++i) { + if (umoven(tcp, (unsigned long) ia64_rse_skip_regs(out0, i), + sizeof(long), (char *) &tcp->u_arg[i]) < 0) + return -1; + } + } else { + int i; + + if (/* EBX = out0 */ + upeek(pid, PT_R11, (long *) &tcp->u_arg[0]) < 0 + /* ECX = out1 */ + || upeek(pid, PT_R9, (long *) &tcp->u_arg[1]) < 0 + /* EDX = out2 */ + || upeek(pid, PT_R10, (long *) &tcp->u_arg[2]) < 0 + /* ESI = out3 */ + || upeek(pid, PT_R14, (long *) &tcp->u_arg[3]) < 0 + /* EDI = out4 */ + || upeek(pid, PT_R15, (long *) &tcp->u_arg[4]) < 0 + /* EBP = out5 */ + || upeek(pid, PT_R13, (long *) &tcp->u_arg[5]) < 0) return -1; + + for (i = 0; i < 6; ++i) + /* truncate away IVE sign-extension */ + tcp->u_arg[i] &= 0xffffffff; + + if (tcp->scno >= 0 && tcp->scno < nsyscalls + && sysent[tcp->scno].nargs != -1) + tcp->u_nargs = sysent[tcp->scno].nargs; + else + tcp->u_nargs = 5; } } #elif defined (MIPS) @@ -1604,7 +1665,7 @@ struct tcb *tcp; switch (tcp->scno + NR_SYSCALL_BASE) { #ifdef LINUX -#if !defined (ALPHA) && !defined(IA64) && !defined(SPARC) && !defined(MIPS) && !defined(HPPA) +#if !defined (ALPHA) && !defined(SPARC) && !defined(MIPS) && !defined(HPPA) case SYS_socketcall: decode_subcall(tcp, SYS_socket_subcall, SYS_socket_nsubcalls, deref_style); @@ -1613,7 +1674,7 @@ struct tcb *tcp; decode_subcall(tcp, SYS_ipc_subcall, SYS_ipc_nsubcalls, shift_style); break; -#endif /* !ALPHA && !IA64 && !MIPS && !SPARC */ +#endif /* !ALPHA && !MIPS && !SPARC */ #ifdef SPARC case SYS_socketcall: sparc_socket_decode (tcp); @@ -1676,7 +1737,7 @@ struct tcb *tcp; decode_subcall(tcp, SYS_kaio_subcall, SYS_kaio_nsubcalls, shift_style); break; -#endif +#endif #endif /* SVR4 */ #ifdef FREEBSD case SYS_msgsys: @@ -1684,7 +1745,7 @@ struct tcb *tcp; case SYS_semsys: decode_subcall(tcp, 0, 0, table_style); break; -#endif +#endif #ifdef SUNOS4 case SYS_semsys: decode_subcall(tcp, SYS_semsys_subcall, @@ -1130,16 +1130,43 @@ struct tcb *tcp; #else /* !SPARC */ #ifdef IA64 - /* - * Our strategy here is to replace the bundle that contained - * the clone() syscall with a bundle of the form: - * - * { 1: br 1b; br 1b; br 1b } - * - * This ensures that the newly forked child will loop - * endlessly until we've got a chance to attach to it. - */ - { + if (ia32) { +# define LOOP 0x0000feeb + if (tcp->flags & TCB_BPTSET) { + fprintf(stderr, "PANIC: bpt already set in pid %u\n", + tcp->pid); + return -1; + } + if (upeek(tcp->pid, PT_CR_IIP, &tcp->baddr) < 0) + return -1; + if (debug) + fprintf(stderr, "[%d] setting bpt at %lx\n", + tcp->pid, tcp->baddr); + tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, tcp->pid, + (char *) tcp->baddr, 0); + if (errno) { + perror("setbpt: ptrace(PTRACE_PEEKTEXT, ...)"); + return -1; + } + ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, LOOP); + if (errno) { + perror("setbpt: ptrace(PTRACE_POKETEXT, ...)"); + return -1; + } + tcp->flags |= TCB_BPTSET; + } else { + /* + * XXX Use break instead! + * + * Our strategy here is to replace the bundle that + * contained the clone() syscall with a bundle of the + * form: + * + * { 1: br 1b; br 1b; br 1b } + * + * This ensures that the newly forked child will loop + * endlessly until we've got a chance to attach to it. + */ # define LOOP0 0x0000100000000017 # define LOOP1 0x4000000000200000 unsigned long addr, ipsr; @@ -1150,11 +1177,14 @@ struct tcb *tcp; return -1; if (upeek(pid, PT_CR_IIP, &addr) < 0) return -1; - tcp->baddr = addr | ((ipsr >> 41) & 0x3); /* store "ri" in low two bits */ + /* store "ri" in low two bits */ + tcp->baddr = addr | ((ipsr >> 41) & 0x3); errno = 0; - tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, pid, (char *) addr + 0, 0); - tcp->inst[1] = ptrace(PTRACE_PEEKTEXT, pid, (char *) addr + 8, 0); + tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, pid, (char *) addr + 0, + 0); + tcp->inst[1] = ptrace(PTRACE_PEEKTEXT, pid, (char *) addr + 8, + 0); if (errno) { perror("setbpt: ptrace(PTRACE_PEEKTEXT, ...)"); return -1; @@ -1322,7 +1352,34 @@ struct tcb *tcp; } tcp->flags &= ~TCB_BPTSET; #elif defined(IA64) - { + if (ia32) { + unsigned long addr; + + if (debug) + fprintf(stderr, "[%d] clearing bpt\n", tcp->pid); + if (!(tcp->flags & TCB_BPTSET)) { + fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid); + return -1; + } + errno = 0; + ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, tcp->inst[0]); + if (errno) { + perror("clearbtp: ptrace(PTRACE_POKETEXT, ...)"); + return -1; + } + tcp->flags &= ~TCB_BPTSET; + + if (upeek(tcp->pid, PT_CR_IIP, &addr) < 0) + return -1; + if (addr != tcp->baddr) { + /* The breakpoint has not been reached yet. */ + if (debug) + fprintf(stderr, + "NOTE: PC not at bpt (pc %#lx baddr %#lx)\n", + addr, tcp->baddr); + return 0; + } + } else { unsigned long addr, ipsr; pid_t pid; |