misc.c (e89c6fdf9e0eb1b5a03574d4ca73e83eae8deb91) misc.c (2d3862d26e67a59340ba1cf1748196c76c5787de)
1/*
2 * misc.c
3 *
4 * This is a collection of several routines from gzip-1.0.3
5 * adapted for Linux.
6 *
7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
8 * puts by Nick Holloway 1993, better puts by Martin Mares 1995

--- 434 unchanged lines hidden (view full) ---

443 error("Destination address too large");
444#endif
445#ifndef CONFIG_RELOCATABLE
446 if ((unsigned long)output != LOAD_PHYSICAL_ADDR)
447 error("Wrong destination address");
448#endif
449
450 debug_putstr("\nDecompressing Linux... ");
1/*
2 * misc.c
3 *
4 * This is a collection of several routines from gzip-1.0.3
5 * adapted for Linux.
6 *
7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
8 * puts by Nick Holloway 1993, better puts by Martin Mares 1995

--- 434 unchanged lines hidden (view full) ---

443 error("Destination address too large");
444#endif
445#ifndef CONFIG_RELOCATABLE
446 if ((unsigned long)output != LOAD_PHYSICAL_ADDR)
447 error("Wrong destination address");
448#endif
449
450 debug_putstr("\nDecompressing Linux... ");
451 decompress(input_data, input_len, NULL, NULL, output, NULL, error);
451 __decompress(input_data, input_len, NULL, NULL, output, output_len,
452 NULL, error);
452 parse_elf(output);
453 /*
454 * 32-bit always performs relocations. 64-bit relocations are only
455 * needed if kASLR has chosen a different load address.
456 */
457 if (!IS_ENABLED(CONFIG_X86_64) || output != output_orig)
458 handle_relocations(output, output_len);
459 debug_putstr("done.\nBooting the kernel.\n");
460 return output;
461}
453 parse_elf(output);
454 /*
455 * 32-bit always performs relocations. 64-bit relocations are only
456 * needed if kASLR has chosen a different load address.
457 */
458 if (!IS_ENABLED(CONFIG_X86_64) || output != output_orig)
459 handle_relocations(output, output_len);
460 debug_putstr("done.\nBooting the kernel.\n");
461 return output;
462}