X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/35a7d633d3f16c1e0539af6ca5d8e7482926cd93..f89517343bf062d299d54408eea2f9387bfefb6d:/lunaix-os/hal/devtree/devtree.h?ds=sidebyside diff --git a/lunaix-os/hal/devtree/devtree.h b/lunaix-os/hal/devtree/devtree.h index c2374c8..66fe7dc 100644 --- a/lunaix-os/hal/devtree/devtree.h +++ b/lunaix-os/hal/devtree/devtree.h @@ -6,42 +6,31 @@ #include static inline bool -propeq(struct fdt_iter* it, const char* key) +propeq(struct fdt_blob* fdt, fdt_loc_t loc, const char* key) { - return streq(fdtit_prop_key(it), key); + return streq(fdt_prop_key(fdt, loc), key); } -static inline void -__mkprop_val32(struct fdt_iter* it, struct dt_prop_val* val) +static inline ptr_t +__prop_val_ptr(struct fdt_prop* prop) { - val->u32_val = le(*(u32_t*)&it->prop[1]); - val->size = le(it->prop->len); + return __ptr(prop) + sizeof(struct fdt_prop); } static inline void -__mkprop_val64(struct fdt_iter* it, struct dt_prop_val* val) +__mkprop_ptr(fdt_loc_t loc, struct dtp_val* val) { - val->u64_val = le64(*(u64_t*)&it->prop[1]); - val->size = le(it->prop->len); -} - -static inline void -__mkprop_ptr(struct fdt_iter* it, struct dt_prop_val* val) -{ - val->ptr_val = __ptr(&it->prop[1]); - val->size = le(it->prop->len); + val->ptr_val = __prop_val_ptr(loc.prop); + val->size = loc.prop->len; } static inline u32_t -__prop_getu32(struct fdt_iter* it) +__prop_getu32(fdt_loc_t loc) { - return le(*(u32_t*)&it->prop[1]); + return loc.prop->val[0]; } bool -parse_stdintr_prop(struct fdt_iter* it, struct dt_intr_node* node); - -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 */