X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/99f2ed669601a61f4f0210e0b481ff877cd9bea7..abb53006508723db0e1e13fb643240f688ddb8f0:/lunaix-os/hal/devtree/devtree.h diff --git a/lunaix-os/hal/devtree/devtree.h b/lunaix-os/hal/devtree/devtree.h index 3b1df08..66fe7dc 100644 --- a/lunaix-os/hal/devtree/devtree.h +++ b/lunaix-os/hal/devtree/devtree.h @@ -3,7 +3,34 @@ #include +#include + +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 ptr_t +__prop_val_ptr(struct fdt_prop* prop) +{ + return __ptr(prop) + sizeof(struct fdt_prop); +} + +static inline void +__mkprop_ptr(fdt_loc_t loc, struct dtp_val* val) +{ + val->ptr_val = __prop_val_ptr(loc.prop); + 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 */