Lines Matching refs:hdr
277 dump_header_uimg(struct uboot_image_header *hdr)
279 time_t tm = be32toh(hdr->ih_time);
281 printf(" magic: 0x%08x\n", be32toh(hdr->ih_magic));
283 printf(" size: %u\n", be32toh(hdr->ih_size));
284 printf(" load addr: 0x%08x\n", be32toh(hdr->ih_load));
285 printf(" entry point: 0x%08x\n", be32toh(hdr->ih_ep));
286 printf(" data crc: 0x%08x\n", be32toh(hdr->ih_dcrc));
287 printf(" os: %d (%s)\n", hdr->ih_os,
288 get_os_name(hdr->ih_os));
289 printf(" arch: %d (%s)\n", hdr->ih_arch,
290 get_arch_name(hdr->ih_arch));
291 printf(" type: %d (%s)\n", hdr->ih_type,
292 get_type_name(hdr->ih_type));
293 printf(" comp: %d (%s)\n", hdr->ih_comp,
294 get_comp_name(hdr->ih_comp));
295 printf(" name: %s\n", hdr->ih_name);
296 printf(" header crc: 0x%08x\n", hdr->ih_hcrc);
300 generate_header_uimg(struct uboot_image_header *hdr, time_t repro_time,
314 if (st.st_size + sizeof(*hdr) > UINT32_MAX) {
337 dsize = update_image ? (uint32_t)(st.st_size - sizeof(*hdr)) :
343 memset(hdr, 0, sizeof(*hdr));
344 hdr->ih_magic = htobe32(image_magic);
345 hdr->ih_time = htobe32(repro_time ? repro_time : st.st_mtime);
346 hdr->ih_size = htobe32(dsize);
347 hdr->ih_load = htobe32(image_loadaddr);
348 hdr->ih_ep = htobe32(image_entrypoint);
349 hdr->ih_dcrc = htobe32(crc);
350 hdr->ih_os = image_os;
351 hdr->ih_arch = image_arch;
352 hdr->ih_type = image_type;
353 hdr->ih_comp = image_comp;
354 strlcpy((char *)hdr->ih_name, image_name, sizeof(hdr->ih_name));
355 crc = crc32((void *)hdr, sizeof(*hdr));
356 hdr->ih_hcrc = htobe32(crc);
358 dump_header_uimg(hdr);
364 dump_header_arm64(struct arm64_image_header *hdr)
366 printf(" magic: 0x%" PRIx32 "\n", le32toh(hdr->magic));
367 printf(" text offset: 0x%" PRIx64 "\n", le64toh(hdr->text_offset));
368 printf(" image size: %" PRIu64 "\n", le64toh(hdr->image_size));
369 printf(" flags: 0x%" PRIx64 "\n", le64toh(hdr->flags));
373 generate_header_arm64(struct arm64_image_header *hdr, int kernel_fd)
392 (uint64_t)st.st_size : (uint64_t)st.st_size + sizeof(*hdr);
394 memset(hdr, 0, sizeof(*hdr));
395 hdr->code0 = htole32(ARM64_CODE0);
396 hdr->text_offset = htole64(image_entrypoint);
397 hdr->image_size = htole64(dsize);
398 hdr->flags = htole32(flags);
399 hdr->magic = htole32(ARM64_MAGIC);
401 dump_header_arm64(hdr);
407 write_image(void *hdr, size_t hdrlen, int kernel_fd, int image_fd)
421 wlen = write(image_fd, hdr, hdrlen);