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

This commit is contained in:
Marcel Moolenaar 1999-12-23 19:59:47 +00:00
parent a6b91b497b
commit 00d6d49adc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55062
3 changed files with 13 additions and 44 deletions

View File

@ -1,24 +1,11 @@
/* $FreeBSD$ */
#include <sys/assym.h>
#include <sys/param.h>
#include <i386/linux/linux.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\tLINUX_SIGF_HANDLER %u\n",
OS(linux_sigframe, sf_handler));
printf("#define\tLINUX_SIGF_SC %u\n", OS(linux_sigframe, sf_sc));
printf("#define\tLINUX_SC_GS %u\n", OS(linux_sigcontext, sc_gs));
printf("#define\tLINUX_SC_EFLAGS %u\n",
OS(linux_sigcontext, sc_eflags));
return (0);
}
ASSYM(LINUX_SIGF_HANDLER, offsetof(linux_sigframe, sf_handler));
ASSYM(LINUX_SIGF_SC, offsetof(linux_sigframe, sf_sc));
ASSYM(LINUX_SC_GS, offsetof(linux_sigcontext, sc_gs));
ASSYM(LINUX_SC_EFLAGS, offsetof(linux_sigcontext, sc_eflags));

View File

@ -1,24 +1,11 @@
/* $FreeBSD$ */
#include <sys/assym.h>
#include <sys/param.h>
#include <i386/linux/linux.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\tLINUX_SIGF_HANDLER %u\n",
OS(linux_sigframe, sf_handler));
printf("#define\tLINUX_SIGF_SC %u\n", OS(linux_sigframe, sf_sc));
printf("#define\tLINUX_SC_GS %u\n", OS(linux_sigcontext, sc_gs));
printf("#define\tLINUX_SC_EFLAGS %u\n",
OS(linux_sigcontext, sc_eflags));
return (0);
}
ASSYM(LINUX_SIGF_HANDLER, offsetof(linux_sigframe, sf_handler));
ASSYM(LINUX_SIGF_SC, offsetof(linux_sigframe, sf_sc));
ASSYM(LINUX_SC_GS, offsetof(linux_sigcontext, sc_gs));
ASSYM(LINUX_SC_EFLAGS, offsetof(linux_sigcontext, sc_eflags));

View File

@ -14,12 +14,10 @@ MAN8= linux.8
# CFLAGS+= -DDEBUG
EXPORT_SYMS=_linux_mod
CLEANFILES= linux_assym.h linux_genassym linux_genassym.o
CLEANFILES= linux_assym.h linux_genassym.o
build-tools: linux_genassym
linux_assym.h: linux_genassym
./linux_genassym > linux_assym.h
linux_assym.h: linux_genassym.o
genassym -o ${.TARGET} ${.ALLSRC}
linux_locore.o: linux_locore.s linux_assym.h
${CC} -c -x assembler-with-cpp -DLOCORE -DKERNEL ${CFLAGS} \
@ -28,9 +26,6 @@ linux_locore.o: linux_locore.s linux_assym.h
linux_genassym.o: linux_genassym.c linux.h @ machine
${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC}
linux_genassym: linux_genassym.o
${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
opt_compat.h:
echo "#define COMPAT_43 1" > opt_compat.h