summaryrefslogtreecommitdiffstats
path: root/cpukit/libdrvmgr/drvmgr_func_call.c
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2011-11-28 09:52:03 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:16 +0200
commite7fade3ac4559214ab0508dc54a71a3d1f522afb (patch)
tree13e32728a3b6adccd3f435db73091a8233d5dadf /cpukit/libdrvmgr/drvmgr_func_call.c
parentLIBPCI: added PCI shell command (diff)
downloadrtems-e7fade3ac4559214ab0508dc54a71a3d1f522afb.tar.bz2
DRVMGR: added driver manager to cpukit/libdrvmgr
Diffstat (limited to 'cpukit/libdrvmgr/drvmgr_func_call.c')
-rw-r--r--cpukit/libdrvmgr/drvmgr_func_call.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpukit/libdrvmgr/drvmgr_func_call.c b/cpukit/libdrvmgr/drvmgr_func_call.c
new file mode 100644
index 0000000000..75836c31a0
--- /dev/null
+++ b/cpukit/libdrvmgr/drvmgr_func_call.c
@@ -0,0 +1,21 @@
+/* Driver Manager optional dynamic function interface
+ *
+ * COPYRIGHT (c) 2011.
+ * Cobham Gaisler AB.
+ *
+ * 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.
+ */
+
+#include <drvmgr/drvmgr.h>
+
+/* Lookup function from function ID and call it using given arguments */
+int drvmgr_func_call(void *obj, int funcid, void *a, void *b, void *c, void *d)
+{
+ int (*func)(void *arg1, void *arg2, void *arg3, void *arg4) = NULL;
+
+ if (drvmgr_func_get(obj, funcid, (void *)&func) != DRVMGR_OK)
+ return DRVMGR_FAIL;
+ return func(a, b, c, d);
+}