optimize the tests makefiles, add unit tests for btrie key allocator
[lunaix-os.git] / lunaix-os / hal / devtree / devtree.h
1 #ifndef __LUNAIX_DEVTREE_INTERNAL_H
2 #define __LUNAIX_DEVTREE_INTERNAL_H
3
4 #include <hal/devtree.h>
5
6 #include <klibc/string.h>
7
8 static inline bool
9 propeq(struct fdt_blob* fdt, fdt_loc_t loc, const char* key)
10 {
11     return streq(fdt_prop_key(fdt, loc), key);
12 }
13
14 static inline void
15 __mkprop_ptr(fdt_loc_t loc, struct dtp_val* val)
16 {
17     val->ptr_val = __ptr(loc.prop->val);
18     val->size = loc.prop->len;
19 }
20
21 static inline u32_t
22 __prop_getu32(fdt_loc_t loc)
23 {
24     return loc.prop->val[0];
25 }
26
27 bool
28 parse_stdintr_prop(struct fdt_blob*, fdt_loc_t, struct dtn_intr*);
29
30 #endif /* __LUNAIX_DEVTREE_H */