Lines Matching refs:offset
140 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
142 unsigned int uoffset = offset; in fdt_offset_ptr()
143 unsigned int absoffset = offset + fdt_off_dt_struct(fdt); in fdt_offset_ptr()
145 if (offset < 0) in fdt_offset_ptr()
156 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
159 return fdt_offset_ptr_(fdt, offset); in fdt_offset_ptr()
166 int offset = startoffset; in fdt_next_tag() local
170 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); in fdt_next_tag()
174 offset += FDT_TAGSIZE; in fdt_next_tag()
181 p = fdt_offset_ptr(fdt, offset++, 1); in fdt_next_tag()
188 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); in fdt_next_tag()
193 sum = len + offset; in fdt_next_tag()
195 (INT_MAX <= sum || sum < (uint32_t) offset)) in fdt_next_tag()
199 offset += sizeof(struct fdt_property) - FDT_TAGSIZE + len; in fdt_next_tag()
203 ((offset - len) % 8) != 0) in fdt_next_tag()
204 offset += 4; in fdt_next_tag()
216 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset)) in fdt_next_tag()
219 *nextoffset = FDT_TAGALIGN(offset); in fdt_next_tag()
223 int fdt_check_node_offset_(const void *fdt, int offset) in fdt_check_node_offset_() argument
226 && ((offset < 0) || (offset % FDT_TAGSIZE))) in fdt_check_node_offset_()
229 if (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE) in fdt_check_node_offset_()
232 return offset; in fdt_check_node_offset_()
235 int fdt_check_prop_offset_(const void *fdt, int offset) in fdt_check_prop_offset_() argument
238 && ((offset < 0) || (offset % FDT_TAGSIZE))) in fdt_check_prop_offset_()
241 if (fdt_next_tag(fdt, offset, &offset) != FDT_PROP) in fdt_check_prop_offset_()
244 return offset; in fdt_check_prop_offset_()
247 int fdt_next_node(const void *fdt, int offset, int *depth) in fdt_next_node() argument
252 if (offset >= 0) in fdt_next_node()
253 if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0) in fdt_next_node()
257 offset = nextoffset; in fdt_next_node()
258 tag = fdt_next_tag(fdt, offset, &nextoffset); in fdt_next_node()
284 return offset; in fdt_next_node()
287 int fdt_first_subnode(const void *fdt, int offset) in fdt_first_subnode() argument
291 offset = fdt_next_node(fdt, offset, &depth); in fdt_first_subnode()
292 if (offset < 0 || depth != 1) in fdt_first_subnode()
295 return offset; in fdt_first_subnode()
298 int fdt_next_subnode(const void *fdt, int offset) in fdt_next_subnode() argument
307 offset = fdt_next_node(fdt, offset, &depth); in fdt_next_subnode()
308 if (offset < 0 || depth < 1) in fdt_next_subnode()
312 return offset; in fdt_next_subnode()