forked from Imagelibrary/rtems
LEON: added get_resarray_count() helper routine
This commit is contained in:
@@ -149,10 +149,13 @@ EXTRA_DIST += shared/drvmgr/ambapp_bus.c
|
||||
EXTRA_DIST += shared/drvmgr/ambapp_bus_grlib.c
|
||||
EXTRA_DIST += shared/drvmgr/ambapp_bus_leon2.c
|
||||
EXTRA_DIST += shared/drvmgr/leon2_amba_bus.c
|
||||
EXTRA_DIST += shared/drvmgr/get_resarray_count.c
|
||||
|
||||
EXTRA_DIST += shared/include/drvmgr/ambapp_bus_grlib.h
|
||||
EXTRA_DIST += shared/include/drvmgr/ambapp_bus.h
|
||||
EXTRA_DIST += shared/include/drvmgr/leon2_amba_bus.h
|
||||
EXTRA_DIST += shared/include/drvmgr/bspcommon.h
|
||||
|
||||
# GR712
|
||||
EXTRA_DIST += shared/ascs/grascs.c
|
||||
EXTRA_DIST += shared/include/grascs.h
|
||||
|
||||
@@ -200,9 +200,11 @@ libbsp_a_SOURCES += ../../sparc/shared/tmtc/grtm.c
|
||||
include_drvmgrdir = $(includedir)/drvmgr
|
||||
include_drvmgr_HEADERS = ../../sparc/shared/include/drvmgr/ambapp_bus.h
|
||||
include_drvmgr_HEADERS += ../../sparc/shared/include/drvmgr/leon2_amba_bus.h
|
||||
include_drvmgr_HEADERS += ../../sparc/shared/include/drvmgr/bspcommon.h
|
||||
libbsp_a_SOURCES += ../../sparc/shared/drvmgr/ambapp_bus.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/drvmgr/ambapp_bus_leon2.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/drvmgr/leon2_amba_bus.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/drvmgr/get_resarray_count.c
|
||||
|
||||
if HAS_SMP
|
||||
libbsp_a_SOURCES += ../../shared/bspsmp.c
|
||||
|
||||
@@ -262,6 +262,10 @@ $(PROJECT_INCLUDE)/drvmgr/leon2_amba_bus.h: ../../sparc/shared/include/drvmgr/le
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/drvmgr/leon2_amba_bus.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/drvmgr/leon2_amba_bus.h
|
||||
|
||||
$(PROJECT_INCLUDE)/drvmgr/bspcommon.h: ../../sparc/shared/include/drvmgr/bspcommon.h $(PROJECT_INCLUDE)/drvmgr/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/drvmgr/bspcommon.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/drvmgr/bspcommon.h
|
||||
|
||||
if HAS_NETWORKING
|
||||
$(PROJECT_INCLUDE)/greth.h: ../../sparc/shared/include/greth.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/greth.h
|
||||
|
||||
@@ -231,8 +231,10 @@ libbsp_a_SOURCES += ../../sparc/shared/tmtc/grtm.c
|
||||
include_drvmgrdir = $(includedir)/drvmgr
|
||||
include_drvmgr_HEADERS = ../../sparc/shared/include/drvmgr/ambapp_bus_grlib.h
|
||||
include_drvmgr_HEADERS += ../../sparc/shared/include/drvmgr/ambapp_bus.h
|
||||
include_drvmgr_HEADERS += ../../sparc/shared/include/drvmgr/bspcommon.h
|
||||
libbsp_a_SOURCES += ../../sparc/shared/drvmgr/ambapp_bus.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/drvmgr/ambapp_bus_grlib.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/drvmgr/get_resarray_count.c
|
||||
|
||||
if HAS_SMP
|
||||
libbsp_a_SOURCES += startup/bspsmp.c
|
||||
|
||||
@@ -310,6 +310,10 @@ $(PROJECT_INCLUDE)/drvmgr/ambapp_bus.h: ../../sparc/shared/include/drvmgr/ambapp
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/drvmgr/ambapp_bus.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/drvmgr/ambapp_bus.h
|
||||
|
||||
$(PROJECT_INCLUDE)/drvmgr/bspcommon.h: ../../sparc/shared/include/drvmgr/bspcommon.h $(PROJECT_INCLUDE)/drvmgr/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/drvmgr/bspcommon.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/drvmgr/bspcommon.h
|
||||
|
||||
if HAS_NETWORKING
|
||||
$(PROJECT_INCLUDE)/greth.h: ../../sparc/shared/include/greth.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/greth.h
|
||||
|
||||
20
c/src/lib/libbsp/sparc/shared/drvmgr/get_resarray_count.c
Normal file
20
c/src/lib/libbsp/sparc/shared/drvmgr/get_resarray_count.c
Normal file
@@ -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;
|
||||
}
|
||||
28
c/src/lib/libbsp/sparc/shared/include/drvmgr/bspcommon.h
Normal file
28
c/src/lib/libbsp/sparc/shared/include/drvmgr/bspcommon.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* Common BSP/driver configuration routines.
|
||||
*
|
||||
* COPYRIGHT (c) 2015.
|
||||
* Cobham Gaisler.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BSPCOMMON_H__
|
||||
#define __BSPCOMMON_H__
|
||||
|
||||
#include <drvmgr/drvmgr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Count driver resource array length. Array must be terminated with a NULL */
|
||||
int get_resarray_count(struct drvmgr_bus_res **array);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user