diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2015-02-10 16:05:38 +0100 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2015-04-17 01:10:23 +0200 |
commit | 3f38335b02d1b9a7853a0e133b406f57428eb07f (patch) | |
tree | 28879e50cad41dd709b2aa46714efaf718c007d9 /c/src/lib/libbsp/sparc/shared/drvmgr | |
parent | GR1553B: fixed build warnings (diff) | |
download | rtems-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.c | 20 |
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; +} |