Support xz compression on yeeloong.
* Makefile.util.def (grub-mkimage): Add $(LIBLZMA). * configure.ac: Check for LZMA. * grub-core/Makefile.core.def (xz_decompress): New target. (none_decompress): Likewise. * grub-core/boot/decompressor/minilib.c: New file. * grub-core/boot/decompressor/none.c: Likewise. * grub-core/boot/decompressor/xz.c: Likewise. * grub-core/kern/mips/cache.S: Change to noreorder nomacro. * grub-core/kern/mips/cache_flush.S: Likewise. * grub-core/kern/i386/pc/lzma_decode.S: Remove dead code. * grub-core/kern/mips/startup.S: Move first stage to ... * grub-core/boot/mips/startup_raw.S: ...here. Change to noreorder nomacro. * grub-core/kern/mips/startup.S: Change to noreorder nomacro. * grub-core/lib/mips/relocator_asm.S: Change to noreorder nomacro. * grub-core/lib/xzembed/xz_dec_bcj.c [GRUB_EMBED_DECOMPRESSOR]: Allocate statically. * grub-core/lib/xzembed/xz_dec_lzma2.c [GRUB_EMBED_DECOMPRESSOR]: Allocate statically or use scratch. Don't check CRC32. * grub-core/lib/xzembed/xz_dec_stream.c [GRUB_EMBED_DECOMPRESSOR]: Allocate statically. Don't check CRC32. * include/grub/decompressor.h: New file. * include/grub/offsets.h (GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE): Removed. (GRUB_KERNEL_MIPS_YEELOONG_UNCOMPRESSED_SIZE): New field. (GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE): Adjusted. (GRUB_KERNEL_MIPS_YEELOONG_PREFIX): Likewise. (GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END): Likewise. (GRUB_KERNEL_MACHINE_UNCOMPRESSED_SIZE): New define. * util/grub-mkimage.c (grub_compression_t): New type. (PLATFORM_FLAGS_DECOMPRESSORS): New flag. (image_target_desc): New field default_compression. (image_targets): Adjust yeeloong targets. (compress_kernel_xz) [HAVE_LIBLZMA]: New function. (compress_kernel): New parameter comp. (generate_image): Likewise. Handle new compression case. (options): New option --compression (help): Likewise. (main): Handle new option.
This commit is contained in:
commit
6d0fa83c79
19 changed files with 812 additions and 233 deletions
|
@ -77,69 +77,6 @@
|
|||
#define RepLenCoder (LenCoder + kNumLenProbs)
|
||||
#define Literal (RepLenCoder + kNumLenProbs)
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
DbgOut:
|
||||
pushf
|
||||
pushl %ebp
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %edx
|
||||
pushl %ecx
|
||||
pushl %ebx
|
||||
pushl %eax
|
||||
|
||||
call _DebugPrint
|
||||
|
||||
popl %eax
|
||||
popl %ebx
|
||||
popl %ecx
|
||||
popl %edx
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebp
|
||||
popf
|
||||
|
||||
ret
|
||||
|
||||
|
||||
/*
|
||||
* int LzmaDecodeProperties(CLzmaProperties *propsRes,
|
||||
* const unsigned char *propsData,
|
||||
* int size);
|
||||
*/
|
||||
|
||||
_LzmaDecodePropertiesA:
|
||||
movb (%edx), %dl
|
||||
|
||||
xorl %ecx, %ecx
|
||||
1:
|
||||
cmpb $45, %dl
|
||||
jb 2f
|
||||
incl %ecx
|
||||
subb $45, %dl
|
||||
jmp 1b
|
||||
2:
|
||||
movl %ecx, 8(%eax) /* pb */
|
||||
xorl %ecx, %ecx
|
||||
1:
|
||||
cmpb $9, %dl
|
||||
jb 2f
|
||||
incl %ecx
|
||||
subb $9, %dl
|
||||
2:
|
||||
movl %ecx, 4(%eax) /* lp */
|
||||
movb %dl, %cl
|
||||
movl %ecx, (%eax) /* lc */
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef ASM_FILE
|
||||
xorl %eax, %eax
|
||||
#endif
|
||||
ret
|
||||
|
||||
#define out_size 8(%ebp)
|
||||
|
||||
#define now_pos -4(%ebp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue