Date: Fri, 16 Sep 2011 18:26:40 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r225625 - stable/8/sys/sys Message-ID: <201109161826.p8GIQeGS033378@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Fri Sep 16 18:26:40 2011 New Revision: 225625 URL: http://svn.freebsd.org/changeset/base/225625 Log: MFC 225079: Add two new macros DRIVER_MODULE_ORDERED() and EARLY_DRIVER_MODULE_ORDERED() that allow a module to use an order other than the default of SI_ORDER_MIDDLE when registering a driver. This can be useful for drivers in a kld that contain multiple new-bus drivers as part of one logical device driver. A typical case would be to use SI_ORDER_LAST for the "main" driver to ensure that any other "helper" drivers are registered and available before the "main" driver attempts to attach. Modified: stable/8/sys/sys/bus.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/bus.h ============================================================================== --- stable/8/sys/sys/bus.h Fri Sep 16 18:23:39 2011 (r225624) +++ stable/8/sys/sys/bus.h Fri Sep 16 18:26:40 2011 (r225625) @@ -575,7 +575,8 @@ struct driver_module_data { int dmd_pass; }; -#define EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, pass) \ +#define EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \ + evh, arg, order, pass) \ \ static struct driver_module_data name##_##busname##_driver_mod = { \ evh, arg, \ @@ -591,7 +592,16 @@ static moduledata_t name##_##busname##_m &name##_##busname##_driver_mod \ }; \ DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \ - SI_SUB_DRIVERS, SI_ORDER_MIDDLE) + SI_SUB_DRIVERS, order) + +#define EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, pass) \ + EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \ + evh, arg, SI_ORDER_MIDDLE, pass) + +#define DRIVER_MODULE_ORDERED(name, busname, driver, devclass, evh, arg,\ + order) \ + EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \ + evh, arg, order, BUS_PASS_DEFAULT) #define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \ EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109161826.p8GIQeGS033378>