diff options
author | marcel <marcel@FreeBSD.org> | 1999-12-23 21:19:32 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-12-23 21:19:32 +0000 |
commit | 882af3f7d624b584435ae6c9e32598b425fcbf79 (patch) | |
tree | 25f29839a9b35b9dc91884d463f66a8abf0ced71 /sys | |
parent | 95103d131256d6e42c877c35c6f106d54703473c (diff) | |
download | FreeBSD-src-882af3f7d624b584435ae6c9e32598b425fcbf79.zip FreeBSD-src-882af3f7d624b584435ae6c9e32598b425fcbf79.tar.gz |
Use genassym(1) and <sys/assym.h> to generate assembler symbols.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/svr4/svr4_genassym.c | 26 | ||||
-rw-r--r-- | 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 41583f5..7f2c3b6 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 <sys/assym.h> #include <sys/param.h> struct proc; @@ -14,23 +15,8 @@ struct proc; #define SVR4_MACHDEP_JUST_REGS #include <i386/svr4/svr4_machdep.h> -#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 eb1ef57..6c048c7 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 |