aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
commitca13d318efe4fee5b3738fd08dcaa897ec767940 (patch)
tree15b72f877f1d8a80987bc6d72600d097509c2b9d /include
parentda2e55182a2c9586eaf8e63a31bfabcbc6be0ff7 (diff)
downloadopenbios-ca13d318efe4fee5b3738fd08dcaa897ec767940.zip
openbios-ca13d318efe4fee5b3738fd08dcaa897ec767940.tar.gz
openbios-ca13d318efe4fee5b3738fd08dcaa897ec767940.tar.bz2
libopenbios: introduce BIND_NODE_METHODS() macro
This macro is designed to bind C functions into Forth words during creation of the device tree, but only into an existing node and without attempting to create any missing parent nodes. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/libopenbios/bindings.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libopenbios/bindings.h b/include/libopenbios/bindings.h
index 4ec9789..6360a4f 100644
--- a/include/libopenbios/bindings.h
+++ b/include/libopenbios/bindings.h
@@ -127,6 +127,11 @@ typedef struct {
paths, 1, name##_m, sizeof(name##_m)/sizeof(method_t)); \
} while(0)
+#define BIND_NODE_METHODS(ph, name) do { \
+ bind_node_methods(ph, name##_flags_, name##_size_, \
+ name##_m, sizeof(name##_m)/sizeof(method_t)); \
+} while(0)
+
#define DECLARE_UNNAMED_NODE( name, flags, size ) \
static const int name##_flags_ = flags; \
static const int name##_size_ = size;
@@ -144,6 +149,9 @@ static const method_t name##_m[]
name##_m, sizeof(name##_m)/sizeof(method_t) ); \
} while(0)
+extern void
+bind_node_methods(phandle_t ph, int flags, int size, const method_t *methods, int nmet);
+
extern void bind_node( int flags, int size, const char * const *paths, int npaths,
const method_t *methods, int nmethods );