Lines Matching refs:offset

77 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
79 unsigned absoffset = offset + fdt_off_dt_struct(fdt);
81 if ((absoffset < offset)
87 if (((offset + len) < offset)
88 || ((offset + len) > fdt_size_dt_struct(fdt)))
91 return _fdt_offset_ptr(fdt, offset);
98 int offset = startoffset;
102 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
106 offset += FDT_TAGSIZE;
113 p = fdt_offset_ptr(fdt, offset++, 1);
120 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
123 /* skip-name offset, length and value */
124 offset += sizeof(struct fdt_property) - FDT_TAGSIZE
137 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset))
140 *nextoffset = FDT_TAGALIGN(offset);
144 int _fdt_check_node_offset(const void *fdt, int offset)
146 if ((offset < 0) || (offset % FDT_TAGSIZE)
147 || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
150 return offset;
153 int _fdt_check_prop_offset(const void *fdt, int offset)
155 if ((offset < 0) || (offset % FDT_TAGSIZE)
156 || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
159 return offset;
162 int fdt_next_node(const void *fdt, int offset, int *depth)
167 if (offset >= 0)
168 if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0)
172 offset = nextoffset;
173 tag = fdt_next_tag(fdt, offset, &nextoffset);
199 return offset;
202 int fdt_first_subnode(const void *fdt, int offset)
206 offset = fdt_next_node(fdt, offset, &depth);
207 if (offset < 0 || depth != 1)
210 return offset;
213 int fdt_next_subnode(const void *fdt, int offset)
222 offset = fdt_next_node(fdt, offset, &depth);
223 if (offset < 0 || depth < 1)
227 return offset;