aa64: finalise context switch, page fault handler and syscall
[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 #include <klibc/string.h>
6
7 static inline bool
8 propeq(struct fdt_blob* fdt, fdt_loc_t loc, const char* key)
9 {
10     return streq(fdt_prop_key(fdt, loc), key);
11 }
12
13 static inline ptr_t
14 __prop_val_ptr(struct fdt_prop* prop)
15 {
16     return __ptr(prop) + sizeof(struct fdt_prop);
17 }
18
19 static inline void
20 __mkprop_ptr(fdt_loc_t loc, struct dtp_val* val)
21 {
22     val->ptr_val = __prop_val_ptr(loc.prop);
23     val->size = loc.prop->len;
24 }
25
26 static inline u32_t
27 __prop_getu32(fdt_loc_t loc)
28 {
29     return loc.prop->val[0];
30 }
31
32 bool
33 parse_stdintr_prop(struct fdt_blob*, fdt_loc_t, struct dtn_intr*);
34
35 #endif /* __LUNAIX_DEVTREE_H */