summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-08-25 19:48:10 +0000
committerpeter <peter@FreeBSD.org>2000-08-25 19:48:10 +0000
commit7aed3c0e519d7d5b46d52d8afd808adedd040bfc (patch)
treed1cf974ca3ddb608cb7fafb05352467d1180b8ef /sys/kern/subr_bus.c
parent05f5722996e56400bf60b8832a0fbe52f93b9fd8 (diff)
downloadFreeBSD-src-7aed3c0e519d7d5b46d52d8afd808adedd040bfc.zip
FreeBSD-src-7aed3c0e519d7d5b46d52d8afd808adedd040bfc.tar.gz
If the config program found a hints file and included it as a fallback,
then treat it as such. This isn't perfect, but should do for things like GENERIC. When in fallback mode, they will be used if there are NO other hints.
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r--sys/kern/subr_bus.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index e5d83215..3f3082d 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -99,6 +99,7 @@ static void device_unregister_oids(device_t dev);
#endif
extern char static_hints[];
+extern int hintmode;
static int hints_loaded;
kobj_method_t null_methods[] = {
@@ -1587,8 +1588,6 @@ hint_load(char *cp)
len = ep - cp;
if (*ep == '=')
ep++;
- if (strncmp(cp, "hint.", 5) != 0)
- return;
walker = cp;
walker += 5;
op = walker;
@@ -1642,18 +1641,37 @@ hints_load(void *dummy __unused)
{
char *cp;
- cp = static_hints;
- while (cp) {
- hint_load(cp);
- while (*cp != '\0')
+ if (hintmode == 2) { /* default hints only */
+ cp = kern_envp;
+ while (cp) {
+ if (strncmp(cp, "hint.", 5) == 0) {
+ /* ok, we found a hint, ignore these defaults */
+ hintmode = 0;
+ break;
+ }
+ while (*cp != '\0')
+ cp++;
cp++;
- cp++;
- if (*cp == '\0')
- break;
+ if (*cp == '\0')
+ break;
+ }
+ }
+ if (hintmode != 0) {
+ cp = static_hints;
+ while (cp) {
+ if (strncmp(cp, "hint.", 5) == 0)
+ hint_load(cp);
+ while (*cp != '\0')
+ cp++;
+ cp++;
+ if (*cp == '\0')
+ break;
+ }
}
cp = kern_envp;
while (cp) {
- hint_load(cp);
+ if (strncmp(cp, "hint.", 5) == 0)
+ hint_load(cp);
while (*cp != '\0')
cp++;
cp++;
OpenPOWER on IntegriCloud