summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/drvmgr
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2015-02-10 16:05:38 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:23 +0200
commit3f38335b02d1b9a7853a0e133b406f57428eb07f (patch)
tree28879e50cad41dd709b2aa46714efaf718c007d9 /c/src/lib/libbsp/sparc/shared/drvmgr
parentGR1553B: fixed build warnings (diff)
downloadrtems-3f38335b02d1b9a7853a0e133b406f57428eb07f.tar.bz2
LEON: added get_resarray_count() helper routine
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/drvmgr')
-rw-r--r--c/src/lib/libbsp/sparc/shared/drvmgr/get_resarray_count.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/drvmgr/get_resarray_count.c b/c/src/lib/libbsp/sparc/shared/drvmgr/get_resarray_count.c
new file mode 100644
index 0000000000..6fb57195c1
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/drvmgr/get_resarray_count.c
@@ -0,0 +1,20 @@
+/* Common driver configuration routines.
+ *
+ * COPYRIGHT (c) 2015.
+ * Cobham Gaisler.
+ *
+ * The license and distribution terms for this file may be
+ * found in found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#include <stdlib.h>
+#include <drvmgr/bspcommon.h>
+
+int get_resarray_count(struct drvmgr_bus_res **array)
+{
+ int i = 0;
+ while (array[i] != NULL)
+ i++;
+ return i;
+}