Re: Building a kernel without a 32 bit gcc
On Fri, Apr 02, 2004 at 03:10:09PM -0700, Greg Johnson wrote:
> Folks,
>
> The attached patch to linux-2.6.4 eliminates the need for a 32 bit gcc
> for building a kernel which supports 32 bit executables. It is still
> necessary to have a biarch binutils, but ours is already biarch capable.
Ok, here's the attachment.
Greg
diff -urN linux-2.6.4/arch/x86_64/boot/compressed/Makefile linux-2.6.4-patched/arch/x86_64/boot/compressed/Makefile
--- linux-2.6.4/arch/x86_64/boot/compressed/Makefile 2004-03-10 20:55:25.000000000 -0600
+++ linux-2.6.4-patched/arch/x86_64/boot/compressed/Makefile 2004-04-02 15:36:18.269358752 -0600
@@ -7,15 +7,18 @@
#
targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
-EXTRA_AFLAGS := -traditional -m32
+EXTRA_AFLAGS := -traditional -Wa,--32
# cannot use EXTRA_CFLAGS because base CFLAGS contains -mkernel which conflicts with
# -m32
-CFLAGS := -m32 -D__KERNEL__ -Iinclude -O2
+CFLAGS := -Wa,--32 -D__KERNEL__ -Iinclude -O2
LDFLAGS := -m elf_i386
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32 -m elf_i386
+# this can build misc.o from misc.c with a cross compiler
+#$(obj)/misc.o: CC=i386-pc-linux-gnu-gcc
+
$(obj)/vmlinux: $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld)
@:
diff -urN linux-2.6.4/arch/x86_64/boot/compressed/misc.S linux-2.6.4-patched/arch/x86_64/boot/compressed/misc.S
--- linux-2.6.4/arch/x86_64/boot/compressed/misc.S 1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.4-patched/arch/x86_64/boot/compressed/misc.S 2004-04-02 11:45:58.365303512 -0600
@@ -0,0 +1,3180 @@
+ .file "misc.c"
+ .local insize
+ .comm insize,4,4
+ .local inptr
+ .comm inptr,4,4
+ .local outcnt
+ .comm outcnt,4,4
+ .local bytes_out
+ .comm bytes_out,4,4
+ .local output_ptr
+ .comm output_ptr,4,4
+ .data
+ .align 4
+ .type free_mem_ptr, @object
+ .size free_mem_ptr, 4
+free_mem_ptr:
+ .long end
+ .local high_loaded
+ .comm high_loaded,4,4
+ .align 4
+ .type vidmem, @object
+ .size vidmem, 4
+vidmem:
+ .long 753664
+ .section .rodata
+ .align 32
+ .type border, @object
+ .size border, 76
+border:
+ .long 16
+ .long 17
+ .long 18
+ .long 0
+ .long 8
+ .long 7
+ .long 9
+ .long 6
+ .long 10
+ .long 5
+ .long 11
+ .long 4
+ .long 12
+ .long 3
+ .long 13
+ .long 2
+ .long 14
+ .long 1
+ .long 15
+ .align 32
+ .type cplens, @object
+ .size cplens, 62
+cplens:
+ .value 3
+ .value 4
+ .value 5
+ .value 6
+ .value 7
+ .value 8
+ .value 9
+ .value 10
+ .value 11
+ .value 13
+ .value 15
+ .value 17
+ .value 19
+ .value 23
+ .value 27
+ .value 31
+ .value 35
+ .value 43
+ .value 51
+ .value 59
+ .value 67
+ .value 83
+ .value 99
+ .value 115
+ .value 131
+ .value 163
+ .value 195
+ .value 227
+ .value 258
+ .value 0
+ .value 0
+ .align 32
+ .type cplext, @object
+ .size cplext, 62
+cplext:
+ .value 0
+ .value 0
+ .value 0
+ .value 0
+ .value 0
+ .value 0
+ .value 0
+ .value 0
+ .value 1
+ .value 1
+ .value 1
+ .value 1
+ .value 2
+ .value 2
+ .value 2
+ .value 2
+ .value 3
+ .value 3
+ .value 3
+ .value 3
+ .value 4
+ .value 4
+ .value 4
+ .value 4
+ .value 5
+ .value 5
+ .value 5
+ .value 5
+ .value 0
+ .value 99
+ .value 99
+ .align 32
+ .type cpdist, @object
+ .size cpdist, 60
+cpdist:
+ .value 1
+ .value 2
+ .value 3
+ .value 4
+ .value 5
+ .value 7
+ .value 9
+ .value 13
+ .value 17
+ .value 25
+ .value 33
+ .value 49
+ .value 65
+ .value 97
+ .value 129
+ .value 193
+ .value 257
+ .value 385
+ .value 513
+ .value 769
+ .value 1025
+ .value 1537
+ .value 2049
+ .value 3073
+ .value 4097
+ .value 6145
+ .value 8193
+ .value 12289
+ .value 16385
+ .value 24577
+ .align 32
+ .type cpdext, @object
+ .size cpdext, 60
+cpdext:
+ .value 0
+ .value 0
+ .value 0
+ .value 0
+ .value 1
+ .value 1
+ .value 2
+ .value 2
+ .value 3
+ .value 3
+ .value 4
+ .value 4
+ .value 5
+ .value 5
+ .value 6
+ .value 6
+ .value 7
+ .value 7
+ .value 8
+ .value 8
+ .value 9
+ .value 9
+ .value 10
+ .value 10
+ .value 11
+ .value 11
+ .value 12
+ .value 12
+ .value 13
+ .value 13
+ .align 32
+ .type mask_bits, @object
+ .size mask_bits, 34
+mask_bits:
+ .value 0
+ .value 1
+ .value 3
+ .value 7
+ .value 15
+ .value 31
+ .value 63
+ .value 127
+ .value 255
+ .value 511
+ .value 1023
+ .value 2047
+ .value 4095
+ .value 8191
+ .value 16383
+ .value 32767
+ .value -1
+ .align 4
+ .type lbits, @object
+ .size lbits, 4
+lbits:
+ .long 9
+ .align 4
+ .type dbits, @object
+ .size dbits, 4
+dbits:
+ .long 6
+ .text
+ .p2align 2,,3
+ .type huft_build, @function
+huft_build:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $1452, %esp
+ cld
+ movl $17, %ecx
+ xorl %eax, %eax
+ leal -104(%ebp), %edi
+ movl 8(%ebp), %esi
+ movl $0, -1432(%ebp)
+ movl $0, -1428(%ebp)
+ movl 32(%ebp), %edx
+ rep
+ stosl
+ movl 12(%ebp), %ebx
+ movl %esi, -1424(%ebp)
+ .p2align 2,,3
+.L2:
+ movl -1424(%ebp), %ecx
+ movl (%ecx), %eax
+ incl -104(%ebp,%eax,4)
+ addl $4, %ecx
+ decl %ebx
+ movl %ecx, -1424(%ebp)
+ jne .L2
+ movl 12(%ebp), %eax
+ cmpl %eax, -104(%ebp)
+ je .L102
+ movl (%edx), %eax
+ movl %eax, -1420(%ebp)
+ movl $1, %edi
+ .p2align 2,,3
+.L12:
+ movl -104(%ebp,%edi,4), %eax
+ testl %eax, %eax
+ jne .L8
+ incl %edi
+ cmpl $16, %edi
+ jbe .L12
+.L8:
+ cmpl %edi, -1420(%ebp)
+ movl %edi, -1416(%ebp)
+ jae .L13
+ movl %edi, -1420(%ebp)
+.L13:
+ movl $16, %ebx
+ .p2align 2,,3
+.L19:
+ movl -104(%ebp,%ebx,4), %eax
+ testl %eax, %eax
+ jne .L15
+ decl %ebx
+ jne .L19
+.L15:
+ cmpl %ebx, -1420(%ebp)
+ movl %ebx, -1408(%ebp)
+ jbe .L20
+ movl %ebx, -1420(%ebp)
+.L20:
+ movl $1, -1440(%ebp)
+ movl %edi, %ecx
+ movl -1420(%ebp), %eax
+ sall %cl, -1440(%ebp)
+ cmpl -1408(%ebp), %edi
+ movl %eax, (%edx)
+ jae .L85
+ .p2align 2,,3
+.L26:
+ movl -104(%ebp,%edi,4), %eax
+ subl %eax, -1440(%ebp)
+ js .L101
+ incl %edi
+ sall -1440(%ebp)
+ cmpl %ebx, %edi
+ jb .L26
+.L85:
+ movl -104(%ebp,%ebx,4), %eax
+ subl %eax, -1440(%ebp)
+ js .L101
+ addl -1440(%ebp), %eax
+ movl %eax, -104(%ebp,%ebx,4)
+ xorl %edi, %edi
+ leal -100(%ebp), %edx
+ decl %ebx
+ movl $0, -1396(%ebp)
+ movl %edx, -1424(%ebp)
+ leal -1392(%ebp), %ecx
+ je .L87
+ .p2align 2,,3
+.L31:
+ movl -1424(%ebp), %eax
+ addl (%eax), %edi
+ movl %edi, (%ecx)
+ addl $4, %eax
+ addl $4, %ecx
+ decl %ebx
+ movl %eax, -1424(%ebp)
+ jne .L31
+.L87:
+ movl %esi, -1424(%ebp)
+ xorl %ebx, %ebx
+ .p2align 2,,3
+.L32:
+ movl -1424(%ebp), %edx
+ movl (%edx), %edi
+ addl $4, %edx
+ testl %edi, %edi
+ movl %edx, -1424(%ebp)
+ je .L34
+ movl -1400(%ebp,%edi,4), %eax
+ movl %ebx, -1320(%ebp,%eax,4)
+ incl %eax
+ movl %eax, -1400(%ebp,%edi,4)
+.L34:
+ incl %ebx
+ cmpl 12(%ebp), %ebx
+ jb .L32
+ movl -1420(%ebp), %eax
+ movl -1408(%ebp), %edx
+ negl %eax
+ xorl %ebx, %ebx
+ leal -1320(%ebp), %ecx
+ xorl %esi, %esi
+ cmpl %edx, -1416(%ebp)
+ movl $0, -1400(%ebp)
+ movl %ecx, -1424(%ebp)
+ movl $-1, -1412(%ebp)
+ movl %eax, -1436(%ebp)
+ movl $0, -168(%ebp)
+ movl $0, -1444(%ebp)
+ jg .L89
+.L80:
+ movl -1416(%ebp), %ecx
+ movl -104(%ebp,%ecx,4), %eax
+ decl %eax
+ movl %eax, -1404(%ebp)
+ incl %eax
+ je .L91
+ .p2align 2,,3
+.L79:
+ movl -1436(%ebp), %edx
+ addl -1420(%ebp), %edx
+ cmpl %edx, -1416(%ebp)
+ movl %edx, -1448(%ebp)
+ jle .L93
+ movl -1404(%ebp), %ecx
+ incl %ecx
+ movl %ecx, -1452(%ebp)
+ .p2align 2,,3
+.L58:
+ movl -1448(%ebp), %eax
+ movl -1408(%ebp), %edx
+ subl %eax, %edx
+ movl -1420(%ebp), %esi
+ incl -1412(%ebp)
+ cmpl %esi, %edx
+ movl %eax, -1436(%ebp)
+ movl %edx, -1444(%ebp)
+ ja .L48
+ movl %edx, %esi
+.L48:
+ movl -1416(%ebp), %edi
+ subl -1448(%ebp), %edi
+ movl $1, %eax
+ movl %edi, %ecx
+ sall %cl, %eax
+ cmpl -1452(%ebp), %eax
+ movl %esi, -1444(%ebp)
+ jbe .L49
+ subl -1404(%ebp), %eax
+ incl %edi
+ decl %eax
+ movl -1416(%ebp), %edx
+ cmpl %esi, %edi
+ leal -104(%ebp,%edx,4), %ecx
+ jae .L49
+ .p2align 2,,3
+.L54:
+ addl $4, %ecx
+ sall %eax
+ movl (%ecx), %edx
+ cmpl %edx, %eax
+ jbe .L49
+ incl %edi
+ subl %edx, %eax
+ cmpl %esi, %edi
+ jb .L54
+ .p2align 2,,3
+.L49:
+ movl %edi, %ecx
+ movl $1, %eax
+ sall %cl, %eax
+ subl $12, %esp
+ movl %eax, -1444(%ebp)
+ leal 8(,%eax,8), %eax
+ pushl %eax
+ call malloc
+ addl $16, %esp
+ testl %eax, %eax
+ movl %eax, %esi
+ je .L103
+ movl -1444(%ebp), %eax
+ addl hufts, %eax
+ incl %eax
+ movl 28(%ebp), %edx
+ movl %eax, hufts
+ leal 8(%esi), %eax
+ movl %eax, (%edx)
+ leal 4(%esi), %ecx
+ movl $0, 4(%esi)
+ movl %eax, %esi
+ movl -1412(%ebp), %eax
+ testl %eax, %eax
+ movl %ecx, 28(%ebp)
+ movl %esi, -168(%ebp,%eax,4)
+ je .L44
+ movl -1448(%ebp), %ecx
+ movl -1432(%ebp), %edx
+ subl -1420(%ebp), %ecx
+ movb -1420(%ebp), %dh
+ movl %ebx, -1400(%ebp,%eax,4)
+ leal 16(%edi), %eax
+ movl %ebx, %edi
+ movl %edx, -1432(%ebp)
+ movl %esi, -1428(%ebp)
+ movb %al, -1432(%ebp)
+ shrl %cl, %edi
+ movl -1412(%ebp), %ecx
+ movl -172(%ebp,%ecx,4), %eax
+ movl -1432(%ebp), %edx
+ movl -1428(%ebp), %ecx
+ movl %ecx, 4(%eax,%edi,8)
+ movl %edx, (%eax,%edi,8)
+.L44:
+ movl -1420(%ebp), %ecx
+ addl %ecx, -1448(%ebp)
+ movl -1448(%ebp), %eax
+ cmpl %eax, -1416(%ebp)
+ jg .L58
+.L93:
+ movb -1416(%ebp), %al
+ subb -1436(%ebp), %al
+ movl 12(%ebp), %ecx
+ movl -1432(%ebp), %edx
+ movb %al, %dh
+ leal -1320(%ebp,%ecx,4), %eax
+ cmpl %eax, -1424(%ebp)
+ movl %edx, -1432(%ebp)
+ jb .L59
+ movb $99, -1432(%ebp)
+.L60:
+ movl -1416(%ebp), %ecx
+ subl -1436(%ebp), %ecx
+ movl $1, %eax
+ sall %cl, %eax
+ movl %ebx, %edi
+ movb -1436(%ebp), %cl
+ shrl %cl, %edi
+ cmpl -1444(%ebp), %edi
+ jae .L96
+ .p2align 2,,3
+.L69:
+ movl -1432(%ebp), %edx
+ movl -1428(%ebp), %ecx
+ movl %ecx, 4(%esi,%edi,8)
+ movl %edx, (%esi,%edi,8)
+ addl %eax, %edi
+ cmpl -1444(%ebp), %edi
+ jb .L69
+.L96:
+ movl -1416(%ebp), %ecx
+ decl %ecx
+ movl $1, %edi
+ sall %cl, %edi
+ testl %edi, %ebx
+ je .L98
+ .p2align 2,,3
+.L74:
+ xorl %edi, %ebx
+ shrl %edi
+ testl %edi, %ebx
+ jne .L74
+.L98:
+ movl $1, %eax
+ movb -1436(%ebp), %cl
+ sall %cl, %eax
+ xorl %edi, %ebx
+ decl %eax
+ andl %ebx, %eax
+ movl -1412(%ebp), %edx
+ cmpl -1400(%ebp,%edx,4), %eax
+ je .L100
+ movl $1, %edx
+ .p2align 2,,3
+.L78:
+ movl -1420(%ebp), %ecx
+ subl %ecx, -1436(%ebp)
+ movb -1436(%ebp), %cl
+ movl %edx, %eax
+ sall %cl, %eax
+ decl -1412(%ebp)
+ decl %eax
+ andl %ebx, %eax
+ movl -1412(%ebp), %ecx
+ cmpl -1400(%ebp,%ecx,4), %eax
+ jne .L78
+.L100:
+ decl -1404(%ebp)
+ cmpl $-1, -1404(%ebp)
+ jne .L79
+.L91:
+ incl -1416(%ebp)
+ movl -1408(%ebp), %eax
+ cmpl %eax, -1416(%ebp)
+ jle .L80
+.L89:
+ movl -1440(%ebp), %edx
+ xorl %eax, %eax
+ testl %edx, %edx
+ je .L1
+ cmpl $1, -1408(%ebp)
+ je .L1
+ movl $1, %eax
+.L1:
+ leal -12(%ebp), %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ ret
+.L59:
+ movl -1424(%ebp), %edx
+ movl (%edx), %eax
+ cmpl 16(%ebp), %eax
+ jae .L61
+ cmpl $255, %eax
+ seta %al
+ movl -1424(%ebp), %ecx
+ movb $16, %dl
+ subb %al, %dl
+ movw (%ecx), %ax
+ addl $4, %ecx
+ movb %dl, -1432(%ebp)
+ movw %ax, -1428(%ebp)
+ movl %ecx, -1424(%ebp)
+ jmp .L60
+.L61:
+ subl 16(%ebp), %eax
+ movl 24(%ebp), %ecx
+ movb (%ecx,%eax,2), %dl
+ movb %dl, -1432(%ebp)
+ movl 20(%ebp), %edx
+ movw (%edx,%eax,2), %ax
+ movw %ax, -1428(%ebp)
+ addl $4, -1424(%ebp)
+ jmp .L60
+.L103:
+ movl -1412(%ebp), %ecx
+ testl %ecx, %ecx
+ jne .L104
+.L56:
+ movl $3, %eax
+ jmp .L1
+.L104:
+ subl $12, %esp
+ pushl -168(%ebp)
+ call huft_free
+ addl $16, %esp
+ jmp .L56
+.L101:
+ movl $2, %eax
+ jmp .L1
+.L102:
+ movl 28(%ebp), %ecx
+ xorl %eax, %eax
+ movl $0, (%ecx)
+ movl $0, (%edx)
+ jmp .L1
+ .size huft_build, .-huft_build
+ .p2align 2,,3
+ .type huft_free, @function
+huft_free:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %ebx
+ pushl %eax
+ movl 8(%ebp), %eax
+ testl %eax, %eax
+ je .L111
+ .p2align 2,,3
+.L109:
+ subl $8, %eax
+ subl $12, %esp
+ movl 4(%eax), %ebx
+ pushl %eax
+ call free
+ addl $16, %esp
+ testl %ebx, %ebx
+ movl %ebx, %eax
+ jne .L109
+.L111:
+ xorl %eax, %eax
+ movl -4(%ebp), %ebx
+ leave
+ ret
+ .size huft_free, .-huft_free
+ .p2align 2,,3
+ .type inflate_codes, @function
+inflate_codes:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $28, %esp
+ movl bb, %eax
+ movl %eax, -32(%ebp)
+ movl 16(%ebp), %ecx
+ movl 20(%ebp), %eax
+ movl outcnt, %edx
+ movzwl mask_bits(%ecx,%ecx), %ecx
+ movzwl mask_bits(%eax,%eax), %eax
+ movl bk, %edi
+ movl %edx, -20(%ebp)
+ movl %ecx, -24(%ebp)
+ movl %eax, -28(%ebp)
+.L204:
+ cmpl 16(%ebp), %edi
+ jae .L191
+ .p2align 2,,3
+.L123:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L119
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L120:
+ testl %ecx, %ecx
+ js .L122
+ movzbl %cl, %eax
+ movl %edi, %ecx
+ sall %cl, %eax
+ addl $8, %edi
+ orl %eax, -32(%ebp)
+ cmpl 16(%ebp), %edi
+ jb .L123
+.L191:
+ movl -32(%ebp), %eax
+ andl -24(%ebp), %eax
+ movl 8(%ebp), %edx
+ leal (%edx,%eax,8), %ebx
+ movzbl (%ebx), %esi
+ cmpl $16, %esi
+ jbe .L124
+ .p2align 2,,3
+.L125:
+ cmpl $99, %esi
+ movl $1, %eax
+ je .L112
+ movzbl 1(%ebx), %ecx
+ subl %ecx, %edi
+ subl $16, %esi
+ shrl %cl, -32(%ebp)
+ cmpl %esi, %edi
+ jae .L193
+ .p2align 2,,3
+.L135:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L132
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L133:
+ testl %ecx, %ecx
+ js .L122
+ movzbl %cl, %eax
+ movl %edi, %ecx
+ sall %cl, %eax
+ addl $8, %edi
+ orl %eax, -32(%ebp)
+ cmpl %esi, %edi
+ jb .L135
+.L193:
+ movzwl mask_bits(%esi,%esi), %eax
+ andl -32(%ebp), %eax
+ movl 4(%ebx), %edx
+ leal (%edx,%eax,8), %ebx
+ movzbl (%ebx), %esi
+ cmpl $16, %esi
+ ja .L125
+.L124:
+ movzbl 1(%ebx), %ecx
+ shrl %cl, -32(%ebp)
+ subl %ecx, %edi
+ cmpl $16, %esi
+ je .L205
+ cmpl $15, %esi
+ je .L114
+ cmpl %esi, %edi
+ jae .L195
+ .p2align 2,,3
+.L147:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L144
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L145:
+ testl %ecx, %ecx
+ js .L122
+ movzbl %cl, %eax
+ movl %edi, %ecx
+ sall %cl, %eax
+ addl $8, %edi
+ orl %eax, -32(%ebp)
+ cmpl %esi, %edi
+ jb .L147
+.L195:
+ movzwl mask_bits(%esi,%esi), %eax
+ movzwl 4(%ebx), %edx
+ andl -32(%ebp), %eax
+ movl %esi, %ecx
+ subl %esi, %edi
+ leal (%eax,%edx), %eax
+ shrl %cl, -32(%ebp)
+ cmpl 20(%ebp), %edi
+ movl %eax, -16(%ebp)
+ jae .L197
+ .p2align 2,,3
+.L154:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L151
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L152:
+ testl %ecx, %ecx
+ js .L122
+ movzbl %cl, %eax
+ movl %edi, %ecx
+ sall %cl, %eax
+ addl $8, %edi
+ orl %eax, -32(%ebp)
+ cmpl 20(%ebp), %edi
+ jb .L154
+.L197:
+ movl -32(%ebp), %eax
+ andl -28(%ebp), %eax
+ movl 12(%ebp), %edx
+ leal (%edx,%eax,8), %ebx
+ movzbl (%ebx), %esi
+ cmpl $16, %esi
+ jbe .L155
+.L156:
+ cmpl $99, %esi
+ movl $1, %eax
+ je .L112
+ movzbl 1(%ebx), %ecx
+ subl %ecx, %edi
+ subl $16, %esi
+ shrl %cl, -32(%ebp)
+ cmpl %esi, %edi
+ jae .L199
+ .p2align 2,,3
+.L166:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L163
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L164:
+ testl %ecx, %ecx
+ js .L122
+ movzbl %cl, %eax
+ movl %edi, %ecx
+ sall %cl, %eax
+ addl $8, %edi
+ orl %eax, -32(%ebp)
+ cmpl %esi, %edi
+ jb .L166
+.L199:
+ movzwl mask_bits(%esi,%esi), %eax
+ andl -32(%ebp), %eax
+ movl 4(%ebx), %edx
+ leal (%edx,%eax,8), %ebx
+ movzbl (%ebx), %esi
+ cmpl $16, %esi
+ ja .L156
+.L155:
+ movzbl 1(%ebx), %ecx
+ subl %ecx, %edi
+ shrl %cl, -32(%ebp)
+ cmpl %esi, %edi
+ jae .L201
+.L174:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L171
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L172:
+ testl %ecx, %ecx
+ js .L122
+ movzbl %cl, %eax
+ movl %edi, %ecx
+ sall %cl, %eax
+ addl $8, %edi
+ orl %eax, -32(%ebp)
+ cmpl %esi, %edi
+ jb .L174
+.L201:
+ movzwl 4(%ebx), %eax
+ movl -20(%ebp), %ebx
+ subl %eax, %ebx
+ movzwl mask_bits(%esi,%esi), %eax
+ andl -32(%ebp), %eax
+ movl %esi, %ecx
+ subl %eax, %ebx
+ shrl %cl, -32(%ebp)
+ subl %esi, %edi
+ .p2align 2,,3
+.L175:
+ andl $32767, %ebx
+ cmpl -20(%ebp), %ebx
+ jbe .L180
+ movl $32768, %esi
+ subl %ebx, %esi
+.L181:
+ movl -16(%ebp), %ecx
+ cmpl %ecx, %esi
+ ja .L179
+ movl %esi, %ecx
+.L179:
+ movl -20(%ebp), %eax
+ subl %ebx, %eax
+ subl %ecx, -16(%ebp)
+ cmpl %ecx, %eax
+ movl %ecx, %esi
+ jae .L206
+ .p2align 2,,3
+.L184:
+ movl -20(%ebp), %edx
+ movb window(%ebx), %al
+ movb %al, window(%edx)
+ incl %ebx
+ incl %edx
+ decl %esi
+ movl %edx, -20(%ebp)
+ jne .L184
+.L183:
+ cmpl $32768, -20(%ebp)
+ je .L207
+.L177:
+ movl -16(%ebp), %eax
+ testl %eax, %eax
+ jne .L175
+ jmp .L204
+.L207:
+ movl $32768, outcnt
+ call flush_window
+ movl $0, -20(%ebp)
+ jmp .L177
+.L206:
+ pushl %ecx
+ pushl %esi
+ leal window(%ebx), %eax
+ movl -20(%ebp), %edx
+ pushl %eax
+ addl $window, %edx
+ pushl %edx
+ call memcpy
+ addl %esi, %ebx
+ addl %esi, -20(%ebp)
+ addl $16, %esp
+ jmp .L183
+.L180:
+ movl $32768, %esi
+ subl -20(%ebp), %esi
+ jmp .L181
+ .p2align 2,,3
+.L122:
+ movl $4, %eax
+.L112:
+ leal -12(%ebp), %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ ret
+.L171:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L172
+.L163:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L164
+.L151:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L152
+.L144:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L145
+.L114:
+ movl -32(%ebp), %eax
+ movl -20(%ebp), %ecx
+ movl %eax, bb
+ xorl %eax, %eax
+ movl %ecx, outcnt
+ movl %edi, bk
+ jmp .L112
+ .p2align 2,,3
+.L205:
+ movl -20(%ebp), %edx
+ movb 4(%ebx), %al
+ movb %al, window(%edx)
+ incl %edx
+ cmpl $32768, %edx
+ movl %edx, -20(%ebp)
+ jne .L204
+ movl $32768, outcnt
+ call flush_window
+ movl $0, -20(%ebp)
+ jmp .L204
+ .p2align 2,,3
+.L132:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L133
+ .p2align 2,,3
+.L119:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L120
+ .size inflate_codes, .-inflate_codes
+ .p2align 2,,3
+ .type inflate_stored, @function
+inflate_stored:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $12, %esp
+ movl bk, %ebx
+ movl %ebx, %edi
+ andl $7, %edi
+ movl bb, %esi
+ movl %edi, %ecx
+ subl %edi, %ebx
+ movl outcnt, %eax
+ shrl %cl, %esi
+ cmpl $15, %ebx
+ movl %eax, -16(%ebp)
+ ja .L238
+ .p2align 2,,3
+.L216:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L212
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L213:
+ testl %ecx, %ecx
+ js .L215
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $15, %ebx
+ jbe .L216
+.L238:
+ movl %esi, %edi
+ subl $16, %ebx
+ andl $65535, %edi
+ shrl $16, %esi
+ cmpl $15, %ebx
+ ja .L240
+ .p2align 2,,3
+.L223:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L220
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L221:
+ testl %ecx, %ecx
+ js .L215
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $15, %ebx
+ jbe .L223
+.L240:
+ movl %esi, %eax
+ notl %eax
+ andl $65535, %eax
+ cmpl %eax, %edi
+ movl $1, %edx
+ je .L245
+.L208:
+ addl $12, %esp
+ popl %ebx
+ popl %esi
+ movl %edx, %eax
+ popl %edi
+ leave
+ ret
+.L245:
+ decl %edi
+ shrl $16, %esi
+ subl $16, %ebx
+ cmpl $-1, %edi
+ je .L242
+ .p2align 2,,3
+.L236:
+ cmpl $7, %ebx
+ ja .L244
+ .p2align 2,,3
+.L234:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L231
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L232:
+ testl %ecx, %ecx
+ js .L215
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $7, %ebx
+ jbe .L234
+.L244:
+ movl -16(%ebp), %edx
+ movl %esi, %eax
+ movb %al, window(%edx)
+ incl %edx
+ cmpl $32768, %edx
+ movl %edx, -16(%ebp)
+ je .L246
+.L235:
+ decl %edi
+ shrl $8, %esi
+ subl $8, %ebx
+ cmpl $-1, %edi
+ jne .L236
+.L242:
+ movl -16(%ebp), %ecx
+ xorl %edx, %edx
+ movl %ecx, outcnt
+ movl %esi, bb
+ movl %ebx, bk
+ jmp .L208
+.L246:
+ movl $32768, outcnt
+ call flush_window
+ movl $0, -16(%ebp)
+ jmp .L235
+ .p2align 2,,3
+.L215:
+ movl $4, %edx
+ jmp .L208
+ .p2align 2,,3
+.L231:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L232
+ .p2align 2,,3
+.L220:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L221
+ .p2align 2,,3
+.L212:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L213
+ .size inflate_stored, .-inflate_stored
+ .p2align 2,,3
+ .type inflate_fixed, @function
+inflate_fixed:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %esi
+ pushl %ebx
+ subl $1168, %esp
+ xorl %ebx, %ebx
+ .p2align 2,,3
+.L252:
+ movl $8, -1160(%ebp,%ebx,4)
+ incl %ebx
+ cmpl $143, %ebx
+ jle .L252
+ movl $144, %ebx
+.L257:
+ movl $9, -1160(%ebp,%ebx,4)
+ incl %ebx
+ cmpl $255, %ebx
+ jle .L257
+ cmpl $279, %ebx
+ jg .L281
+.L262:
+ movl $7, -1160(%ebp,%ebx,4)
+ incl %ebx
+ cmpl $279, %ebx
+ jle .L262
+.L281:
+ cmpl $287, %ebx
+ jg .L283
+.L267:
+ movl $8, -1160(%ebp,%ebx,4)
+ incl %ebx
+ cmpl $287, %ebx
+ jle .L267
+.L283:
+ pushl %eax
+ leal -1164(%ebp), %eax
+ pushl %eax
+ leal -1168(%ebp), %eax
+ pushl %eax
+ pushl $cplext
+ pushl $cplens
+ pushl $257
+ pushl $288
+ leal -1160(%ebp), %esi
+ pushl %esi
+ movl $7, -1164(%ebp)
+ call huft_build
+ addl $32, %esp
+ testl %eax, %eax
+ movl %eax, %ebx
+ movl %eax, %edx
+ jne .L247
+.L273:
+ movl $5, -1160(%ebp,%ebx,4)
+ incl %ebx
+ cmpl $29, %ebx
+ jle .L273
+ pushl %eax
+ leal -1172(%ebp), %eax
+ pushl %eax
+ leal -1176(%ebp), %eax
+ pushl %eax
+ pushl $cpdext
+ pushl $cpdist
+ pushl $0
+ pushl $30
+ pushl %esi
+ movl $5, -1172(%ebp)
+ call huft_build
+ addl $32, %esp
+ cmpl $1, %eax
+ movl %eax, %ebx
+ jle .L274
+ subl $12, %esp
+ pushl -1168(%ebp)
+ call huft_free
+ movl %ebx, %edx
+.L247:
+ leal -8(%ebp), %esp
+ popl %ebx
+ movl %edx, %eax
+ popl %esi
+ leave
+ ret
+.L274:
+ pushl -1172(%ebp)
+ pushl -1164(%ebp)
+ pushl -1176(%ebp)
+ pushl -1168(%ebp)
+ call inflate_codes
+ addl $16, %esp
+ testl %eax, %eax
+ movl $1, %edx
+ jne .L247
+ subl $12, %esp
+ pushl -1168(%ebp)
+ call huft_free
+ popl %ebx
+ pushl -1176(%ebp)
+ call huft_free
+ xorl %edx, %edx
+ jmp .L247
+ .size inflate_fixed, .-inflate_fixed
+ .section .rodata.str1.1,"aMS",@progbits,1
+.LC0:
+ .string "incomplete literal tree"
+.LC1:
+ .string "incomplete distance tree"
+ .text
+ .p2align 2,,3
+ .type inflate_dynamic, @function
+inflate_dynamic:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $1324, %esp
+ movl bk, %ebx
+ cmpl $4, %ebx
+ movl bb, %esi
+ ja .L389
+ .p2align 2,,3
+.L294:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L290
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L291:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $4, %ebx
+ jbe .L294
+.L389:
+ movl %esi, %eax
+ andl $31, %eax
+ subl $5, %ebx
+ addl $257, %eax
+ shrl $5, %esi
+ cmpl $4, %ebx
+ movl %eax, -1328(%ebp)
+ ja .L391
+ .p2align 2,,3
+.L301:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L298
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L299:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $4, %ebx
+ jbe .L301
+.L391:
+ movl %esi, %eax
+ andl $31, %eax
+ subl $5, %ebx
+ incl %eax
+ shrl $5, %esi
+ cmpl $3, %ebx
+ movl %eax, -1332(%ebp)
+ ja .L393
+ .p2align 2,,3
+.L308:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L305
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L306:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $3, %ebx
+ jbe .L308
+.L393:
+ movl %esi, %eax
+ andl $15, %eax
+ addl $4, %eax
+ shrl $4, %esi
+ subl $4, %ebx
+ cmpl $286, -1328(%ebp)
+ movl %eax, -1324(%ebp)
+ ja .L310
+ cmpl $30, -1332(%ebp)
+ jbe .L309
+.L310:
+ movl $1, %edx
+.L286:
+ leal -12(%ebp), %esp
+ popl %ebx
+ popl %esi
+ movl %edx, %eax
+ popl %edi
+ leave
+ ret
+.L309:
+ xorl %edi, %edi
+ cmpl -1324(%ebp), %edi
+ jae .L327
+.L322:
+ cmpl $2, %ebx
+ ja .L397
+ .p2align 2,,3
+.L321:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L318
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L319:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $2, %ebx
+ jbe .L321
+.L397:
+ movl border(,%edi,4), %edx
+ movl %esi, %eax
+ incl %edi
+ andl $7, %eax
+ shrl $3, %esi
+ subl $3, %ebx
+ cmpl -1324(%ebp), %edi
+ movl %eax, -1288(%ebp,%edx,4)
+ jb .L322
+ cmpl $18, %edi
+ ja .L399
+ .p2align 2,,3
+.L327:
+ movl border(,%edi,4), %eax
+ incl %edi
+ cmpl $18, %edi
+ movl $0, -1288(%ebp,%eax,4)
+ jbe .L327
+.L399:
+ leal -1292(%ebp), %eax
+ pushl %edx
+ pushl %eax
+ leal -1296(%ebp), %edx
+ pushl %edx
+ pushl $0
+ pushl $0
+ pushl $19
+ pushl $19
+ leal -1288(%ebp), %ecx
+ pushl %ecx
+ movl $7, -1292(%ebp)
+ call huft_build
+ addl $32, %esp
+ testl %eax, %eax
+ movl %eax, -1308(%ebp)
+ je .L328
+ decl %eax
+ je .L424
+.L422:
+ movl -1308(%ebp), %edx
+ jmp .L286
+.L424:
+ subl $12, %esp
+.L423:
+ pushl -1296(%ebp)
+ call huft_free
+ addl $16, %esp
+ jmp .L422
+.L328:
+ movl -1328(%ebp), %eax
+ addl -1332(%ebp), %eax
+ movl %eax, -1320(%ebp)
+ movl -1320(%ebp), %ecx
+ movl -1292(%ebp), %eax
+ movzwl mask_bits(%eax,%eax), %edx
+ cmpl %ecx, -1308(%ebp)
+ movl %edx, -1316(%ebp)
+ movl $0, -1312(%ebp)
+ jae .L401
+.L382:
+ cmpl %eax, %ebx
+ jae .L403
+.L339:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L336
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L337:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl -1292(%ebp), %ebx
+ jb .L339
+.L403:
+ movl -1316(%ebp), %edx
+ andl %esi, %edx
+ movl -1296(%ebp), %eax
+ leal (%eax,%edx,8), %edx
+ movzbl 1(%edx), %edi
+ movl %edi, %ecx
+ subl %edi, %ebx
+ movzwl 4(%edx), %edi
+ shrl %cl, %esi
+ cmpl $15, %edi
+ movl %edx, -1304(%ebp)
+ ja .L340
+ movl -1308(%ebp), %eax
+ movl %edi, -1288(%ebp,%eax,4)
+ incl %eax
+ movl %edi, -1312(%ebp)
+ movl %eax, -1308(%ebp)
+.L330:
+ movl -1320(%ebp), %eax
+ cmpl %eax, -1308(%ebp)
+ jae .L401
+ movl -1292(%ebp), %eax
+ jmp .L382
+.L401:
+ subl $12, %esp
+ pushl -1296(%ebp)
+ call huft_free
+ addl $12, %esp
+ leal -1292(%ebp), %edx
+ pushl %edx
+ leal -1296(%ebp), %ecx
+ pushl %ecx
+ pushl $cplext
+ pushl $cplens
+ pushl $257
+ pushl -1328(%ebp)
+ leal -1288(%ebp), %eax
+ pushl %eax
+ movl %esi, bb
+ movl %ebx, bk
+ movl $9, -1292(%ebp)
+ call huft_build
+ addl $32, %esp
+ testl %eax, %eax
+ movl %eax, -1308(%ebp)
+ je .L383
+ decl %eax
+ jne .L422
+ subl $12, %esp
+ pushl $.LC0
+ call error
+ popl %eax
+ jmp .L423
+.L383:
+ pushl %eax
+ leal -1300(%ebp), %eax
+ pushl %eax
+ leal -1304(%ebp), %eax
+ pushl %eax
+ pushl $cpdext
+ pushl $cpdist
+ pushl $0
+ movl -1328(%ebp), %edx
+ pushl -1332(%ebp)
+ leal -1288(%ebp,%edx,4), %eax
+ pushl %eax
+ movl $6, -1300(%ebp)
+ call huft_build
+ addl $32, %esp
+ testl %eax, %eax
+ movl %eax, -1308(%ebp)
+ je .L385
+ decl %eax
+ je .L425
+.L386:
+ subl $12, %esp
+ pushl -1296(%ebp)
+ call huft_free
+ jmp .L422
+.L425:
+ subl $12, %esp
+ pushl $.LC1
+ call error
+ popl %eax
+ pushl -1304(%ebp)
+ call huft_free
+ addl $16, %esp
+ jmp .L386
+.L385:
+ pushl -1300(%ebp)
+ pushl -1292(%ebp)
+ pushl -1304(%ebp)
+ pushl -1296(%ebp)
+ call inflate_codes
+ addl $16, %esp
+ testl %eax, %eax
+ movl $1, %edx
+ jne .L286
+ subl $12, %esp
+ pushl -1296(%ebp)
+ call huft_free
+ popl %eax
+ pushl -1304(%ebp)
+ call huft_free
+ xorl %edx, %edx
+ jmp .L286
+ .p2align 2,,3
+.L340:
+ cmpl $16, %edi
+ je .L426
+ cmpl $17, %edi
+ je .L427
+ cmpl $6, %ebx
+ ja .L413
+.L376:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L373
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L374:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $6, %ebx
+ jbe .L376
+.L413:
+ movl %esi, %ecx
+ andl $127, %ecx
+ movl -1308(%ebp), %edx
+ leal 11(%edx,%ecx), %eax
+ shrl $7, %esi
+ subl $7, %ebx
+ cmpl -1320(%ebp), %eax
+ movl $1, %edx
+ ja .L286
+ leal 10(%ecx), %edi
+ cmpl $-1, %edi
+ je .L415
+.L381:
+ movl -1308(%ebp), %ecx
+ decl %edi
+ movl $0, -1288(%ebp,%ecx,4)
+ incl %ecx
+ cmpl $-1, %edi
+ movl %ecx, -1308(%ebp)
+ jne .L381
+.L415:
+ movl $0, -1312(%ebp)
+ jmp .L330
+ .p2align 2,,3
+.L293:
+ movl $4, %edx
+ jmp .L286
+.L373:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L374
+.L427:
+ cmpl $2, %ebx
+ ja .L409
+.L363:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L360
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L361:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $2, %ebx
+ jbe .L363
+.L409:
+ movl %esi, %ecx
+ andl $7, %ecx
+ movl -1308(%ebp), %edx
+ leal 3(%edx,%ecx), %eax
+ shrl $3, %esi
+ subl $3, %ebx
+ cmpl -1320(%ebp), %eax
+ movl $1, %edx
+ ja .L286
+ leal 2(%ecx), %edi
+ cmpl $-1, %edi
+ je .L415
+.L368:
+ movl -1308(%ebp), %ecx
+ decl %edi
+ movl $0, -1288(%ebp,%ecx,4)
+ incl %ecx
+ cmpl $-1, %edi
+ movl %ecx, -1308(%ebp)
+ jne .L368
+ jmp .L415
+.L360:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L361
+.L426:
+ cmpl $1, %ebx
+ ja .L405
+.L349:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L346
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L347:
+ testl %ecx, %ecx
+ js .L293
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $1, %ebx
+ jbe .L349
+.L405:
+ movl %esi, %ecx
+ andl $3, %ecx
+ movl -1308(%ebp), %edx
+ leal 3(%edx,%ecx), %eax
+ shrl $2, %esi
+ subl $2, %ebx
+ cmpl -1320(%ebp), %eax
+ movl $1, %edx
+ ja .L286
+ leal 2(%ecx), %edi
+ cmpl $-1, %edi
+ je .L330
+.L354:
+ movl -1308(%ebp), %ecx
+ movl -1312(%ebp), %eax
+ decl %edi
+ movl %eax, -1288(%ebp,%ecx,4)
+ incl %ecx
+ cmpl $-1, %edi
+ movl %ecx, -1308(%ebp)
+ jne .L354
+ jmp .L330
+.L346:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L347
+.L336:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L337
+.L318:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L319
+ .p2align 2,,3
+.L305:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L306
+ .p2align 2,,3
+.L298:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L299
+ .p2align 2,,3
+.L290:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L291
+ .size inflate_dynamic, .-inflate_dynamic
+ .p2align 2,,3
+ .type inflate_block, @function
+inflate_block:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $12, %esp
+ movl bk, %ebx
+ testl %ebx, %ebx
+ movl 8(%ebp), %edi
+ movl bb, %esi
+ jne .L448
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L451
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L452:
+ testl %ecx, %ecx
+ js .L435
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ orl %eax, %esi
+ movl $8, %ebx
+.L448:
+ movl %esi, %eax
+ decl %ebx
+ andl $1, %eax
+ shrl %esi
+ cmpl $1, %ebx
+ movl %eax, (%edi)
+ ja .L450
+ .p2align 2,,3
+.L443:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L440
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L441:
+ testl %ecx, %ecx
+ js .L435
+ movzbl %cl, %eax
+ movb %bl, %cl
+ sall %cl, %eax
+ addl $8, %ebx
+ orl %eax, %esi
+ cmpl $1, %ebx
+ jbe .L443
+.L450:
+ movl %esi, %eax
+ andl $3, %eax
+ shrl $2, %esi
+ subl $2, %ebx
+ cmpl $2, %eax
+ movl %esi, bb
+ movl %ebx, bk
+ je .L455
+ testl %eax, %eax
+ je .L456
+ decl %eax
+ jne .L446
+ addl $12, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ jmp inflate_fixed
+.L446:
+ movl $2, %eax
+.L428:
+ addl $12, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ ret
+.L456:
+ addl $12, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ jmp inflate_stored
+.L455:
+ addl $12, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ jmp inflate_dynamic
+.L435:
+ movl $4, %eax
+ jmp .L428
+ .p2align 2,,3
+.L440:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L441
+.L451:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L452
+ .size inflate_block, .-inflate_block
+ .p2align 2,,3
+ .type inflate, @function
+inflate:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $12, %esp
+ xorl %edi, %edi
+ movl $0, outcnt
+ movl $0, bk
+ movl $0, bb
+ leal -16(%ebp), %esi
+ .p2align 2,,3
+.L458:
+ subl $12, %esp
+ pushl %esi
+ movl $0, hufts
+ call gzip_mark
+ leal -20(%ebp), %eax
+ movl %eax, (%esp)
+ call inflate_block
+ addl $16, %esp
+ testl %eax, %eax
+ movl %eax, %ebx
+ jne .L471
+ subl $12, %esp
+ pushl %esi
+ call gzip_release
+ movl hufts, %eax
+ addl $16, %esp
+ cmpl %edi, %eax
+ jbe .L460
+ movl %eax, %edi
+.L460:
+ movl -20(%ebp), %ecx
+ testl %ecx, %ecx
+ je .L458
+ movl bk, %edx
+ cmpl $7, %edx
+ jbe .L469
+ movl inptr, %ecx
+ .p2align 2,,3
+.L467:
+ leal -8(%edx), %eax
+ decl %ecx
+ cmpl $7, %eax
+ movl %eax, %edx
+ ja .L467
+ movl %ecx, inptr
+ movl %eax, bk
+.L469:
+ call flush_window
+ xorl %eax, %eax
+.L457:
+ leal -12(%ebp), %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ ret
+.L471:
+ subl $12, %esp
+ pushl %esi
+ call gzip_release
+ movl %ebx, %eax
+ jmp .L457
+ .size inflate, .-inflate
+ .section .rodata
+ .align 32
+ .type p.0, @object
+ .size p.0, 56
+p.0:
+ .long 0
+ .long 1
+ .long 2
+ .long 4
+ .long 5
+ .long 7
+ .long 8
+ .long 10
+ .long 11
+ .long 12
+ .long 16
+ .long 22
+ .long 23
+ .long 26
+ .text
+ .p2align 2,,3
+ .type makecrc, @function
+makecrc:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ xorl %esi, %esi
+ xorl %ebx, %ebx
+ movl $31, %edx
+ movl $1, %eax
+.L477:
+ movl %edx, %ecx
+ subl p.0(,%ebx,4), %ecx
+ movl %eax, %edi
+ sall %cl, %edi
+ incl %ebx
+ orl %edi, %esi
+ cmpl $13, %ebx
+ jbe .L477
+ movl $0, crc_32_tab
+ movl $1, %ebx
+ .p2align 2,,3
+.L489:
+ movl %ebx, %edx
+ orb $1, %dh
+ xorl %ecx, %ecx
+ cmpl $1, %edx
+ je .L495
+ .p2align 2,,3
+.L488:
+ movl %ecx, %eax
+ shrl %eax
+ andl $1, %ecx
+ je .L486
+ xorl %esi, %eax
+.L486:
+ testb $1, %dl
+ movl %eax, %ecx
+ je .L484
+ xorl %esi, %ecx
+.L484:
+ sarl %edx
+ cmpl $1, %edx
+ jne .L488
+.L495:
+ movl %ecx, crc_32_tab(,%ebx,4)
+ incl %ebx
+ cmpl $255, %ebx
+ jle .L489
+ popl %ebx
+ popl %esi
+ movl $-1, crc
+ popl %edi
+ leave
+ ret
+ .size makecrc, .-makecrc
+ .section .rodata.str1.1
+.LC2:
+ .string "bad gzip magic numbers"
+.LC13:
+ .string "length error"
+.LC12:
+ .string "crc error"
+.LC10:
+ .string "out of input data"
+ .section .rodata.str1.32,"aMS",@progbits,1
+ .align 32
+.LC7:
+ .string "invalid compressed format (err=1)"
+ .align 32
+.LC8:
+ .string "invalid compressed format (err=2)"
+ .section .rodata.str1.1
+.LC9:
+ .string "out of memory"
+ .section .rodata.str1.32
+ .align 32
+.LC11:
+ .string "invalid compressed format (other)"
+ .section .rodata.str1.1
+.LC6:
+ .string "Input has invalid flags"
+.LC5:
+ .string "Multi part input"
+.LC4:
+ .string "Input is encrypted"
+ .section .rodata.str1.32
+ .align 32
+.LC3:
+ .string "internal error, invalid method"
+ .text
+ .p2align 2,,3
+ .type gunzip, @function
+gunzip:
+ pushl %ebp
+ movl %esp, %ebp
+ movl inptr, %edx
+ pushl %esi
+ pushl %ebx
+ xorl %ebx, %ebx
+ cmpl insize, %edx
+ jae .L497
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L498:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ movb %cl, %bl
+ jae .L501
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L502:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ movb %cl, %bh
+ jae .L504
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L505:
+ testl %ecx, %ecx
+ js .L500
+ cmpb $31, %bl
+ movb %cl, %dl
+ jne .L508
+ movzbl %bh, %eax
+ cmpb $-117, %al
+ je .L507
+ cmpb $-98, %al
+ je .L507
+.L508:
+ subl $12, %esp
+ pushl $.LC2
+.L598:
+ call error
+.L599:
+ movl $-1, %eax
+.L496:
+ leal -8(%ebp), %esp
+ popl %ebx
+ popl %esi
+ leave
+ ret
+ .p2align 2,,3
+.L507:
+ cmpb $8, %dl
+ jne .L600
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L510
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %esi
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L511:
+ movl %esi, %edx
+ movzbl %dl, %eax
+ testb $32, %al
+ jne .L601
+ testb $2, %al
+ jne .L602
+ testl $192, %esi
+ jne .L603
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L515
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L516:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L518
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L519:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L521
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L522:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L524
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L525:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L527
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L528:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L530
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L531:
+ testl %ecx, %ecx
+ js .L500
+ testl $4, %esi
+ je .L533
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L534
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L535:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ movzbl %cl, %ebx
+ jae .L537
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L538:
+ testl %ecx, %ecx
+ js .L500
+ movzbl %cl, %eax
+ sall $8, %eax
+ orl %eax, %ebx
+ decl %ebx
+ cmpl $-1, %ebx
+ je .L533
+ .p2align 2,,3
+.L546:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L543
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L544:
+ testl %ecx, %ecx
+ js .L500
+ decl %ebx
+ cmpl $-1, %ebx
+ jne .L546
+ .p2align 2,,3
+.L533:
+ testl $8, %esi
+ je .L547
+ .p2align 2,,3
+.L548:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L551
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L552:
+ testl %ecx, %ecx
+ js .L500
+ testb %cl, %cl
+ jne .L548
+.L547:
+ andl $16, %esi
+ je .L554
+ .p2align 2,,3
+.L555:
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L558
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L559:
+ testl %ecx, %ecx
+ js .L500
+ testb %cl, %cl
+ jne .L555
+.L554:
+ call inflate
+ testl %eax, %eax
+ jne .L604
+ movl inptr, %edx
+ cmpl insize, %edx
+ jae .L570
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L571:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ movzbl %cl, %esi
+ jae .L573
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L574:
+ testl %ecx, %ecx
+ js .L500
+ movzbl %cl, %eax
+ sall $8, %eax
+ movl inptr, %edx
+ orl %eax, %esi
+ cmpl insize, %edx
+ jae .L576
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L577:
+ testl %ecx, %ecx
+ js .L500
+ movzbl %cl, %eax
+ sall $16, %eax
+ movl inptr, %edx
+ orl %eax, %esi
+ cmpl insize, %edx
+ jae .L579
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L580:
+ testl %ecx, %ecx
+ js .L500
+ sall $24, %ecx
+ movl inptr, %edx
+ orl %ecx, %esi
+ cmpl insize, %edx
+ jae .L582
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L583:
+ testl %ecx, %ecx
+ js .L500
+ movl inptr, %edx
+ cmpl insize, %edx
+ movzbl %cl, %ebx
+ jae .L585
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L586:
+ testl %ecx, %ecx
+ js .L500
+ movzbl %cl, %eax
+ sall $8, %eax
+ movl inptr, %edx
+ orl %eax, %ebx
+ cmpl insize, %edx
+ jae .L588
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L589:
+ testl %ecx, %ecx
+ js .L500
+ movzbl %cl, %eax
+ sall $16, %eax
+ movl inptr, %edx
+ orl %eax, %ebx
+ cmpl insize, %edx
+ jae .L591
+ movl inbuf, %eax
+ movzbl (%edx,%eax), %ecx
+ leal 1(%edx), %eax
+ movl %eax, inptr
+.L592:
+ testl %ecx, %ecx
+ js .L500
+ movl crc, %eax
+ sall $24, %ecx
+ notl %eax
+ orl %ecx, %ebx
+ cmpl %eax, %esi
+ jne .L605
+ cmpl bytes_out, %ebx
+ jne .L606
+ xorl %eax, %eax
+ jmp .L496
+.L606:
+ subl $12, %esp
+ pushl $.LC13
+ jmp .L598
+.L605:
+ subl $12, %esp
+ pushl $.LC12
+ jmp .L598
+ .p2align 2,,3
+.L500:
+ subl $12, %esp
+ pushl $.LC10
+ jmp .L598
+.L591:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L592
+.L588:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L589
+.L585:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L586
+.L582:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L583
+.L579:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L580
+.L576:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L577
+.L573:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L574
+.L570:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L571
+.L604:
+ cmpl $4, %eax
+ ja .L568
+ jmp *.L569(,%eax,4)
+ .section .rodata
+ .align 4
+ .align 4
+.L569:
+ .long .L599
+ .long .L564
+ .long .L565
+ .long .L566
+ .long .L567
+ .text
+.L564:
+ subl $12, %esp
+ pushl $.LC7
+.L597:
+ call error
+ addl $16, %esp
+ jmp .L599
+.L565:
+ subl $12, %esp
+ pushl $.LC8
+ jmp .L597
+.L566:
+ subl $12, %esp
+ pushl $.LC9
+ jmp .L597
+.L567:
+ subl $12, %esp
+ pushl $.LC10
+ jmp .L597
+.L568:
+ subl $12, %esp
+ pushl $.LC11
+ jmp .L597
+ .p2align 2,,3
+.L558:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L559
+ .p2align 2,,3
+.L551:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L552
+ .p2align 2,,3
+.L543:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L544
+.L537:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L538
+.L534:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L535
+.L530:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L531
+.L527:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L528
+.L524:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L525
+.L521:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L522
+.L518:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L519
+ .p2align 2,,3
+.L515:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L516
+.L603:
+ subl $12, %esp
+ pushl $.LC6
+ jmp .L598
+.L602:
+ subl $12, %esp
+ pushl $.LC5
+ jmp .L598
+.L601:
+ subl $12, %esp
+ pushl $.LC4
+ jmp .L598
+ .p2align 2,,3
+.L510:
+ call fill_inbuf
+ movl %eax, %esi
+ jmp .L511
+.L600:
+ subl $12, %esp
+ pushl $.LC3
+ jmp .L598
+ .p2align 2,,3
+.L504:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L505
+ .p2align 2,,3
+.L501:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L502
+ .p2align 2,,3
+.L497:
+ call fill_inbuf
+ movl %eax, %ecx
+ jmp .L498
+ .size gunzip, .-gunzip
+ .section .rodata.str1.1
+.LC16:
+ .string "Out of memory"
+.LC15:
+ .string "Memory error"
+.LC14:
+ .string "Malloc error"
+ .text
+ .p2align 2,,3
+ .type malloc, @function
+malloc:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %esi
+ movl 8(%ebp), %esi
+ testl %esi, %esi
+ pushl %ebx
+ js .L611
+.L608:
+ movl free_mem_ptr, %eax
+ testl %eax, %eax
+ jle .L612
+.L609:
+ leal 3(%eax), %ebx
+ andl $-4, %ebx
+ leal (%esi,%ebx), %eax
+ cmpl free_mem_end_ptr, %eax
+ movl %eax, free_mem_ptr
+ jge .L613
+.L610:
+ leal -8(%ebp), %esp
+ movl %ebx, %eax
+ popl %ebx
+ popl %esi
+ leave
+ ret
+ .p2align 2,,3
+.L613:
+ subl $12, %esp
+ pushl $.LC16
+ call error
+ addl $16, %esp
+ jmp .L610
+ .p2align 2,,3
+.L612:
+ subl $12, %esp
+ pushl $.LC15
+ call error
+ addl $16, %esp
+ movl free_mem_ptr, %eax
+ jmp .L609
+ .p2align 2,,3
+.L611:
+ subl $12, %esp
+ pushl $.LC14
+ call error
+ addl $16, %esp
+ jmp .L608
+ .size malloc, .-malloc
+ .p2align 2,,3
+ .type free, @function
+free:
+ pushl %ebp
+ movl %esp, %ebp
+ leave
+ ret
+ .size free, .-free
+ .p2align 2,,3
+ .type gzip_mark, @function
+gzip_mark:
+ pushl %ebp
+ movl %esp, %ebp
+ movl free_mem_ptr, %edx
+ movl 8(%ebp), %eax
+ movl %edx, (%eax)
+ leave
+ ret
+ .size gzip_mark, .-gzip_mark
+ .p2align 2,,3
+ .type gzip_release, @function
+gzip_release:
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ movl %eax, free_mem_ptr
+ leave
+ ret
+ .size gzip_release, .-gzip_release
+ .p2align 2,,3
+ .type scroll, @function
+scroll:
+ pushl %ebp
+ movl %esp, %ebp
+ subl $12, %esp
+ movl lines, %edx
+ movl cols, %eax
+ leal -2(%edx,%edx), %edx
+ imull %eax, %edx
+ movl vidmem, %ecx
+ pushl %edx
+ leal (%ecx,%eax,2), %eax
+ pushl %eax
+ pushl %ecx
+ call memcpy
+ movl lines, %eax
+ movl cols, %edx
+ leal -2(%eax,%eax), %ecx
+ imull %edx, %eax
+ imull %edx, %ecx
+ sall %eax
+ addl $16, %esp
+ cmpl %eax, %ecx
+ jge .L624
+ .p2align 2,,3
+.L622:
+ movl vidmem, %eax
+ movb $32, (%ecx,%eax)
+ movl cols, %eax
+ imull lines, %eax
+ addl $2, %ecx
+ sall %eax
+ cmpl %eax, %ecx
+ jl .L622
+.L624:
+ leave
+ ret
+ .size scroll, .-scroll
+ .p2align 2,,3
+ .type puts, @function
+puts:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $12, %esp
+ movl 8(%ebp), %edi
+ movb (%edi), %cl
+ movl real_mode, %eax
+ incl %edi
+ testb %cl, %cl
+ movzbl (%eax), %ebx
+ movzbl 1(%eax), %esi
+ je .L640
+ .p2align 2,,3
+.L634:
+ cmpb $10, %cl
+ je .L642
+ movl cols, %eax
+ imull %esi, %eax
+ leal (%eax,%ebx), %eax
+ movl vidmem, %edx
+ movb %cl, (%edx,%eax,2)
+ incl %ebx
+ cmpl cols, %ebx
+ jl .L626
+.L642:
+ incl %esi
+ xorl %ebx, %ebx
+ cmpl lines, %esi
+ jge .L643
+.L626:
+ movb (%edi), %cl
+ incl %edi
+ testb %cl, %cl
+ jne .L634
+ movl real_mode, %eax
+.L640:
+ movb %bl, (%eax)
+ movl real_mode, %eax
+ movl %esi, %edx
+ movb %dl, 1(%eax)
+ movl cols, %eax
+ imull %esi, %eax
+ leal (%eax,%ebx), %eax
+ movw vidport, %si
+ leal (%eax,%eax), %ebx
+ movl %esi, %edx
+ movb $14, %al
+#APP
+ outb %al,%dx
+outb %al,$0x80
+#NO_APP
+ movl %ebx, %eax
+ leal 1(%esi), %ecx
+ shrl $9, %eax
+ movl %ecx, %edx
+#APP
+ outb %al,%dx
+outb %al,$0x80
+#NO_APP
+ movb $15, %al
+ movl %esi, %edx
+#APP
+ outb %al,%dx
+outb %al,$0x80
+#NO_APP
+ movl %ebx, %eax
+ shrl %eax
+ movl %ecx, %edx
+#APP
+ outb %al,%dx
+outb %al,$0x80
+#NO_APP
+ addl $12, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ ret
+ .p2align 2,,3
+.L643:
+ call scroll
+ decl %esi
+ jmp .L626
+ .size puts, .-puts
+ .p2align 2,,3
+.globl memset
+ .type memset, @function
+memset:
+ pushl %ebp
+ movl %esp, %ebp
+ movl 16(%ebp), %ecx
+ xorl %edx, %edx
+ cmpl %ecx, %edx
+ pushl %ebx
+ movl 8(%ebp), %eax
+ movl 12(%ebp), %ebx
+ jae .L651
+ .p2align 2,,3
+.L649:
+ movb %bl, (%edx,%eax)
+ incl %edx
+ cmpl %ecx, %edx
+ jb .L649
+.L651:
+ movl (%esp), %ebx
+ leave
+ ret
+ .size memset, .-memset
+ .p2align 2,,3
+.globl memcpy
+ .type memcpy, @function
+memcpy:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %esi
+ pushl %ebx
+ xorl %edx, %edx
+ movl 16(%ebp), %ebx
+ cmpl %ebx, %edx
+ movl 8(%ebp), %ecx
+ movl 12(%ebp), %esi
+ jae .L659
+ .p2align 2,,3
+.L657:
+ movb (%edx,%esi), %al
+ movb %al, (%edx,%ecx)
+ incl %edx
+ cmpl %ebx, %edx
+ jb .L657
+.L659:
+ popl %ebx
+ movl %ecx, %eax
+ popl %esi
+ leave
+ ret
+ .size memcpy, .-memcpy
+ .section .rodata.str1.1
+.LC17:
+ .string "ran out of input data"
+ .text
+ .p2align 2,,3
+ .type fill_inbuf, @function
+fill_inbuf:
+ pushl %ebp
+ movl %esp, %ebp
+ subl $8, %esp
+ movl insize, %eax
+ testl %eax, %eax
+ jne .L662
+.L661:
+ movl input_len, %eax
+ movl %eax, insize
+ movl $input_data, inbuf
+ movzbl input_data, %eax
+ movl $1, inptr
+ leave
+ ret
+ .p2align 2,,3
+.L662:
+ subl $12, %esp
+ pushl $.LC17
+ call error
+ addl $16, %esp
+ jmp .L661
+ .size fill_inbuf, .-fill_inbuf
+ .p2align 2,,3
+ .type flush_window_low, @function
+flush_window_low:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ movl output_ptr, %edi
+ movl output_data, %ecx
+ xorl %ebx, %ebx
+ movl outcnt, %eax
+ addl %edi, %ecx
+ cmpl %eax, %ebx
+ movl crc, %edx
+ movl $window, %esi
+ jae .L670
+ .p2align 2,,3
+.L668:
+ movb (%esi), %al
+ movb %al, (%ecx)
+ xorl %edx, %eax
+ movzbl %al, %eax
+ shrl $8, %edx
+ xorl crc_32_tab(,%eax,4), %edx
+ incl %ebx
+ movl outcnt, %eax
+ incl %esi
+ incl %ecx
+ cmpl %eax, %ebx
+ jb .L668
+ movl output_ptr, %edi
+.L670:
+ popl %ebx
+ addl %eax, bytes_out
+ popl %esi
+ leal (%eax,%edi), %eax
+ movl %edx, crc
+ movl %eax, output_ptr
+ movl $0, outcnt
+ popl %edi
+ leave
+ ret
+ .size flush_window_low, .-flush_window_low
+ .p2align 2,,3
+ .type flush_window_high, @function
+flush_window_high:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %esi
+ pushl %ebx
+ movl outcnt, %eax
+ xorl %ebx, %ebx
+ cmpl %eax, %ebx
+ movl crc, %ecx
+ movl $window, %esi
+ jae .L679
+ .p2align 2,,3
+.L677:
+ movl output_data, %eax
+ movb (%esi), %dl
+ movb %dl, (%eax)
+ movl output_data, %eax
+ incl %eax
+ incl %esi
+ cmpl low_buffer_end, %eax
+ movl %eax, output_data
+ je .L680
+.L676:
+ xorl %ecx, %edx
+ movzbl %dl, %eax
+ shrl $8, %ecx
+ xorl crc_32_tab(,%eax,4), %ecx
+ incl %ebx
+ movl outcnt, %eax
+ cmpl %eax, %ebx
+ jb .L677
+.L679:
+ popl %ebx
+ movl %ecx, crc
+ addl %eax, bytes_out
+ movl $0, outcnt
+ popl %esi
+ leave
+ ret
+ .p2align 2,,3
+.L680:
+ movl high_buffer_start, %eax
+ movl %eax, output_data
+ jmp .L676
+ .size flush_window_high, .-flush_window_high
+ .p2align 2,,3
+ .type flush_window, @function
+flush_window:
+ pushl %ebp
+ movl high_loaded, %eax
+ testl %eax, %eax
+ movl %esp, %ebp
+ je .L682
+ leave
+ jmp flush_window_high
+ .p2align 2,,3
+.L682:
+ leave
+ jmp flush_window_low
+ .size flush_window, .-flush_window
+ .section .rodata.str1.1
+.LC18:
+ .string "\n\n"
+.LC19:
+ .string "\n\n -- System halted"
+ .text
+ .p2align 2,,3
+ .type error, @function
+error:
+ pushl %ebp
+ movl %esp, %ebp
+ subl $20, %esp
+ pushl $.LC18
+ call puts
+ popl %eax
+ pushl 8(%ebp)
+ call puts
+ movl $.LC19, (%esp)
+ call puts
+ addl $16, %esp
+ .p2align 2,,3
+.L685:
+ jmp .L685
+ .size error, .-error
+ .section .rodata.str1.1
+.LC20:
+ .string "Less than 2MB of memory"
+ .text
+ .p2align 2,,3
+.globl setup_normal_output_buffer
+ .type setup_normal_output_buffer, @function
+setup_normal_output_buffer:
+ pushl %ebp
+ movl %esp, %ebp
+ subl $8, %esp
+ movl real_mode, %edx
+ movzwl 2(%edx), %eax
+ movl 480(%edx), %ecx
+ cmpl %ecx, %eax
+ jae .L690
+ movl %ecx, %eax
+.L690:
+ cmpl $1023, %eax
+ jbe .L691
+.L689:
+ movl $1048576, output_data
+ movl %edx, free_mem_end_ptr
+ leave
+ ret
+ .p2align 2,,3
+.L691:
+ subl $12, %esp
+ pushl $.LC20
+ call error
+ addl $16, %esp
+ movl real_mode, %edx
+ jmp .L689
+ .size setup_normal_output_buffer, .-setup_normal_output_buffer
+ .section .rodata.str1.1
+.LC21:
+ .string "Less than 4MB of memory"
+ .text
+ .p2align 2,,3
+.globl setup_output_buffer_if_we_run_high
+ .type setup_output_buffer_if_we_run_high, @function
+setup_output_buffer_if_we_run_high:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %ebx
+ pushl %eax
+ movl real_mode, %eax
+ movzwl 2(%eax), %edx
+ movl 480(%eax), %eax
+ cmpl %eax, %edx
+ movl 8(%ebp), %ebx
+ movl $end+12288, high_buffer_start
+ jae .L694
+ movl %eax, %edx
+.L694:
+ cmpl $3071, %edx
+ jbe .L698
+.L693:
+ movl real_mode, %eax
+ cmpl $589824, %eax
+ movl $8192, output_data
+ movl $8192, (%ebx)
+ jbe .L695
+ movl $589824, %eax
+.L695:
+ movl %eax, %edx
+ andl $-4096, %edx
+ leal -8192(%edx), %eax
+ movl %edx, low_buffer_end
+ movl %eax, low_buffer_size
+ addl $1040384, %edx
+ movl high_buffer_start, %eax
+ cmpl %eax, %edx
+ movl $1, high_loaded
+ movl %eax, free_mem_end_ptr
+ jbe .L696
+ movl %edx, %eax
+ movl %edx, high_buffer_start
+ movl $0, 12(%ebx)
+.L697:
+ movl %eax, 8(%ebx)
+ movl -4(%ebp), %ebx
+ leave
+ ret
+ .p2align 2,,3
+.L696:
+ movl $-1, 12(%ebx)
+ jmp .L697
+ .p2align 2,,3
+.L698:
+ subl $12, %esp
+ pushl $.LC21
+ call error
+ addl $16, %esp
+ jmp .L693
+ .size setup_output_buffer_if_we_run_high, .-setup_output_buffer_if_we_run_high
+ .p2align 2,,3
+.globl close_output_buffer_if_we_run_high
+ .type close_output_buffer_if_we_run_high, @function
+close_output_buffer_if_we_run_high:
+ pushl %ebp
+ movl bytes_out, %edx
+ movl low_buffer_size, %eax
+ movl %esp, %ebp
+ cmpl %eax, %edx
+ movl 8(%ebp), %ecx
+ jbe .L700
+ cmpl $0, 12(%ecx)
+ movl %eax, 4(%ecx)
+ je .L699
+ subl %eax, %edx
+ movl %edx, 12(%ecx)
+ .p2align 2,,3
+.L699:
+ leave
+ ret
+ .p2align 2,,3
+.L700:
+ movl %edx, 4(%ecx)
+ movl $0, 12(%ecx)
+ jmp .L699
+ .size close_output_buffer_if_we_run_high, .-close_output_buffer_if_we_run_high
+ .section .rodata.str1.1
+.LC22:
+ .string ".\nDecompressing Linux..."
+.LC23:
+ .string "done.\nBooting the kernel.\n"
+ .text
+ .p2align 2,,3
+.globl decompress_kernel
+ .type decompress_kernel, @function
+decompress_kernel:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %ebx
+ pushl %eax
+ movl 12(%ebp), %eax
+ cmpb $7, 6(%eax)
+ movl 8(%ebp), %ebx
+ movl %eax, real_mode
+ je .L709
+ movl $753664, vidmem
+ movl $980, vidport
+.L705:
+ movl real_mode, %eax
+ movzbl 14(%eax), %edx
+ cmpl $1048575, free_mem_ptr
+ movzbl 7(%eax), %eax
+ movl %edx, lines
+ movl %eax, cols
+ jg .L706
+ call setup_normal_output_buffer
+.L707:
+ call makecrc
+ subl $12, %esp
+ pushl $.LC22
+ call puts
+ call gunzip
+ movl $.LC23, (%esp)
+ call puts
+ movl high_loaded, %eax
+ addl $16, %esp
+ testl %eax, %eax
+ jne .L710
+.L708:
+ movl -4(%ebp), %ebx
+ leave
+ ret
+ .p2align 2,,3
+.L710:
+ subl $12, %esp
+ pushl %ebx
+ call close_output_buffer_if_we_run_high
+ addl $16, %esp
+ movl high_loaded, %eax
+ jmp .L708
+ .p2align 2,,3
+.L706:
+ subl $12, %esp
+ pushl %ebx
+ call setup_output_buffer_if_we_run_high
+ addl $16, %esp
+ jmp .L707
+ .p2align 2,,3
+.L709:
+ movl $720896, vidmem
+ movl $948, vidport
+ jmp .L705
+ .size decompress_kernel, .-decompress_kernel
+ .local inbuf
+ .comm inbuf,4,4
+ .local window
+ .comm window,32768,32
+ .local real_mode
+ .comm real_mode,4,4
+ .local output_data
+ .comm output_data,4,4
+ .local free_mem_end_ptr
+ .comm free_mem_end_ptr,4,4
+ .local low_buffer_end
+ .comm low_buffer_end,4,4
+ .local low_buffer_size
+ .comm low_buffer_size,4,4
+ .local high_buffer_start
+ .comm high_buffer_start,4,4
+ .local vidport
+ .comm vidport,4,4
+ .local lines
+ .comm lines,4,4
+ .local cols
+ .comm cols,4,4
+ .local bb
+ .comm bb,4,4
+ .local bk
+ .comm bk,4,4
+ .local hufts
+ .comm hufts,4,4
+ .local crc_32_tab
+ .comm crc_32_tab,1024,32
+ .local crc
+ .comm crc,4,4
+ .section .note.GNU-stack,"",@progbits
+ .ident "GCC: (GNU) 3.3.3"
diff -urN linux-2.6.4/arch/x86_64/boot/compressed/misc.c linux-2.6.4-patched/arch/x86_64/boot/compressed/misc.c
--- linux-2.6.4/arch/x86_64/boot/compressed/misc.c 2004-03-10 20:55:26.000000000 -0600
+++ linux-2.6.4-patched/arch/x86_64/boot/compressed/misc.c 1969-12-31 18:00:00.000000000 -0600
@@ -1,354 +0,0 @@
-/*
- * misc.c
- *
- * This is a collection of several routines from gzip-1.0.3
- * adapted for Linux.
- *
- * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
- * puts by Nick Holloway 1993, better puts by Martin Mares 1995
- * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
- */
-
-#include "miscsetup.h"
-#include <asm/io.h>
-
-/*
- * gzip declarations
- */
-
-#define OF(args) args
-#define STATIC static
-
-#undef memset
-#undef memcpy
-#define memzero(s, n) memset ((s), 0, (n))
-
-typedef unsigned char uch;
-typedef unsigned short ush;
-typedef unsigned long ulg;
-
-#define WSIZE 0x8000 /* Window size must be at least 32k, */
- /* and a power of two */
-
-static uch *inbuf; /* input buffer */
-static uch window[WSIZE]; /* Sliding window buffer */
-
-static unsigned insize = 0; /* valid bytes in inbuf */
-static unsigned inptr = 0; /* index of next byte to be processed in inbuf */
-static unsigned outcnt = 0; /* bytes in output buffer */
-
-/* gzip flag byte */
-#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
-#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
-#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
-#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
-#define COMMENT 0x10 /* bit 4 set: file comment present */
-#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
-#define RESERVED 0xC0 /* bit 6,7: reserved */
-
-#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
-
-/* Diagnostic functions */
-#ifdef DEBUG
-# define Assert(cond,msg) {if(!(cond)) error(msg);}
-# define Trace(x) fprintf x
-# define Tracev(x) {if (verbose) fprintf x ;}
-# define Tracevv(x) {if (verbose>1) fprintf x ;}
-# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
-# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
-#else
-# define Assert(cond,msg)
-# define Trace(x)
-# define Tracev(x)
-# define Tracevv(x)
-# define Tracec(c,x)
-# define Tracecv(c,x)
-#endif
-
-static int fill_inbuf(void);
-static void flush_window(void);
-static void error(char *m);
-static void gzip_mark(void **);
-static void gzip_release(void **);
-
-/*
- * This is set up by the setup-routine at boot-time
- */
-static unsigned char *real_mode; /* Pointer to real-mode data */
-
-#define EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
-#ifndef STANDARD_MEMORY_BIOS_CALL
-#define ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
-#endif
-#define SCREEN_INFO (*(struct screen_info *)(real_mode+0))
-
-extern char input_data[];
-extern int input_len;
-
-static long bytes_out = 0;
-static uch *output_data;
-static unsigned long output_ptr = 0;
-
-static void *malloc(int size);
-static void free(void *where);
-
-static void puts(const char *);
-
-extern int end;
-static long free_mem_ptr = (long)&end;
-static long free_mem_end_ptr;
-
-#define INPLACE_MOVE_ROUTINE 0x1000
-#define LOW_BUFFER_START 0x2000
-#define LOW_BUFFER_MAX 0x90000
-#define HEAP_SIZE 0x3000
-static unsigned int low_buffer_end, low_buffer_size;
-static int high_loaded =0;
-static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
-
-static char *vidmem = (char *)0xb8000;
-static int vidport;
-static int lines, cols;
-
-#include "../../../../lib/inflate.c"
-
-static void *malloc(int size)
-{
- void *p;
-
- if (size <0) error("Malloc error");
- if (free_mem_ptr <= 0) error("Memory error");
-
- free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */
-
- p = (void *)free_mem_ptr;
- free_mem_ptr += size;
-
- if (free_mem_ptr >= free_mem_end_ptr)
- error("Out of memory");
-
- return p;
-}
-
-static void free(void *where)
-{ /* Don't care */
-}
-
-static void gzip_mark(void **ptr)
-{
- *ptr = (void *) free_mem_ptr;
-}
-
-static void gzip_release(void **ptr)
-{
- free_mem_ptr = (long) *ptr;
-}
-
-static void scroll(void)
-{
- int i;
-
- memcpy ( vidmem, vidmem + cols * 2, ( lines - 1 ) * cols * 2 );
- for ( i = ( lines - 1 ) * cols * 2; i < lines * cols * 2; i += 2 )
- vidmem[i] = ' ';
-}
-
-static void puts(const char *s)
-{
- int x,y,pos;
- char c;
-
- x = SCREEN_INFO.orig_x;
- y = SCREEN_INFO.orig_y;
-
- while ( ( c = *s++ ) != '\0' ) {
- if ( c == '\n' ) {
- x = 0;
- if ( ++y >= lines ) {
- scroll();
- y--;
- }
- } else {
- vidmem [ ( x + cols * y ) * 2 ] = c;
- if ( ++x >= cols ) {
- x = 0;
- if ( ++y >= lines ) {
- scroll();
- y--;
- }
- }
- }
- }
-
- SCREEN_INFO.orig_x = x;
- SCREEN_INFO.orig_y = y;
-
- pos = (x + cols * y) * 2; /* Update cursor position */
- outb_p(14, vidport);
- outb_p(0xff & (pos >> 9), vidport+1);
- outb_p(15, vidport);
- outb_p(0xff & (pos >> 1), vidport+1);
-}
-
-void* memset(void* s, int c, unsigned n)
-{
- int i;
- char *ss = (char*)s;
-
- for (i=0;i<n;i++) ss[i] = c;
- return s;
-}
-
-void* memcpy(void* dest, const void* src, unsigned n)
-{
- int i;
- char *d = (char *)dest, *s = (char *)src;
-
- for (i=0;i<n;i++) d[i] = s[i];
- return dest;
-}
-
-/* ===========================================================================
- * Fill the input buffer. This is called only when the buffer is empty
- * and at least one byte is really needed.
- */
-static int fill_inbuf(void)
-{
- if (insize != 0) {
- error("ran out of input data");
- }
-
- inbuf = input_data;
- insize = input_len;
- inptr = 1;
- return inbuf[0];
-}
-
-/* ===========================================================================
- * Write the output window window[0..outcnt-1] and update crc and bytes_out.
- * (Used for the decompressed data only.)
- */
-static void flush_window_low(void)
-{
- ulg c = crc; /* temporary variable */
- unsigned n;
- uch *in, *out, ch;
-
- in = window;
- out = &output_data[output_ptr];
- for (n = 0; n < outcnt; n++) {
- ch = *out++ = *in++;
- c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
- }
- crc = c;
- bytes_out += (ulg)outcnt;
- output_ptr += (ulg)outcnt;
- outcnt = 0;
-}
-
-static void flush_window_high(void)
-{
- ulg c = crc; /* temporary variable */
- unsigned n;
- uch *in, ch;
- in = window;
- for (n = 0; n < outcnt; n++) {
- ch = *output_data++ = *in++;
- if ((ulg)output_data == low_buffer_end) output_data=high_buffer_start;
- c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
- }
- crc = c;
- bytes_out += (ulg)outcnt;
- outcnt = 0;
-}
-
-static void flush_window(void)
-{
- if (high_loaded) flush_window_high();
- else flush_window_low();
-}
-
-static void error(char *x)
-{
- puts("\n\n");
- puts(x);
- puts("\n\n -- System halted");
-
- while(1);
-}
-
-void setup_normal_output_buffer(void)
-{
-#ifdef STANDARD_MEMORY_BIOS_CALL
- if (EXT_MEM_K < 1024) error("Less than 2MB of memory");
-#else
- if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory");
-#endif
- output_data = (char *)0x100000; /* Points to 1M */
- free_mem_end_ptr = (long)real_mode;
-}
-
-struct moveparams {
- uch *low_buffer_start; int lcount;
- uch *high_buffer_start; int hcount;
-};
-
-void setup_output_buffer_if_we_run_high(struct moveparams *mv)
-{
- high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
-#ifdef STANDARD_MEMORY_BIOS_CALL
- if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory");
-#else
- if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory");
-#endif
- mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
- low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
- ? LOW_BUFFER_MAX : (unsigned int)real_mode) & ~0xfff;
- low_buffer_size = low_buffer_end - LOW_BUFFER_START;
- high_loaded = 1;
- free_mem_end_ptr = (long)high_buffer_start;
- if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) {
- high_buffer_start = (uch *)(0x100000 + low_buffer_size);
- mv->hcount = 0; /* say: we need not to move high_buffer */
- }
- else mv->hcount = -1;
- mv->high_buffer_start = high_buffer_start;
-}
-
-void close_output_buffer_if_we_run_high(struct moveparams *mv)
-{
- if (bytes_out > low_buffer_size) {
- mv->lcount = low_buffer_size;
- if (mv->hcount)
- mv->hcount = bytes_out - low_buffer_size;
- } else {
- mv->lcount = bytes_out;
- mv->hcount = 0;
- }
-}
-
-int decompress_kernel(struct moveparams *mv, void *rmode)
-{
- real_mode = rmode;
-
- if (SCREEN_INFO.orig_video_mode == 7) {
- vidmem = (char *) 0xb0000;
- vidport = 0x3b4;
- } else {
- vidmem = (char *) 0xb8000;
- vidport = 0x3d4;
- }
-
- lines = SCREEN_INFO.orig_video_lines;
- cols = SCREEN_INFO.orig_video_cols;
-
- if (free_mem_ptr < 0x100000) setup_normal_output_buffer();
- else setup_output_buffer_if_we_run_high(mv);
-
- makecrc();
- puts(".\nDecompressing Linux...");
- gunzip();
- puts("done.\nBooting the kernel.\n");
- if (high_loaded) close_output_buffer_if_we_run_high(mv);
- return high_loaded;
-}
diff -urN linux-2.6.4/arch/x86_64/boot/compressed/misc.foo.c linux-2.6.4-patched/arch/x86_64/boot/compressed/misc.foo.c
--- linux-2.6.4/arch/x86_64/boot/compressed/misc.foo.c 1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.4-patched/arch/x86_64/boot/compressed/misc.foo.c 2004-03-10 20:55:26.000000000 -0600
@@ -0,0 +1,354 @@
+/*
+ * misc.c
+ *
+ * This is a collection of several routines from gzip-1.0.3
+ * adapted for Linux.
+ *
+ * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
+ * puts by Nick Holloway 1993, better puts by Martin Mares 1995
+ * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
+ */
+
+#include "miscsetup.h"
+#include <asm/io.h>
+
+/*
+ * gzip declarations
+ */
+
+#define OF(args) args
+#define STATIC static
+
+#undef memset
+#undef memcpy
+#define memzero(s, n) memset ((s), 0, (n))
+
+typedef unsigned char uch;
+typedef unsigned short ush;
+typedef unsigned long ulg;
+
+#define WSIZE 0x8000 /* Window size must be at least 32k, */
+ /* and a power of two */
+
+static uch *inbuf; /* input buffer */
+static uch window[WSIZE]; /* Sliding window buffer */
+
+static unsigned insize = 0; /* valid bytes in inbuf */
+static unsigned inptr = 0; /* index of next byte to be processed in inbuf */
+static unsigned outcnt = 0; /* bytes in output buffer */
+
+/* gzip flag byte */
+#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
+#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
+#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
+#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
+#define COMMENT 0x10 /* bit 4 set: file comment present */
+#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
+#define RESERVED 0xC0 /* bit 6,7: reserved */
+
+#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
+
+/* Diagnostic functions */
+#ifdef DEBUG
+# define Assert(cond,msg) {if(!(cond)) error(msg);}
+# define Trace(x) fprintf x
+# define Tracev(x) {if (verbose) fprintf x ;}
+# define Tracevv(x) {if (verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
+#else
+# define Assert(cond,msg)
+# define Trace(x)
+# define Tracev(x)
+# define Tracevv(x)
+# define Tracec(c,x)
+# define Tracecv(c,x)
+#endif
+
+static int fill_inbuf(void);
+static void flush_window(void);
+static void error(char *m);
+static void gzip_mark(void **);
+static void gzip_release(void **);
+
+/*
+ * This is set up by the setup-routine at boot-time
+ */
+static unsigned char *real_mode; /* Pointer to real-mode data */
+
+#define EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
+#ifndef STANDARD_MEMORY_BIOS_CALL
+#define ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
+#endif
+#define SCREEN_INFO (*(struct screen_info *)(real_mode+0))
+
+extern char input_data[];
+extern int input_len;
+
+static long bytes_out = 0;
+static uch *output_data;
+static unsigned long output_ptr = 0;
+
+static void *malloc(int size);
+static void free(void *where);
+
+static void puts(const char *);
+
+extern int end;
+static long free_mem_ptr = (long)&end;
+static long free_mem_end_ptr;
+
+#define INPLACE_MOVE_ROUTINE 0x1000
+#define LOW_BUFFER_START 0x2000
+#define LOW_BUFFER_MAX 0x90000
+#define HEAP_SIZE 0x3000
+static unsigned int low_buffer_end, low_buffer_size;
+static int high_loaded =0;
+static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
+
+static char *vidmem = (char *)0xb8000;
+static int vidport;
+static int lines, cols;
+
+#include "../../../../lib/inflate.c"
+
+static void *malloc(int size)
+{
+ void *p;
+
+ if (size <0) error("Malloc error");
+ if (free_mem_ptr <= 0) error("Memory error");
+
+ free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */
+
+ p = (void *)free_mem_ptr;
+ free_mem_ptr += size;
+
+ if (free_mem_ptr >= free_mem_end_ptr)
+ error("Out of memory");
+
+ return p;
+}
+
+static void free(void *where)
+{ /* Don't care */
+}
+
+static void gzip_mark(void **ptr)
+{
+ *ptr = (void *) free_mem_ptr;
+}
+
+static void gzip_release(void **ptr)
+{
+ free_mem_ptr = (long) *ptr;
+}
+
+static void scroll(void)
+{
+ int i;
+
+ memcpy ( vidmem, vidmem + cols * 2, ( lines - 1 ) * cols * 2 );
+ for ( i = ( lines - 1 ) * cols * 2; i < lines * cols * 2; i += 2 )
+ vidmem[i] = ' ';
+}
+
+static void puts(const char *s)
+{
+ int x,y,pos;
+ char c;
+
+ x = SCREEN_INFO.orig_x;
+ y = SCREEN_INFO.orig_y;
+
+ while ( ( c = *s++ ) != '\0' ) {
+ if ( c == '\n' ) {
+ x = 0;
+ if ( ++y >= lines ) {
+ scroll();
+ y--;
+ }
+ } else {
+ vidmem [ ( x + cols * y ) * 2 ] = c;
+ if ( ++x >= cols ) {
+ x = 0;
+ if ( ++y >= lines ) {
+ scroll();
+ y--;
+ }
+ }
+ }
+ }
+
+ SCREEN_INFO.orig_x = x;
+ SCREEN_INFO.orig_y = y;
+
+ pos = (x + cols * y) * 2; /* Update cursor position */
+ outb_p(14, vidport);
+ outb_p(0xff & (pos >> 9), vidport+1);
+ outb_p(15, vidport);
+ outb_p(0xff & (pos >> 1), vidport+1);
+}
+
+void* memset(void* s, int c, unsigned n)
+{
+ int i;
+ char *ss = (char*)s;
+
+ for (i=0;i<n;i++) ss[i] = c;
+ return s;
+}
+
+void* memcpy(void* dest, const void* src, unsigned n)
+{
+ int i;
+ char *d = (char *)dest, *s = (char *)src;
+
+ for (i=0;i<n;i++) d[i] = s[i];
+ return dest;
+}
+
+/* ===========================================================================
+ * Fill the input buffer. This is called only when the buffer is empty
+ * and at least one byte is really needed.
+ */
+static int fill_inbuf(void)
+{
+ if (insize != 0) {
+ error("ran out of input data");
+ }
+
+ inbuf = input_data;
+ insize = input_len;
+ inptr = 1;
+ return inbuf[0];
+}
+
+/* ===========================================================================
+ * Write the output window window[0..outcnt-1] and update crc and bytes_out.
+ * (Used for the decompressed data only.)
+ */
+static void flush_window_low(void)
+{
+ ulg c = crc; /* temporary variable */
+ unsigned n;
+ uch *in, *out, ch;
+
+ in = window;
+ out = &output_data[output_ptr];
+ for (n = 0; n < outcnt; n++) {
+ ch = *out++ = *in++;
+ c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
+ }
+ crc = c;
+ bytes_out += (ulg)outcnt;
+ output_ptr += (ulg)outcnt;
+ outcnt = 0;
+}
+
+static void flush_window_high(void)
+{
+ ulg c = crc; /* temporary variable */
+ unsigned n;
+ uch *in, ch;
+ in = window;
+ for (n = 0; n < outcnt; n++) {
+ ch = *output_data++ = *in++;
+ if ((ulg)output_data == low_buffer_end) output_data=high_buffer_start;
+ c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
+ }
+ crc = c;
+ bytes_out += (ulg)outcnt;
+ outcnt = 0;
+}
+
+static void flush_window(void)
+{
+ if (high_loaded) flush_window_high();
+ else flush_window_low();
+}
+
+static void error(char *x)
+{
+ puts("\n\n");
+ puts(x);
+ puts("\n\n -- System halted");
+
+ while(1);
+}
+
+void setup_normal_output_buffer(void)
+{
+#ifdef STANDARD_MEMORY_BIOS_CALL
+ if (EXT_MEM_K < 1024) error("Less than 2MB of memory");
+#else
+ if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory");
+#endif
+ output_data = (char *)0x100000; /* Points to 1M */
+ free_mem_end_ptr = (long)real_mode;
+}
+
+struct moveparams {
+ uch *low_buffer_start; int lcount;
+ uch *high_buffer_start; int hcount;
+};
+
+void setup_output_buffer_if_we_run_high(struct moveparams *mv)
+{
+ high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
+#ifdef STANDARD_MEMORY_BIOS_CALL
+ if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory");
+#else
+ if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory");
+#endif
+ mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
+ low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
+ ? LOW_BUFFER_MAX : (unsigned int)real_mode) & ~0xfff;
+ low_buffer_size = low_buffer_end - LOW_BUFFER_START;
+ high_loaded = 1;
+ free_mem_end_ptr = (long)high_buffer_start;
+ if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) {
+ high_buffer_start = (uch *)(0x100000 + low_buffer_size);
+ mv->hcount = 0; /* say: we need not to move high_buffer */
+ }
+ else mv->hcount = -1;
+ mv->high_buffer_start = high_buffer_start;
+}
+
+void close_output_buffer_if_we_run_high(struct moveparams *mv)
+{
+ if (bytes_out > low_buffer_size) {
+ mv->lcount = low_buffer_size;
+ if (mv->hcount)
+ mv->hcount = bytes_out - low_buffer_size;
+ } else {
+ mv->lcount = bytes_out;
+ mv->hcount = 0;
+ }
+}
+
+int decompress_kernel(struct moveparams *mv, void *rmode)
+{
+ real_mode = rmode;
+
+ if (SCREEN_INFO.orig_video_mode == 7) {
+ vidmem = (char *) 0xb0000;
+ vidport = 0x3b4;
+ } else {
+ vidmem = (char *) 0xb8000;
+ vidport = 0x3d4;
+ }
+
+ lines = SCREEN_INFO.orig_video_lines;
+ cols = SCREEN_INFO.orig_video_cols;
+
+ if (free_mem_ptr < 0x100000) setup_normal_output_buffer();
+ else setup_output_buffer_if_we_run_high(mv);
+
+ makecrc();
+ puts(".\nDecompressing Linux...");
+ gunzip();
+ puts("done.\nBooting the kernel.\n");
+ if (high_loaded) close_output_buffer_if_we_run_high(mv);
+ return high_loaded;
+}
diff -urN linux-2.6.4/arch/x86_64/ia32/Makefile linux-2.6.4-patched/arch/x86_64/ia32/Makefile
--- linux-2.6.4/arch/x86_64/ia32/Makefile 2004-03-10 20:55:24.000000000 -0600
+++ linux-2.6.4-patched/arch/x86_64/ia32/Makefile 2004-03-16 14:19:43.000000000 -0600
@@ -24,5 +24,5 @@
$(obj)/vsyscall.so: $(src)/vsyscall.lds $(obj)/vsyscall.o FORCE
$(call if_changed,vsyscall)
-AFLAGS_vsyscall.o = -m32
+AFLAGS_vsyscall.o = -Wa,--32
CFLAGS_ia32_ioctl.o += -Ifs/
Reply to: