summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/alpha/linux/linux_genassym.c23
-rw-r--r--sys/i386/linux/linux_genassym.c23
-rw-r--r--sys/modules/linux/Makefile11
3 files changed, 13 insertions, 44 deletions
diff --git a/sys/alpha/linux/linux_genassym.c b/sys/alpha/linux/linux_genassym.c
index 5d962a6..b555486 100644
--- a/sys/alpha/linux/linux_genassym.c
+++ b/sys/alpha/linux/linux_genassym.c
@@ -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));
diff --git a/sys/i386/linux/linux_genassym.c b/sys/i386/linux/linux_genassym.c
index 5d962a6..b555486 100644
--- a/sys/i386/linux/linux_genassym.c
+++ b/sys/i386/linux/linux_genassym.c
@@ -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));
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index 7c5a53e..1e7a5ce 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -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
OpenPOWER on IntegriCloud