Lines Matching refs:hdr
358 static void bswap_uboot_header(uboot_image_header_t *hdr)
361 bswap32s(&hdr->ih_magic);
362 bswap32s(&hdr->ih_hcrc);
363 bswap32s(&hdr->ih_time);
364 bswap32s(&hdr->ih_size);
365 bswap32s(&hdr->ih_load);
366 bswap32s(&hdr->ih_ep);
367 bswap32s(&hdr->ih_dcrc);
463 uboot_image_header_t *hdr = &h;
471 size = read(fd, hdr, sizeof(uboot_image_header_t));
475 bswap_uboot_header(hdr);
477 if (hdr->ih_magic != IH_MAGIC)
481 if (hdr->ih_type != IH_TYPE_KERNEL) {
486 switch (hdr->ih_comp) {
493 hdr->ih_comp);
499 if (hdr->ih_os == IH_OS_LINUX)
505 *ep = hdr->ih_ep;
506 data = g_malloc(hdr->ih_size);
508 if (read(fd, data, hdr->ih_size) != hdr->ih_size) {
513 if (hdr->ih_comp == IH_COMP_GZIP) {
522 bytes = gunzip(data, max_bytes, compressed_data, hdr->ih_size);
528 hdr->ih_size = bytes;
531 cpu_physical_memory_write_rom(hdr->ih_load, data, hdr->ih_size);
534 *loadaddr = hdr->ih_load;
536 ret = hdr->ih_size;