Use genassym(1) and <sys/assym.h> to generate assembler symbols.

This commit is contained in:
Marcel Moolenaar 1999-12-23 21:19:32 +00:00
parent 00d6d49adc
commit 7ce77f279b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55063
2 changed files with 9 additions and 28 deletions

View file

@ -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]));

View file

@ -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