Lines Matching refs:out_fp

59   FILE *out_fp = NULL;  in write_fdt_to_file()  local
61 out_fp = fopen(filename, "wb"); in write_fdt_to_file()
62 if (!out_fp) { in write_fdt_to_file()
68 if (fwrite(fdt, fdt_size, 1, out_fp) < 1) { in write_fdt_to_file()
76 if (out_fp) fclose(out_fp); in write_fdt_to_file()
91 static void output_prop_int(FILE *out_fp, const char *name, uint32_t value) { in output_prop_int() argument
92 fprintf(out_fp, "%+20s = %d\n", name, fdt32_to_cpu(value)); in output_prop_int()
95 static void output_prop_int_cpu(FILE *out_fp, const char *name, uint32_t value) { in output_prop_int_cpu() argument
96 fprintf(out_fp, "%+20s = %d\n", name, value); in output_prop_int_cpu()
99 static void output_prop_hex(FILE *out_fp, const char *name, uint32_t value) { in output_prop_hex() argument
100 fprintf(out_fp, "%+20s = %08x\n", name, fdt32_to_cpu(value)); in output_prop_hex()
103 static void output_prop_str(FILE *out_fp, const char *name, const char *value) { in output_prop_str() argument
104 fprintf(out_fp, "%+20s = %s\n", name, value); in output_prop_str()
107 static void output_table_header(FILE *out_fp, const struct dt_table_header *header) { in output_table_header() argument
108 fprintf(out_fp, "dt_table_header:\n"); in output_table_header()
109 output_prop_hex(out_fp, "magic", header->magic); in output_table_header()
110 output_prop_int(out_fp, "total_size", header->total_size); in output_table_header()
111 output_prop_int(out_fp, "header_size", header->header_size); in output_table_header()
112 output_prop_int(out_fp, "dt_entry_size", header->dt_entry_size); in output_table_header()
113 output_prop_int(out_fp, "dt_entry_count", header->dt_entry_count); in output_table_header()
114 output_prop_int(out_fp, "dt_entries_offset", header->dt_entries_offset); in output_table_header()
115 output_prop_int(out_fp, "page_size", header->page_size); in output_table_header()
116 output_prop_int(out_fp, "version", header->version); in output_table_header()
119 static void output_table_entry(FILE *out_fp, int index, const struct dt_table_entry *entry) { in output_table_entry() argument
120 fprintf(out_fp, "dt_table_entry[%d]:\n", index); in output_table_entry()
121 output_prop_int(out_fp, "dt_size", entry->dt_size); in output_table_entry()
122 output_prop_int(out_fp, "dt_offset", entry->dt_offset); in output_table_entry()
123 output_prop_hex(out_fp, "id", entry->id); in output_table_entry()
124 output_prop_hex(out_fp, "rev", entry->rev); in output_table_entry()
125 output_prop_hex(out_fp, "custom[0]", entry->custom[0]); in output_table_entry()
126 output_prop_hex(out_fp, "custom[1]", entry->custom[1]); in output_table_entry()
127 output_prop_hex(out_fp, "custom[2]", entry->custom[2]); in output_table_entry()
128 output_prop_hex(out_fp, "custom[3]", entry->custom[3]); in output_table_entry()
131 static int output_fdt_info(FILE *out_fp, void *fdt, in output_fdt_info() argument
135 output_prop_int_cpu(out_fp, "(FDT)size", fdt_size); in output_fdt_info()
145 output_prop_str(out_fp, "(FDT)compatible", compatible ? compatible : "(unknown)"); in output_fdt_info()
158 static int dump_image_from_fp(FILE *out_fp, FILE *img_fp, in dump_image_from_fp() argument
166 output_table_header(out_fp, &header); in dump_image_from_fp()
186 output_table_entry(out_fp, i, &entry); in dump_image_from_fp()
192 output_fdt_info(out_fp, fdt, get_fdt_size); in dump_image_from_fp()
212 FILE *out_fp = NULL; in process_command_dump() local
222 out_fp = fopen(params->out_filename, "w"); in process_command_dump()
223 if (out_fp == NULL) { in process_command_dump()
229 ret = dump_image_from_fp(out_fp ? out_fp : stdout, img_fp, params); in process_command_dump()
233 if (out_fp) fclose(out_fp); in process_command_dump()
238 void handle_usage_dump(FILE *out_fp, const char *prog_name) { in handle_usage_dump() argument
239 fprintf(out_fp, " %s dump <image_file> (<option>...)\n\n", prog_name); in handle_usage_dump()
240 fprintf(out_fp, in handle_usage_dump()