Bring in the MODULE_DEPEND() and DECLARE_MODULE() macros from FreeBSD-5.x.
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 14 Nov 2003 00:37:24 +0000 (00:37 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 14 Nov 2003 00:37:24 +0000 (00:37 +0000)
commit6456e0adb7bb50557b763fc4a9752b79198d9362
treefeaac571e788aed0dd1cc5488a896fab8f2e3b24
parenta3d82f10e047aea581489f980cbfb6c2b353420e
Bring in the MODULE_DEPEND() and DECLARE_MODULE() macros from FreeBSD-5.x.
Instead of trying to bring in the 5.x kern/kern_loader.c and related code,
which is a huge complex mess, instead properly declare the miibus module
and check preload files against static in-kernel modules and ignore any
preloaded modules that arleady exist in-kernel based on DECLARE_MODULE()
matching up.

This solves a problem where the bootloader attempts to load module
dependancies along with their modules (e.g. if if_fxp is loaded then miibus
is also loaded).  If the kernel already had a miibus module built in this
resulted in two miibus modules which resulted in a crash.
sys/dev/netif/mii_layer/mii.c
sys/kern/kern_linker.c
sys/sys/module.h