mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-12 14:29:28 +00:00
Add necessary awk magic to create a table of major numbers allocated
in conf/majors so we can avoid autoallocating them in the kernel.
This commit is contained in:
parent
b89bc9e62b
commit
76d6aef572
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111606
@ -72,7 +72,7 @@ tlphy.o xmphy.o: miidevs.h
|
||||
kernel-clean:
|
||||
rm -f *.o *.so *.So *.ko *.s eddep errs \
|
||||
${FULLKERNEL} ${KERNEL_KO} linterrs makelinks tags \
|
||||
vers.c vnode_if.c vnode_if.h \
|
||||
vers.c vnode_if.c vnode_if.h majors.c \
|
||||
${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \
|
||||
${CLEAN}
|
||||
|
||||
@ -215,4 +215,10 @@ vnode_if.h: $S/tools/vnode_if.awk $S/kern/vnode_if.src
|
||||
vnode_if.o:
|
||||
${NORMAL_C}
|
||||
|
||||
majors.c: $S/conf/majors $S/conf/majors.awk
|
||||
${AWK} -f $S/conf/majors.awk $S/conf/majors > majors.c
|
||||
|
||||
majors.o:
|
||||
${NORMAL_C}
|
||||
|
||||
.include <bsd.kern.mk>
|
||||
|
@ -67,6 +67,7 @@ SYSTEM_CFILES= vnode_if.c hints.c env.c config.c
|
||||
SYSTEM_SFILES= $S/$M/$M/locore.s
|
||||
SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
|
||||
SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} hints.o env.o config.o hack.So
|
||||
SYSTEM_OBJS+= majors.o
|
||||
SYSTEM_LD= @${LD} ${FMT} -Bdynamic -T $S/conf/ldscript.$M \
|
||||
-warn-common -export-dynamic -dynamic-linker /red/herring \
|
||||
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
|
||||
|
21
sys/conf/majors.awk
Normal file
21
sys/conf/majors.awk
Normal file
@ -0,0 +1,21 @@
|
||||
# $FreeBSD$
|
||||
/^#/ { next }
|
||||
NF == 1 { next }
|
||||
$2 == "??" { next }
|
||||
$2 == "lkm" { next }
|
||||
{
|
||||
a[$1] = $1;
|
||||
}
|
||||
END {
|
||||
print "unsigned char reserved_majors[256] = {"
|
||||
for (i = 0; i < 256; i += 16) {
|
||||
for (j = 0; j < 16; j++) {
|
||||
printf("%3d", a[i + j]);
|
||||
if (i + j != 255)
|
||||
printf(",");
|
||||
}
|
||||
print ""
|
||||
}
|
||||
print "};"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user