Lines Matching +full:prop +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
22 yyin = current_srcfile->f; in dt_from_source()
51 const char *end = s + len - 1; in write_propval_string()
142 static void add_string_markers(struct property *prop) in add_string_markers() argument
144 int l, len = prop->val.len; in add_string_markers()
145 const char *p = prop->val.val; in add_string_markers()
151 m->offset = l; in add_string_markers()
152 m->type = TYPE_STRING; in add_string_markers()
153 m->ref = NULL; in add_string_markers()
154 m->next = NULL; in add_string_markers()
157 nextp = &prop->val.markers; in add_string_markers()
159 nextp = &((*nextp)->next); in add_string_markers()
164 static enum markertype guess_value_type(struct property *prop) in guess_value_type() argument
166 int len = prop->val.len; in guess_value_type()
167 const char *p = prop->val.val; in guess_value_type()
168 struct marker *m = prop->val.markers; in guess_value_type()
181 if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0')) in guess_value_type()
183 if ((m->offset % sizeof(cell_t)) != 0) in guess_value_type()
187 if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul <= (len-nnul)) in guess_value_type()
190 add_string_markers(prop); in guess_value_type()
199 static void write_propval(FILE *f, struct property *prop) in write_propval() argument
201 size_t len = prop->val.len; in write_propval()
202 struct marker *m = prop->val.markers; in write_propval()
210 srcstr = srcpos_string_first(prop->srcpos, annotate); in write_propval()
224 dummy_marker.type = guess_value_type(prop); in write_propval()
225 dummy_marker.next = prop->val.markers; in write_propval()
232 size_t chunk_len = (m->next ? m->next->offset : len) - m->offset; in write_propval()
233 size_t data_len = type_marker_length(m) ? : len - m->offset; in write_propval()
234 const char *p = &prop->val.val[m->offset]; in write_propval()
237 if (is_type_marker(m->type)) { in write_propval()
238 emit_type = m->type; in write_propval()
240 } else if (m->type == LABEL) in write_propval()
241 fprintf(f, " %s:", m->ref); in write_propval()
251 m_phandle = prop->val.markers; in write_propval()
253 if (m->offset == m_phandle->offset) in write_propval()
257 if (m_phandle->ref[0] == '/') in write_propval()
258 fprintf(f, "&{%s}", m_phandle->ref); in write_propval()
260 fprintf(f, "&%s", m_phandle->ref); in write_propval()
263 write_propval_int(f, p + 4, chunk_len - 4, 4); in write_propval()
282 size_t pos = m->offset + chunk_len; in write_propval()
290 srcstr = srcpos_string_first(prop->srcpos, annotate); in write_propval()
301 struct property *prop; in write_tree_source_node() local
307 for_each_label(tree->labels, l) in write_tree_source_node()
308 fprintf(f, "%s: ", l->label); in write_tree_source_node()
309 if (tree->name && (*tree->name)) in write_tree_source_node()
310 fprintf(f, "%s {", tree->name); in write_tree_source_node()
315 srcstr = srcpos_string_first(tree->srcpos, annotate); in write_tree_source_node()
323 for_each_property(tree, prop) { in write_tree_source_node()
325 for_each_label(prop->labels, l) in write_tree_source_node()
326 fprintf(f, "%s: ", l->label); in write_tree_source_node()
327 fprintf(f, "%s", prop->name); in write_tree_source_node()
328 write_propval(f, prop); in write_tree_source_node()
337 srcstr = srcpos_string_last(tree->srcpos, annotate); in write_tree_source_node()
350 fprintf(f, "/dts-v1/;\n\n"); in dt_to_source()
352 for (re = dti->reservelist; re; re = re->next) { in dt_to_source()
355 for_each_label(re->labels, l) in dt_to_source()
356 fprintf(f, "%s: ", l->label); in dt_to_source()
358 (unsigned long long)re->address, in dt_to_source()
359 (unsigned long long)re->size); in dt_to_source()
362 write_tree_source_node(f, dti->dt, 0); in dt_to_source()