summaryrefslogtreecommitdiffstats
path: root/sys/conf/kmod.mk
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2006-01-29 02:52:42 +0000
committermlaier <mlaier@FreeBSD.org>2006-01-29 02:52:42 +0000
commit719dd1ebedeb2f04bd317ac98154ff85e297f01b (patch)
tree079b229b1f501b3c6590ffcfca8239fa263fc270 /sys/conf/kmod.mk
parent00e2fdfae252b26e637665a0b930e2f81cd28d04 (diff)
downloadFreeBSD-src-719dd1ebedeb2f04bd317ac98154ff85e297f01b.zip
FreeBSD-src-719dd1ebedeb2f04bd317ac98154ff85e297f01b.tar.gz
firmware(9) is a subsystem to load binary data into the kernel via a
specially crafted module. There are several handrolled sollutions to this problem in the tree already which will be replaced with this. They include iwi(4), ipw(4), ispfw(4) and digi(4). No objection from: arch MFC after: 2 weeks X-MFC after: some drivers have been converted
Diffstat (limited to 'sys/conf/kmod.mk')
-rw-r--r--sys/conf/kmod.mk28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 90b79d8..5f90d0b 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -36,6 +36,8 @@
#
# SRCS List of source files.
#
+# FIRMWS List of firmware images in format filename:shortname:version
+#
# DESTDIR The tree where the module gets installed. [not set]
#
# +++ targets +++
@@ -119,6 +121,32 @@ CFLAGS+= -fno-omit-frame-pointer
CFLAGS+= -mlongcall -fno-omit-frame-pointer
.endif
+.if defined(FIRMWS)
+.if !exists(@)
+${KMOD:S/$/.c/}: @
+.else
+${KMOD:S/$/.c/}: @/tools/fw_stub.awk
+.endif
+ ${AWK} -f @/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g}
+
+SRCS+= ${KMOD:S/$/.c/}
+CLEANFILES+= ${KMOD:S/$/.c/}
+
+.for _firmw in ${FIRMWS}
+${_firmw:C/\:.*$/.fwo/}: ${_firmw:C/\:.*$//}
+ @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}}
+.if !exists(${.CURDIR}/${_firmw:C/\:.*$//})
+ ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}
+ ${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}
+ rm -f ${_firmw:C/\:.*$//}
+.else
+ ${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}
+.endif
+
+OBJS+= ${_firmw:C/\:.*$/.fwo/}
+.endfor
+.endif
+
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
.if !defined(PROG)
OpenPOWER on IntegriCloud