2008-03-28 Pavel Roskin <proski@gnu.org>
* kern/i386/pc/startup.S: Assert that uncompressed functions don't spill beyond GRUB_KERNEL_MACHINE_RAW_SIZE. * kern/i386/pc/lzo1x.S: Remove all .align directives in the code, as they push parts of the code (error handlers) beyond GRUB_KERNEL_MACHINE_RAW_SIZE. Speed is not as important in this code as correctness and size.
This commit is contained in:
parent
77bcd27207
commit
80a3e68b59
3 changed files with 14 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2008-03-28 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* kern/i386/pc/startup.S: Assert that uncompressed functions
|
||||||
|
don't spill beyond GRUB_KERNEL_MACHINE_RAW_SIZE.
|
||||||
|
* kern/i386/pc/lzo1x.S: Remove all .align directives in the
|
||||||
|
code, as they push parts of the code (error handlers) beyond
|
||||||
|
GRUB_KERNEL_MACHINE_RAW_SIZE. Speed is not as important in this
|
||||||
|
code as correctness and size.
|
||||||
|
|
||||||
2008-03-28 Pavel Roskin <proski@gnu.org>
|
2008-03-28 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* kern/i386/pc/startup.S
|
* kern/i386/pc/startup.S
|
||||||
|
|
|
@ -73,7 +73,6 @@ lzo1x_decompress:
|
||||||
jmp 3f
|
jmp 3f
|
||||||
|
|
||||||
|
|
||||||
.align 8
|
|
||||||
.L00:
|
.L00:
|
||||||
LODSB
|
LODSB
|
||||||
.L01:
|
.L01:
|
||||||
|
@ -119,7 +118,6 @@ lzo1x_decompress:
|
||||||
// M2
|
// M2
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
.align 8
|
|
||||||
.LMATCH:
|
.LMATCH:
|
||||||
cmpb $64, %al
|
cmpb $64, %al
|
||||||
jb .LM3MATCH
|
jb .LM3MATCH
|
||||||
|
@ -156,7 +154,6 @@ lzo1x_decompress:
|
||||||
jmp 3f
|
jmp 3f
|
||||||
|
|
||||||
|
|
||||||
.align 8
|
|
||||||
.LM3MATCH:
|
.LM3MATCH:
|
||||||
cmpb $32, %al
|
cmpb $32, %al
|
||||||
jb .LM4MATCH
|
jb .LM4MATCH
|
||||||
|
@ -180,7 +177,6 @@ lzo1x_decompress:
|
||||||
// copy match
|
// copy match
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
.align 2
|
|
||||||
.LCOPYLONG: /* copy match using longwords */
|
.LCOPYLONG: /* copy match using longwords */
|
||||||
leal -3(%edi,%ecx), %eax
|
leal -3(%edi,%ecx), %eax
|
||||||
shrl $2, %ecx
|
shrl $2, %ecx
|
||||||
|
@ -202,7 +198,6 @@ lzo1x_decompress:
|
||||||
jmp .LMATCH
|
jmp .LMATCH
|
||||||
|
|
||||||
|
|
||||||
.align 8
|
|
||||||
.LCOPYBYTE: /* copy match using bytes */
|
.LCOPYBYTE: /* copy match using bytes */
|
||||||
xchgl %edx,%esi
|
xchgl %edx,%esi
|
||||||
subl N_3,%ecx
|
subl N_3,%ecx
|
||||||
|
@ -226,7 +221,6 @@ lzo1x_decompress:
|
||||||
jmp 3f
|
jmp 3f
|
||||||
|
|
||||||
|
|
||||||
.align 8
|
|
||||||
.LM4MATCH:
|
.LM4MATCH:
|
||||||
cmpb $16, %al
|
cmpb $16, %al
|
||||||
jb .LM1MATCH
|
jb .LM1MATCH
|
||||||
|
@ -252,7 +246,6 @@ lzo1x_decompress:
|
||||||
// M1
|
// M1
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
.align 8
|
|
||||||
.LM1MATCH:
|
.LM1MATCH:
|
||||||
/* a M1 match */
|
/* a M1 match */
|
||||||
shrl $2, %eax
|
shrl $2, %eax
|
||||||
|
|
|
@ -478,6 +478,11 @@ gate_a20_check_state:
|
||||||
|
|
||||||
#include "lzo1x.S"
|
#include "lzo1x.S"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The code beyond this point is compressed. Assert that the uncompressed
|
||||||
|
* code fits GRUB_KERNEL_MACHINE_RAW_SIZE.
|
||||||
|
*/
|
||||||
|
. = EXT_C(start) + GRUB_KERNEL_MACHINE_RAW_SIZE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This call is special... it never returns... in fact it should simply
|
* This call is special... it never returns... in fact it should simply
|
||||||
|
|
Loading…
Add table
Reference in a new issue