Lines Matching full:f
22 yyin = current_srcfile->f; in dt_from_source()
34 static void write_prefix(FILE *f, int level) in write_prefix() argument
39 fputc('\t', f); in write_prefix()
46 || strchr("\a\b\t\n\v\f\r", c)); in isstring()
49 static void write_propval_string(FILE *f, const char *s, size_t len) in write_propval_string() argument
58 fprintf(f, "\""); in write_propval_string()
63 fprintf(f, "\\a"); in write_propval_string()
66 fprintf(f, "\\b"); in write_propval_string()
69 fprintf(f, "\\t"); in write_propval_string()
72 fprintf(f, "\\n"); in write_propval_string()
75 fprintf(f, "\\v"); in write_propval_string()
77 case '\f': in write_propval_string()
78 fprintf(f, "\\f"); in write_propval_string()
81 fprintf(f, "\\r"); in write_propval_string()
84 fprintf(f, "\\\\"); in write_propval_string()
87 fprintf(f, "\\\""); in write_propval_string()
90 fprintf(f, "\\0"); in write_propval_string()
94 fprintf(f, "%c", c); in write_propval_string()
96 fprintf(f, "\\x%02"PRIx8, c); in write_propval_string()
99 fprintf(f, "\""); in write_propval_string()
102 static void write_propval_int(FILE *f, const char *p, size_t len, size_t width) in write_propval_int() argument
110 fprintf(f, "%02"PRIx8, *(const uint8_t*)p); in write_propval_int()
113 fprintf(f, "0x%02"PRIx16, dtb_ld16(p)); in write_propval_int()
116 fprintf(f, "0x%02"PRIx32, dtb_ld32(p)); in write_propval_int()
119 fprintf(f, "0x%02"PRIx64, dtb_ld64(p)); in write_propval_int()
123 fputc(' ', f); in write_propval_int()
196 static void write_propval(FILE *f, struct property *prop) in write_propval() argument
205 fprintf(f, ";"); in write_propval()
209 fprintf(f, " /* %s */", srcstr); in write_propval()
213 fprintf(f, "\n"); in write_propval()
217 fprintf(f, " ="); in write_propval()
235 fprintf(f, " %s", delim_start[emit_type]); in write_propval()
237 fprintf(f, " %s:", m->ref); in write_propval()
239 fputc(' ', f); in write_propval()
248 write_propval_int(f, p, chunk_len, 2); in write_propval()
251 write_propval_int(f, p, chunk_len, 4); in write_propval()
254 write_propval_int(f, p, chunk_len, 8); in write_propval()
257 write_propval_string(f, p, chunk_len); in write_propval()
260 write_propval_int(f, p, chunk_len, 1); in write_propval()
265 fprintf(f, pos == len ? "%s" : "%s,", in write_propval()
270 fprintf(f, ";"); in write_propval()
274 fprintf(f, " /* %s */", srcstr); in write_propval()
278 fprintf(f, "\n"); in write_propval()
281 static void write_tree_source_node(FILE *f, struct node *tree, int level) in write_tree_source_node() argument
288 write_prefix(f, level); in write_tree_source_node()
290 fprintf(f, "%s: ", l->label); in write_tree_source_node()
292 fprintf(f, "%s {", tree->name); in write_tree_source_node()
294 fprintf(f, "/ {"); in write_tree_source_node()
299 fprintf(f, " /* %s */", srcstr); in write_tree_source_node()
303 fprintf(f, "\n"); in write_tree_source_node()
306 write_prefix(f, level+1); in write_tree_source_node()
308 fprintf(f, "%s: ", l->label); in write_tree_source_node()
309 fprintf(f, "%s", prop->name); in write_tree_source_node()
310 write_propval(f, prop); in write_tree_source_node()
313 fprintf(f, "\n"); in write_tree_source_node()
314 write_tree_source_node(f, child, level+1); in write_tree_source_node()
316 write_prefix(f, level); in write_tree_source_node()
317 fprintf(f, "};"); in write_tree_source_node()
321 fprintf(f, " /* %s */", srcstr); in write_tree_source_node()
325 fprintf(f, "\n"); in write_tree_source_node()
328 void dt_to_source(FILE *f, struct dt_info *dti) in dt_to_source() argument
332 fprintf(f, "/dts-v1/;\n\n"); in dt_to_source()
338 fprintf(f, "%s: ", l->label); in dt_to_source()
339 fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n", in dt_to_source()
344 write_tree_source_node(f, dti->dt, 0); in dt_to_source()