From 7ce77f279b37aa1365a9be4e29c847c6ff68ddf4 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Thu, 23 Dec 1999 21:19:32 +0000 Subject: [PATCH] Use genassym(1) and to generate assembler symbols. --- sys/i386/svr4/svr4_genassym.c | 26 ++++++-------------------- sys/modules/svr4/Makefile | 11 +++-------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/sys/i386/svr4/svr4_genassym.c b/sys/i386/svr4/svr4_genassym.c index 41583f5896ca..7f2c3b6cfdeb 100644 --- a/sys/i386/svr4/svr4_genassym.c +++ b/sys/i386/svr4/svr4_genassym.c @@ -1,6 +1,7 @@ /* $FreeBSD$ */ /* Derived from: Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */ +#include #include struct proc; @@ -14,23 +15,8 @@ struct proc; #define SVR4_MACHDEP_JUST_REGS #include -#define offsetof(type, member) ((size_t)(&((type *)0)->member)) -#define OS(s, m) ((u_int)offsetof(struct s, m)) - -int main __P((void)); -int printf __P((const char *, ...)); - -int -main() -{ - printf("#define\tSVR4_SIGF_HANDLER %u\n", - OS(svr4_sigframe, sf_handler)); - printf("#define\tSVR4_SIGF_UC %u\n", OS(svr4_sigframe, sf_uc)); - printf("#define\tSVR4_UC_FS %u\n", - OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])); - printf("#define\tSVR4_UC_GS %u\n", - OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])); - printf("#define\tSVR4_UC_EFLAGS %u\n", - OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])); - return (0); -} +ASSYM(SVR4_SIGF_HANDLER, offsetof(svr4_sigframe, sf_handler)); +ASSYM(SVR4_SIGF_UC, offsetof(svr4_sigframe, sf_uc)); +ASSYM(SVR4_UC_FS, offsetof(svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])); +ASSYM(SVR4_UC_GS, offsetof(svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])); +ASSYM(SVR4_UC_EFLAGS, offsetof(svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])); diff --git a/sys/modules/svr4/Makefile b/sys/modules/svr4/Makefile index eb1ef57e6fdf..6c048c7b1077 100644 --- a/sys/modules/svr4/Makefile +++ b/sys/modules/svr4/Makefile @@ -14,14 +14,12 @@ CFLAGS+= -DKERNEL MAINTAINER= newton@freebsd.org EXPORT_SYMS=_svr4_mod -CLEANFILES= svr4_assym.h svr4_genassym svr4_genassym.o opt_svr4.h - -build-tools: svr4_genassym +CLEANFILES= svr4_assym.h svr4_genassym.o opt_svr4.h svr4.h: opt_global.h opt_svr4.h -svr4_assym.h: svr4_genassym - ./svr4_genassym > svr4_assym.h +svr4_assym.h: svr4_genassym.o + genassym -o ${.TARGET} ${.ALLSRC} svr4_locore.o: svr4_locore.s svr4_assym.h ${CC} -c -x assembler-with-cpp -DLOCORE -DKERNEL ${CFLAGS} \ @@ -30,9 +28,6 @@ svr4_locore.o: svr4_locore.s svr4_assym.h svr4_genassym.o: svr4_genassym.c svr4.h @ machine ${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC} -svr4_genassym: svr4_genassym.o - ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} - opt_compat.h: echo "#define COMPAT_43 1" > opt_compat.h