summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-06 08:24:53 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-11 10:08:04 +0100
commitd328ca274a251d0fb5deab5b32b87f9db4c134b9 (patch)
tree2300fc96bc5c4be812450b3818b1c548812d2974
parentcd48afc2ea9f9f2fa62c8a3733c8af25eb0d6029 (diff)
downloadrtems-libbsd-d328ca274a251d0fb5deab5b32b87f9db4c134b9.tar.bz2
DEVICE.HINTS(5): Use static hints only
-rw-r--r--freebsd/sys/kern/subr_hints.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/freebsd/sys/kern/subr_hints.c b/freebsd/sys/kern/subr_hints.c
index 36133218..68725bde 100644
--- a/freebsd/sys/kern/subr_hints.c
+++ b/freebsd/sys/kern/subr_hints.c
@@ -39,11 +39,16 @@ __FBSDID("$FreeBSD$");
* Access functions for device resources.
*/
+#ifndef __rtems__
static int checkmethod = 1;
static int use_kenv;
static char *hintp;
-#ifdef __rtems__
-int hintmode = 1; /* always use static_hints */
+#else /* __rtems__ */
+#define hintmode 1
+#define hintp static_hints
+#define use_kenv 0
+static char __used default_static_hints[] = "";
+__weak_reference(default_static_hints, static_hints);
#endif /* __rtems__ */
/*
@@ -65,6 +70,7 @@ res_find(int *line, int *startln,
const char *s, *cp;
char *p;
+#ifndef __rtems__
if (checkmethod) {
hintp = NULL;
@@ -127,6 +133,7 @@ res_find(int *line, int *startln,
return (ENOENT);
}
} else
+#endif /* __rtems__ */
cp = hintp;
while (cp) {
hit = 1;
@@ -156,9 +163,13 @@ res_find(int *line, int *startln,
if (hit)
break;
if (use_kenv) {
+#ifndef __rtems__
cp = kenvp[++i];
if (cp == NULL)
break;
+#else /* __rtems__ */
+ (void) i;
+#endif /* __rtems__ */
} else {
while (*cp != '\0')
cp++;
@@ -169,8 +180,10 @@ res_find(int *line, int *startln,
}
}
}
+#ifndef __rtems__
if (use_kenv)
mtx_unlock(&kenv_lock);
+#endif /* __rtems__ */
if (cp == NULL)
return ENOENT;