[rtems-libbsd commit] DEVICE.HINTS(5): Use static hints only

Sebastian Huber sebh at rtems.org
Mon Nov 11 09:02:10 UTC 2013


Module:    rtems-libbsd
Branch:    master
Commit:    d328ca274a251d0fb5deab5b32b87f9db4c134b9
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=d328ca274a251d0fb5deab5b32b87f9db4c134b9

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Nov  6 08:24:53 2013 +0100

DEVICE.HINTS(5): Use static hints only

---

 freebsd/sys/kern/subr_hints.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/freebsd/sys/kern/subr_hints.c b/freebsd/sys/kern/subr_hints.c
index 3613321..68725bd 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;
 




More information about the vc mailing list