diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-08-28 15:04:53 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-08-28 15:04:53 +0000 |
commit | 7ce28b7066d5299134f831d522470bcecba74fce (patch) | |
tree | 48159755ed56c871fcb86434177d84535c9443f0 | |
parent | 02bb2a078e660547225bc1483d9f7c6905f38360 (diff) | |
download | FreeBSD-src-7ce28b7066d5299134f831d522470bcecba74fce.zip FreeBSD-src-7ce28b7066d5299134f831d522470bcecba74fce.tar.gz |
Fix breakage introduced in r211725 and improve functionality of truss on
64-bit powerpc by adding 32-bit compatibility features.
-rw-r--r-- | usr.bin/truss/Makefile | 20 | ||||
-rw-r--r-- | usr.bin/truss/extern.h | 2 | ||||
-rw-r--r-- | usr.bin/truss/main.c | 3 | ||||
-rw-r--r-- | usr.bin/truss/powerpc-fbsd.c | 5 | ||||
-rw-r--r-- | usr.bin/truss/powerpc64-fbsd.c | 4 |
5 files changed, 31 insertions, 3 deletions
diff --git a/usr.bin/truss/Makefile b/usr.bin/truss/Makefile index ca0ce92..f80ac03 100644 --- a/usr.bin/truss/Makefile +++ b/usr.bin/truss/Makefile @@ -2,7 +2,13 @@ NO_WERROR= PROG= truss -SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c ${MACHINE_CPUARCH}-fbsd.c +SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c + +.if exists(${.CURDIR}/${MACHINE_ARCH}-fbsd.c) +SRCS+= ${MACHINE_ARCH}-fbsd.c +.else +SRCS+= ${MACHINE_CPUARCH}-fbsd.c +.endif CFLAGS+= -I${.CURDIR} -I. CLEANFILES= syscalls.master syscalls.h ioctl.c @@ -53,4 +59,16 @@ freebsd32_syscalls.h: fbsd32-syscalls.master ${.CURDIR}/fbsd32.conf .endif +.if ${MACHINE_ARCH} == "powerpc64" +SRCS+= powerpc-fbsd.c freebsd32_syscalls.h +CLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h + +fbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master + cat ${.ALLSRC} > ${.TARGET} + +freebsd32_syscalls.h: fbsd32-syscalls.master + /bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \ + ${.CURDIR}/fbsd32.conf +.endif + .include <bsd.prog.mk> diff --git a/usr.bin/truss/extern.h b/usr.bin/truss/extern.h index 322e291..e3ffc4f 100644 --- a/usr.bin/truss/extern.h +++ b/usr.bin/truss/extern.h @@ -58,6 +58,8 @@ extern long ia64_syscall_exit(struct trussinfo *, int); #ifdef __powerpc__ extern void powerpc_syscall_entry(struct trussinfo *, int); extern long powerpc_syscall_exit(struct trussinfo *, int); +extern void powerpc64_syscall_entry(struct trussinfo *, int); +extern long powerpc64_syscall_exit(struct trussinfo *, int); #endif #ifdef __sparc64__ extern void sparc64_syscall_entry(struct trussinfo *, int); diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index 5c7da1d..b9dcfe4 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -97,6 +97,9 @@ struct ex_types { #ifdef __powerpc__ { "FreeBSD ELF", powerpc_syscall_entry, powerpc_syscall_exit }, { "FreeBSD ELF32", powerpc_syscall_entry, powerpc_syscall_exit }, +#ifdef __powerpc64__ + { "FreeBSD ELF64", powerpc64_syscall_entry, powerpc64_syscall_exit }, +#endif #endif #ifdef __sparc64__ { "FreeBSD ELF64", sparc64_syscall_entry, sparc64_syscall_exit }, diff --git a/usr.bin/truss/powerpc-fbsd.c b/usr.bin/truss/powerpc-fbsd.c index ab5b9a4..d2c1db8 100644 --- a/usr.bin/truss/powerpc-fbsd.c +++ b/usr.bin/truss/powerpc-fbsd.c @@ -63,7 +63,12 @@ static const char rcsid[] = static int cpid = -1; +#ifdef __powerpc64__ /* 32-bit compatibility */ +#include "freebsd32_syscalls.h" +#define syscallnames freebsd32_syscallnames +#else /* native 32-bit */ #include "syscalls.h" +#endif static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); diff --git a/usr.bin/truss/powerpc64-fbsd.c b/usr.bin/truss/powerpc64-fbsd.c index a929d0f..ffa34f2 100644 --- a/usr.bin/truss/powerpc64-fbsd.c +++ b/usr.bin/truss/powerpc64-fbsd.c @@ -109,7 +109,7 @@ clear_fsc(void) { */ void -powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) { +powerpc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { char buf[32]; struct reg regs; void *args; @@ -254,7 +254,7 @@ powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) { */ long -powerpc_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) +powerpc64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { struct reg regs; long retval; |