X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/a2e1b0681f3f65975cb3ed2f4f9708ac8f9ff070..43487eff262637a59a4c2c0272d7c4a824af3944:/lunaix-os/hal/devtree/devtree.h diff --git a/lunaix-os/hal/devtree/devtree.h b/lunaix-os/hal/devtree/devtree.h index 3b1df08..0ddda80 100644 --- a/lunaix-os/hal/devtree/devtree.h +++ b/lunaix-os/hal/devtree/devtree.h @@ -2,8 +2,34 @@ #define __LUNAIX_DEVTREE_INTERNAL_H #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 */