#ifndef __LUNAIX_DEVTREE_H
#define __LUNAIX_DEVTREE_H
+#ifdef CONFIG_USE_DEVICETREE
#include <lunaix/types.h>
#include <lunaix/ds/llist.h>
#include <lunaix/ds/hstr.h>
{
union
{
- union {
- const char* str_val;
- const char* str_lst;
- };
ptr_t ptr_val;
dt_enc_t encoded;
union dtp_baseval* ref;
+ union {
+ const char* str_val;
+ const char* str_lst;
+ };
};
unsigned int size;
};
struct dtp_table *props;
- morph_t *binded_dev;
+ morph_t *binded_obj;
};
struct dtspec_key
val->size = cells * sizeof(u32_t);
}
+static inline void
+dtn_bind_object(struct dtn* node, morph_t* mobj)
+{
+ node->base.binded_obj = changeling_ref(mobj);
+}
+
//////////////////////////////////////
/// DT Methods: Specifier Map
#define dtprop_reglike(base) \
({ \
dt_proplet p = { \
- dtprop_compx(base->addr_c), \
- dtprop_compx(base->sz_c), \
+ dtprop_compx((base)->addr_c), \
+ dtprop_compx((base)->sz_c), \
dtprop_end \
}; \
- dt_proplet; \
+ p; \
})
#define dtprop_rangelike(node) \
dtprop_compx(base->sz_c), \
dtprop_end \
}; \
- dt_proplet; \
+ p; \
})
#define dtprop_strlst_foreach(pos, prop) \
dtpi_init_empty(struct dtpropi* dtpi)
{
*dtpi = (struct dtpropi) {
- .prop = { 0, 0 },
+ .prop = { {0}, 0 },
.loc = 0
};
}
return true;
}
+#endif
#endif /* __LUNAIX_DEVTREE_H */