>>>>> "Sascha" == Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> writes: Hi, Sascha> zimage = xmalloc(header.end); Sascha> memcpy(zimage, &header, sizeof(header)); Sascha> - Sascha> - ret = read(fd, zimage + sizeof(header), header.end - sizeof(header)); Sascha> - if (ret < header.end - sizeof(header)) { Sascha> - printf("could not read %s\n", argv[1]); Sascha> - goto err_out1; Sascha> + m = memmap(fd, PROT_READ); Sascha> + if (m != (void *)-1) { Sascha> + memcpy(zimage, m, header.end); Here you're rereading the header as well, instead of everything past it like the normal case. Does this give a significant boost? read() from something memmap'able (like NOR) boils down to a memcpy as well, right? Sascha> + } else { Sascha> + ret = read(fd, zimage + sizeof(header), header.end - sizeof(header)); -- Bye, Peter Korsgaard _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox