summaryrefslogtreecommitdiff
path: root/sys/modules
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2011-06-15 09:45:58 +0000
committermrg <mrg@NetBSD.org>2011-06-15 09:45:58 +0000
commit8aad71ac61bb47d1665f0fd370fd020b0db6293c (patch)
tree8c842c7447366c785311930c89be2472e8a13c32 /sys/modules
parent2b261ed0afad18cb44a1fee3bddb66a5179caceb (diff)
build evbppc modules in 3 different flavours:
- oea (default) - ibm4xx - booke this, together with earlier machine_module[] work, should allow evbppc platforms to use modules.
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/Makefile6
-rw-r--r--sys/modules/arch/Makefile17
-rw-r--r--sys/modules/arch/archdirs.mk12
-rw-r--r--sys/modules/arch/compatsubdir.mk30
-rw-r--r--sys/modules/arch/dirshack/Makefile30
-rw-r--r--sys/modules/arch/powerpc/powerpc-4xx/Makefile5
-rw-r--r--sys/modules/arch/powerpc/powerpc-4xx/bsd.powerpc-4xx.mk17
-rw-r--r--sys/modules/arch/powerpc/powerpc-booke/Makefile5
-rw-r--r--sys/modules/arch/powerpc/powerpc-booke/bsd.powerpc-booke.mk19
9 files changed, 140 insertions, 1 deletions
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 55556cfcb45..281a054e5aa 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.72 2011/06/15 08:19:43 jruoho Exp $
+# $NetBSD: Makefile,v 1.73 2011/06/15 09:45:59 mrg Exp $
.include <bsd.own.mk>
@@ -190,4 +190,8 @@ SUBDIR+= solaris
SUBDIR+= zfs
.endif
+.if (${MKCOMPATMODULES} != "no")
+SUBDIR+= arch
+.endif
+
.include <bsd.subdir.mk>
diff --git a/sys/modules/arch/Makefile b/sys/modules/arch/Makefile
new file mode 100644
index 00000000000..5607bd98e0f
--- /dev/null
+++ b/sys/modules/arch/Makefile
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+# Build multi-abi kernel modules
+
+.include <bsd.own.mk>
+
+.if ${MKCOMPATMODULES} != "no"
+.if !make(includes)
+
+.include "archdirs.mk"
+
+SUBDIR= dirshack .WAIT ${ARCHDIR_SUBDIR}
+
+.endif
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/arch/archdirs.mk b/sys/modules/arch/archdirs.mk
new file mode 100644
index 00000000000..ee785817fa7
--- /dev/null
+++ b/sys/modules/arch/archdirs.mk
@@ -0,0 +1,12 @@
+# $NetBSD: archdirs.mk,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+# list of subdirs used per-platform
+
+.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
+# not yet
+#ARCHDIR_SUBDIR= x86/x86-xen
+.endif
+
+.if ${MACHINE_ARCH} == "powerpc"
+ARCHDIR_SUBDIR= powerpc/powerpc-4xx powerpc/powerpc-booke
+.endif
diff --git a/sys/modules/arch/compatsubdir.mk b/sys/modules/arch/compatsubdir.mk
new file mode 100644
index 00000000000..84135f6d952
--- /dev/null
+++ b/sys/modules/arch/compatsubdir.mk
@@ -0,0 +1,30 @@
+# $NetBSD: compatsubdir.mk,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+# Build netbsd kernel modules.
+
+.include <bsd.own.mk>
+
+.if ${MKCOMPATMODULES} != "no"
+.if !make(includes)
+
+# make sure we get an objdir built early enough
+.include <bsd.prog.mk>
+
+MAKEDIRTARGETENV=
+.if defined(MAKEOBJDIRPREFIX)
+MAKEDIRTARGETENV+= unset MAKEOBJDIRPREFIX &&
+.endif
+MAKEDIRTARGETENV+= MAKEOBJDIR='$${.CURDIR:C,^${NETBSDSRCDIR},${.OBJDIR},}'
+MAKEDIRTARGETENV+= MKOBJDIRS=yes MKSHARE=no
+MAKEDIRTARGETENV+= BSD_MK_COMPAT_FILE=${BSD_MK_COMPAT_FILE} MKCOMPATMODULES=no
+
+.if defined(BOOTSTRAP_SUBDIRS)
+SUBDIR= ${BOOTSTRAP_SUBDIRS}
+.else
+SUBDIR= ../../../../modules
+.endif
+
+.include <bsd.subdir.mk>
+
+.endif
+.endif
diff --git a/sys/modules/arch/dirshack/Makefile b/sys/modules/arch/dirshack/Makefile
new file mode 100644
index 00000000000..a976c66f165
--- /dev/null
+++ b/sys/modules/arch/dirshack/Makefile
@@ -0,0 +1,30 @@
+# $NetBSD: Makefile,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+# hacky method to get compat multilib base objdirs created before
+# make tries to go create the subdirs used for builds.
+
+# the problem is that make handles objdir creation for subdirs before it
+# handles this current directory, so when make cd's into $arch/$libtype
+# and from there into the ../../lib dirs, it ends up setting the forced
+# MAKEOBJDIR to something based upon ${.CURDIR}, since the objdir
+# doesn't exist yet.
+#
+# our solution is simple - from this Makefile we traverse the same list
+# of $arch/$libtype's with "BOOTSTRAP_SUBDIR=". then the compat/Makefile
+# handles these subdirs as normal, with the base objdir created.
+
+.include <bsd.own.mk>
+
+.if ${MKCOMPATMODULES} != "no"
+.if make(obj)
+
+.include "../archdirs.mk"
+
+MAKEDIRTARGETENV= BOOTSTRAP_SUBDIRS=
+
+SUBDIR= ${ARCHDIR_SUBDIR:C/^/..\//}
+
+.endif # make(obj)
+.endif # MKCOMPATMODULES != no
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/arch/powerpc/powerpc-4xx/Makefile b/sys/modules/arch/powerpc/powerpc-4xx/Makefile
new file mode 100644
index 00000000000..c1d1d5c0ad8
--- /dev/null
+++ b/sys/modules/arch/powerpc/powerpc-4xx/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+BSD_MK_COMPAT_FILE=${.CURDIR}/bsd.powerpc-4xx.mk
+
+.include "../../compatsubdir.mk"
diff --git a/sys/modules/arch/powerpc/powerpc-4xx/bsd.powerpc-4xx.mk b/sys/modules/arch/powerpc/powerpc-4xx/bsd.powerpc-4xx.mk
new file mode 100644
index 00000000000..ec8785cc6b0
--- /dev/null
+++ b/sys/modules/arch/powerpc/powerpc-4xx/bsd.powerpc-4xx.mk
@@ -0,0 +1,17 @@
+# $NetBSD: bsd.powerpc-4xx.mk,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+.ifndef _BSD_POWERPC_4XX_MK_
+_BSD_POWERPC_4XX_MK_=1
+
+KMODULEARCHDIR:= powerpc-4xx
+
+CPPFLAGS+= -mcpu=403
+PPC_IBM4XX= 1
+
+# hack into bsd.kmodule.mk
+PPC_INTR_IMPL=\"powerpc/ibm4xx/ibm4xx_intr.h\"
+PPC_PCI_MACHDEP_IMPL=\"powerpc/ibm4xx/pci_machdep.h\"
+
+AFLAGS+= -mcpu=403
+
+.endif # _BSD_POWERPC_4XX_MK_
diff --git a/sys/modules/arch/powerpc/powerpc-booke/Makefile b/sys/modules/arch/powerpc/powerpc-booke/Makefile
new file mode 100644
index 00000000000..2615d1b158b
--- /dev/null
+++ b/sys/modules/arch/powerpc/powerpc-booke/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+BSD_MK_COMPAT_FILE=${.CURDIR}/bsd.powerpc-booke.mk
+
+.include "../../compatsubdir.mk"
diff --git a/sys/modules/arch/powerpc/powerpc-booke/bsd.powerpc-booke.mk b/sys/modules/arch/powerpc/powerpc-booke/bsd.powerpc-booke.mk
new file mode 100644
index 00000000000..fe9f0e4f4c1
--- /dev/null
+++ b/sys/modules/arch/powerpc/powerpc-booke/bsd.powerpc-booke.mk
@@ -0,0 +1,19 @@
+# $NetBSD: bsd.powerpc-booke.mk,v 1.1 2011/06/15 09:45:59 mrg Exp $
+
+.ifndef _BSD_POWERPC_BOOKE_MK_
+_BSD_POWERPC_BOOKE_MK_=1
+
+KMODULEARCHDIR:= powerpc-booke
+
+# gcc emits bad code with these options
+#CPPFLAGS+= -mcpu=8548
+CPPFLAGS+= -mmultiple -mno-string -misel -Wa,-me500
+PPC_BOOKE= 1
+
+# hack into bsd.kmodule.mk
+PPC_INTR_IMPL=\"powerpc/booke/intr.h\"
+PPC_PCI_MACHDEP_IMPL=\"powerpc/pci_machdep.h\"
+
+AFLAGS+= -Wa,-me500
+
+.endif # _BSD_POWERPC_BOOKE_MK_