optimize the tests makefiles, add unit tests for btrie key allocator
[lunaix-os.git] / lunaix-os / hal / devtree / devtree.h
index 3b1df0803bb4c12d0530d98025d5f26eef07ef45..1bfe891b5b2540a3adcb9443bfde5a9560278f52 100644 (file)
@@ -3,7 +3,28 @@
 
 #include <hal/devtree.h>
 
+#include <klibc/string.h>
+
+static inline bool
+propeq(struct fdt_blob* fdt, fdt_loc_t loc, const char* key)
+{
+    return streq(fdt_prop_key(fdt, loc), key);
+}
+
+static inline void
+__mkprop_ptr(fdt_loc_t loc, struct dtp_val* val)
+{
+    val->ptr_val = __ptr(loc.prop->val);
+    val->size = loc.prop->len;
+}
+
+static inline u32_t
+__prop_getu32(fdt_loc_t loc)
+{
+    return loc.prop->val[0];
+}
+
 bool
-parse_stdintr_prop(struct fdt_iter* it, struct dt_intr_node* node);
+parse_stdintr_prop(struct fdt_blob*, fdt_loc_t, struct dtn_intr*);
 
 #endif /* __LUNAIX_DEVTREE_H */