direct detection of available memory

git-svn-id: svn://kolibrios.org@2047 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Artem Jerdev (art_zh) 2011-08-14 09:08:02 +00:00
parent 550c1d97e1
commit 2a927db105
11 changed files with 185 additions and 244 deletions

View File

@ -1,13 +1,13 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; BOOTCODE.INC ;; ;; BOOTCODE.INC ;;
;; ;; ;; ;;
;; KolibriOS 16-bit loader, ;; ;; Kolibri-A auxiliary 16-bit code, ;;
;; based on bootcode for MenuetOS ;; ;; based on bootcode for KolibriOS ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -119,17 +119,6 @@ no_hd_load:
push cs push cs
pop es pop es
if 0
; set videomode
mov ax, 3
int 0x10
; draw frames
push 0xb800
pop es
xor di, di
mov ah, 1*16+15
end if
cpugood: cpugood:
@ -298,12 +287,6 @@ cfgmanager:
dec al dec al
mov [boot_dev], al mov [boot_dev], al
; GET MEMORY MAP
include 'detect/biosmem.inc'
; READ DISKETTE TO MEMORY
; SET GRAPHICS ; SET GRAPHICS

View File

@ -0,0 +1,20 @@
;
; Kolibri-A Special service template -- art_zh 2011
;
; ah = syscall function# (default: 255)
; al = subfunction
;
align 4
special_srv:
mov cl, ah
and cl, 3
call dword[spec_servetable + ecx*4]
ret
align 4
spec_servetable:
dd paleholder ; set something special here
dd paleholder
dd paleholder
dd paleholder

View File

@ -26,10 +26,10 @@ CPU_PENTIUM equ 5
CPU_P6 equ 6 CPU_P6 equ 6
CPU_PENTIUM4 equ 0x0F CPU_PENTIUM4 equ 0x0F
PLATFORM equ 0x14 PLATFORM equ 0x14
PLATFORM_RS780 equ 0x0F PLATFORM_RS780 equ 0x0F
PLATFORM_RS880 equ 0x10 PLATFORM_RS880 equ 0x10
PLATFORM_FUSION equ 0x14 PLATFORM_FUSION equ 0x14
CAPS_FPU equ 00 ;on-chip x87 floating point unit CAPS_FPU equ 00 ;on-chip x87 floating point unit
CAPS_VME equ 01 ;virtual-mode enhancements CAPS_VME equ 01 ;virtual-mode enhancements
@ -298,7 +298,7 @@ RAMDISK equ (OS_BASE+0x0100000)
RAMDISK_FAT equ (OS_BASE+0x0280000) RAMDISK_FAT equ (OS_BASE+0x0280000)
FLOPPY_FAT equ (OS_BASE+0x0282000) FLOPPY_FAT equ (OS_BASE+0x0282000)
CLEAN_ZONE equ 0x280000 CLEAN_ZONE equ 0x280000
IDE_DMA equ 0x284000 IDE_DMA equ 0x284000
BgrAuxTable equ (OS_BASE+0x0298000) BgrAuxTable equ (OS_BASE+0x0298000)
@ -309,7 +309,7 @@ SB16_Status equ (OS_BASE+0x02B0000)
BUTTON_INFO equ (OS_BASE+0x02C0000) BUTTON_INFO equ (OS_BASE+0x02C0000)
RESERVED_PORTS equ (OS_BASE+0x02D0000) RESERVED_PORTS equ (OS_BASE+0x02D0000)
IRQ_SAVE equ (OS_BASE+0x02E0000) IRQ_SAVE equ (OS_BASE+0x02E0000)
;BOOT_VAR equ (OS_BASE+0x02F0000) ;BOOT_VAR equ (OS_BASE+0x02F0000)
stack_data_start equ (OS_BASE+0x0300000) stack_data_start equ (OS_BASE+0x0300000)
@ -335,10 +335,11 @@ virtual at (OS_BASE+0x05FFF80)
end virtual end virtual
HEAP_BASE equ (OS_BASE+0x0800000) HEAP_BASE equ (OS_BASE+0x0800000)
HEAP_MIN_SIZE equ 0x01000000 HEAP_MIN_SIZE equ 0x02000000
PCIe_CONFIG_SPACE equ 0xF0000000 PCIe_CONFIG_SPACE equ 0xF0000000
USER_DMA_BUFFER equ 0xFD000000 ; linear addr. USER_DMA_BUFFER equ 0xFD000000 ; linear addr.
USER_DMA_SIZE equ 0x00800000
page_tabs equ 0xFDC00000 page_tabs equ 0xFDC00000
app_page_tabs equ 0xFDC00000 app_page_tabs equ 0xFDC00000

View File

@ -337,7 +337,7 @@ endp
align 4 align 4
proc init_LFB proc init_LFB
call init_mtrr stdcall set_mtrr, [LFBAddress],[LFBSize],MEM_WC
mov edx, LFB_BASE mov edx, LFB_BASE
mov esi, [LFBAddress] mov esi, [LFBAddress]
@ -364,16 +364,16 @@ endp
align 4 align 4
init_userDMA: init_userDMA:
stdcall alloc_pages, 4096 ; 16M <<<<<<<<<<+++++++++++++++++++++++++++++++++ stdcall set_mtrr, [UserDMAaddr], USER_DMA_SIZE, MEM_UC ; <<<<<<<<<<+++++++++++++++++++++++++++++++++
add eax, 0x007FFFF0 ; terrible mess, sorry ...
and eax, 0xFF800000 ; align at 8M boundary mov eax, [UserDMAaddr] ; phys. addr, 8M-aligned
mov [UserDMAaddr], eax or eax, PG_GLOBAL+PG_LARGE + PG_UW + PG_NOCACHE
or eax, PG_LARGE + PG_UW + PG_NOCACHE
mov ebx, sys_pgdir + (USER_DMA_BUFFER shr 20) mov ebx, sys_pgdir + (USER_DMA_BUFFER shr 20)
mov [ebx], eax mov [ebx], eax
add ebx, 4 add ebx, 4
add eax, 0x00400000 add eax, 0x00400000
mov [ebx], eax mov [ebx], eax
mov eax, cr3 ;flush TLB mov eax, cr3 ;flush TLB
mov cr3, eax mov cr3, eax
ret ret
@ -1248,75 +1248,6 @@ proc load_pe_driver stdcall, file:dword
endp endp
align 4
proc init_mtrr
cmp [BOOT_VAR+0x901c],byte 2
je .exit
bt [cpu_caps], CAPS_MTRR
jnc .exit
mov eax, cr0
or eax, 0x60000000 ;disable caching
mov cr0, eax
wbinvd ;invalidate cache
mov ecx, 0x2FF
rdmsr ;
; has BIOS already initialized MTRRs?
test ah, 8
jnz .skip_init
; rarely needed, so mainly placeholder
; main memory - cached
push eax
mov eax, [MEM_AMOUNT]
; round eax up to next power of 2
dec eax
bsr ecx, eax
mov ebx, 2
shl ebx, cl
dec ebx
; base of memory range = 0, type of memory range = MEM_WB
xor edx, edx
mov eax, MEM_WB
mov ecx, 0x200
wrmsr
; mask of memory range = 0xFFFFFFFFF - (size - 1), ebx = size - 1
mov eax, 0xFFFFFFFF
mov edx, 0x0000000F
sub eax, ebx
sbb edx, 0
or eax, 0x800
inc ecx
wrmsr
; clear unused MTRRs
xor eax, eax
xor edx, edx
@@:
wrmsr
inc ecx
cmp ecx, 0x210
jb @b
; enable MTRRs
pop eax
or ah, 8
and al, 0xF0 ; default memtype = UC
mov ecx, 0x2FF
wrmsr
.skip_init:
stdcall set_mtrr, [LFBAddress],[LFBSize],MEM_WC
wbinvd ;again invalidate
mov eax, cr0
and eax, not 0x60000000
mov cr0, eax ; enable caching
.exit:
ret
endp
align 4 align 4
proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword
; find unused register ; find unused register
@ -1337,7 +1268,11 @@ proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword
.ret: .ret:
ret ret
.found: .found:
; found, write values mov eax, cr0
or eax, 0x60000000 ;disable caching
mov cr0, eax
wbinvd ;invalidate cache
xor edx, edx xor edx, edx
mov eax, [base] mov eax, [base]
or eax, [mem_type] or eax, [mem_type]
@ -1352,6 +1287,12 @@ proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword
or eax, 0x800 or eax, 0x800
inc ecx inc ecx
wrmsr wrmsr
wbinvd ;again invalidate
mov eax, cr0
and eax, not 0x60000000
mov cr0, eax ; enable caching
ret ret
endp endp

View File

@ -46,8 +46,10 @@ align 32
syscall_entry: syscall_entry:
; sti ; sti
push ecx push ecx
and eax, 3 xor ecx, ecx
call dword [servetable3 + eax * 4] mov cl, al
and cl, 7
call dword [servetable3 + ecx * 4]
pop ecx pop ecx
sysret sysret
@ -156,8 +158,13 @@ align 4
servetable3: ; Kolibri-A special service servetable3: ; Kolibri-A special service
dd sys_rdmsr ; 0 = read MSR dd sys_rdmsr ; 0 = read MSR
dd sys_map1 ; 1 = map any page (test only) dd sys_map1 ; 1 = get sys data (test only)
dd paleholder ; 2 dd paleholder ; 2
dd paleholder ; 3
dd paleholder ; 4
dd paleholder ; 5
dd paleholder ; 6
dd special_srv ; 7 = special service
dd sys_end ; last dd sys_end ; last
endg endg

View File

@ -255,6 +255,7 @@ endofcode:
gdte: gdte:
align 16 align 16
diff16 "cur_saved_data (data32.inc) ", 0, $
cur_saved_data rb 4096 cur_saved_data rb 4096
fpu_data: rb 512 fpu_data: rb 512
@ -282,12 +283,15 @@ irq15read rd 16
irq_tab rd 16 irq_tab rd 16
diff16 "mem_block_map (data32.inc) ", 0, $
mem_block_map rb 512 mem_block_map rb 512
mem_block_list rd 64 mem_block_list rd 64
large_block_list rd 31 large_block_list rd 31
mem_block_mask rd 2 mem_block_mask rd 2
large_block_mask rd 1 large_block_mask rd 1
diff16 "mem_used (data32.inc) ", 0, $
mem_used.fd rd 1 mem_used.fd rd 1
mem_used.bk rd 1 mem_used.bk rd 1
@ -302,6 +306,7 @@ heap_blocks rd 1
free_blocks rd 1 free_blocks rd 1
mst MEM_STATE mst MEM_STATE
diff16 "page_start (data32.inc) ", 0, $
page_start rd 1 page_start rd 1
page_end rd 1 page_end rd 1
@ -331,6 +336,8 @@ srv.bk rd 1
;img_screen_y rd 1 ;img_screen_y rd 1
align 64 align 64
diff16 "_WinMapAddress (data32.inc) ", 0, $
;_WinMapWidth rd 1 ;_WinMapWidth rd 1
;_WinMapHeight rd 1 ;_WinMapHeight rd 1
_WinMapAddress rd 1 _WinMapAddress rd 1
@ -363,6 +370,8 @@ proc_mem_tab rd 1
tmp_task_pdir rd 1 tmp_task_pdir rd 1
tmp_task_ptab rd 1 tmp_task_ptab rd 1
diff16 "default_io_map (data32.inc) ", 0, $
default_io_map rd 1 default_io_map rd 1
LFBSize rd 1 LFBSize rd 1

View File

@ -1,43 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2009. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Query physical memory map from BIOS.
; diamond, 2009
push ds
; first call to fn E820
mov eax, 0xE820
xor ebx, ebx
mov es, bx
mov ds, bx
mov di, 0x9104
mov [di-4], ebx ; no blocks yet
mov ecx, 20
mov edx, 0x534D4150
int 15h
jc no_E820
cmp eax, 0x534D4150
jnz no_E820
e820_mem_loop:
cmp byte [di+16], 1 ; ignore non-free areas
jnz e820_mem_next
inc byte [0x9100]
add di, 20
e820_mem_next:
; consequent calls to fn E820
test ebx, ebx
jz e820_test_done
cmp byte [0x9100], 32
jae e820_test_done
mov eax, 0xE820
int 15h
jc e820_test_done
jmp e820_mem_loop
no_E820:
; let's hope for mem_test from init.inc
e820_test_done:
pop ds

View File

@ -18,7 +18,7 @@ preinit_mem:
; clear [CLEAN_ZONE..HEAP_BASE] ; clear [CLEAN_ZONE..HEAP_BASE]
xor eax,eax xor eax,eax
mov edi,CLEAN_ZONE ; 0x280000 = ramdisk FAT ? mov edi,CLEAN_ZONE ; 0x280000 = ramdisk FAT ?
mov ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4 mov ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4
cld cld
rep stosd rep stosd
@ -35,7 +35,7 @@ preinit_mem:
; save [0..0xffff] ; save [0..0xffff]
xor esi, esi xor esi, esi
mov edi, (BOOT_VAR - OS_BASE) ; low mem storage area mov edi, (BOOT_VAR - OS_BASE) ; low mem storage area
mov ecx, 0x10000 / 4 mov ecx, 0x10000 / 4
rep movsd rep movsd
; clear [0x1000..0x0ffff] ; clear [0x1000..0x0ffff]
@ -53,11 +53,32 @@ preinit_mem:
align 4 align 4
proc init_mem proc init_mem
mov esi, (PCIe_CONFIG_SPACE-OS_BASE) ; esi will hold total amount of memory mov ecx, 0xC001001A ; Top of Memory MSR
mov edx, esi ; edx will hold maximum allocatable address xor edi, edi
rdmsr
mov esi, eax ; esi = total amount of memory
mov ecx, 0x0200
.read_mtrr:
rdmsr
and eax, 0xFFF00000 ; not just bitcleaning
jz .next_mtrr ; ignore the main memory and free MTRRs
cmp esi, eax
jb .next_mtrr ; ignore MMIO blocks
mov esi, eax
.next_mtrr:
add cl, 2
cmp cl, 0x10
jb .read_mtrr
mov [MEM_AMOUNT-OS_BASE], esi mov eax, USER_DMA_SIZE
mov [pg_data.mem_amount-OS_BASE], esi sub esi, eax ; exclude the Global DMA block...
and esi, 0xFF800000 ; ...and the hole above it
mov eax, esi
mov [MEM_AMOUNT-OS_BASE], eax
mov [pg_data.mem_amount-OS_BASE], eax ; the true MEMTOP
mov [UserDMAaddr-OS_BASE], eax
mov edx, esi ; edx will hold maximum allocatable address
shr esi, 12 shr esi, 12
mov [pg_data.pages_count-OS_BASE], esi ; max number of PTEs ? mov [pg_data.pages_count-OS_BASE], esi ; max number of PTEs ?

View File

@ -499,10 +499,10 @@ v20ga32:
mov [graph_data_l+4],al mov [graph_data_l+4],al
mov [graph_data_l+7],ah mov [graph_data_l+7],ah
; or [KERNEL_ALLOC_FLAG], dword PG_NOCACHE ; or [KERNEL_ALLOC_FLAG], dword PG_NOCACHE ;<<<<<<<<<<<<<<<<
stdcall kernel_alloc, [_WinMapSize] stdcall kernel_alloc, [_WinMapSize]
mov [_WinMapAddress], eax mov [_WinMapAddress], eax
; xor [KERNEL_ALLOC_FLAG], dword PG_NOCACHE ; xor [KERNEL_ALLOC_FLAG], dword PG_NOCACHE ;<<<<<<<<<<<<<<<<
xor eax,eax xor eax,eax
inc eax inc eax

View File

@ -248,6 +248,7 @@ include "bus/pci/pci32.inc"
;include "bus/pci/PCIe.inc" ;include "bus/pci/PCIe.inc"
include "bus/HT.inc" ; AMD HyperTransport bus control include "bus/HT.inc" ; AMD HyperTransport bus control
include "bus/SB/SB.inc" include "bus/SB/SB.inc"
include "bus/user/special.inc"
; Floppy drive controller ; Floppy drive controller

View File

@ -10,87 +10,87 @@ $Revision$
; void __stdcall unpack(void* packed_data, void* unpacked_data); ; void __stdcall unpack(void* packed_data, void* unpacked_data);
unpack: unpack:
pushad pushad
mov esi, [esp+32+4] mov esi, [esp+32+4]
mov edi, [esp+32+8] mov edi, [esp+32+8]
mov eax, [esi+8] mov eax, [esi+8]
and al, 0xC0 and al, 0xC0
cmp al, 0xC0 cmp al, 0xC0
jz .failed jz .failed
mov eax, [esi+8] mov eax, [esi+8]
push eax push eax
add esi, 12 add esi, 12
and al, not 0xC0 and al, not 0xC0
dec al dec al
jz .lzma jz .lzma
.failed: .failed:
pop eax pop eax
popad popad
ret 8 ret 8
.lzma: .lzma:
call .lzma_unpack call .lzma_unpack
.common: .common:
pop eax pop eax
test al, 0x80 test al, 0x80
jnz .ctr1 jnz .ctr1
test al, 0x40 test al, 0x40
jz .ok jz .ok
lodsd lodsd
mov ecx, eax mov ecx, eax
jecxz .ok jecxz .ok
mov dl, [esi] mov dl, [esi]
mov esi, [esp+32+8] mov esi, [esp+32+8]
.c1: .c1:
lodsb lodsb
sub al, 0E8h sub al, 0E8h
cmp al, 1 cmp al, 1
ja .c1 ja .c1
cmp byte [esi], dl cmp byte [esi], dl
jnz .c1 jnz .c1
lodsd lodsd
; "bswap eax" is not supported on i386 ; "bswap eax" is not supported on i386
shr ax, 8 shr ax, 8
ror eax, 16 ror eax, 16
xchg al, ah xchg al, ah
sub eax, esi sub eax, esi
add eax, [esp+32+8] add eax, [esp+32+8]
mov [esi-4], eax mov [esi-4], eax
loop .c1 loop .c1
.ok: .ok:
popad popad
ret 8 ret 8
.ctr1: .ctr1:
lodsd lodsd
mov ecx, eax mov ecx, eax
jecxz .ok jecxz .ok
mov dl, [esi] mov dl, [esi]
mov esi, [esp+32+8] mov esi, [esp+32+8]
.c2: .c2:
lodsb lodsb
@@: @@:
cmp al, 0xF cmp al, 0xF
jnz .f jnz .f
lodsb lodsb
cmp al, 80h cmp al, 80h
jb @b jb @b
cmp al, 90h cmp al, 90h
jb @f jb @f
.f: .f:
sub al, 0E8h sub al, 0E8h
cmp al, 1 cmp al, 1
ja .c2 ja .c2
@@: @@:
cmp byte [esi], dl cmp byte [esi], dl
jnz .c2 jnz .c2
lodsd lodsd
shr ax, 8 shr ax, 8
ror eax, 16 ror eax, 16
xchg al, ah xchg al, ah
sub eax, esi sub eax, esi
add eax, [esp+32+8] add eax, [esp+32+8]
mov [esi-4], eax mov [esi-4], eax
loop .c2 loop .c2
jmp .ok jmp .ok
.lzma_unpack: .lzma_unpack:
@ -98,22 +98,22 @@ unpack:
.lp = 0 ; literal pos state bits .lp = 0 ; literal pos state bits
.lc = 3 ; literal context bits .lc = 3 ; literal context bits
.posStateMask = ((1 shl .pb)-1) .posStateMask = ((1 shl .pb)-1)
.literalPosMask = ((1 shl .lp)-1) .literalPosMask = ((1 shl .lp)-1)
.kNumPosBitsMax = 4 .kNumPosBitsMax = 4
.kNumPosStatesMax = (1 shl .kNumPosBitsMax) .kNumPosStatesMax = (1 shl .kNumPosBitsMax)
.kLenNumLowBits = 3 .kLenNumLowBits = 3
.kLenNumLowSymbols = (1 shl .kLenNumLowBits) .kLenNumLowSymbols = (1 shl .kLenNumLowBits)
.kLenNumMidBits = 3 .kLenNumMidBits = 3
.kLenNumMidSymbols = (1 shl .kLenNumMidBits) .kLenNumMidSymbols = (1 shl .kLenNumMidBits)
.kLenNumHighBits = 8 .kLenNumHighBits = 8
.kLenNumHighSymbols = (1 shl .kLenNumHighBits) .kLenNumHighSymbols = (1 shl .kLenNumHighBits)
.LenChoice = 0 .LenChoice = 0
.LenChoice2 = 1 .LenChoice2 = 1
.LenLow = 2 .LenLow = 2
.LenMid = (.LenLow + (.kNumPosStatesMax shl .kLenNumLowBits)) .LenMid = (.LenLow + (.kNumPosStatesMax shl .kLenNumLowBits))
.LenHigh = (.LenMid + (.kNumPosStatesMax shl .kLenNumMidBits)) .LenHigh = (.LenMid + (.kNumPosStatesMax shl .kLenNumMidBits))
.kNumLenProbs = (.LenHigh + .kLenNumHighSymbols) .kNumLenProbs = (.LenHigh + .kLenNumHighSymbols)
@ -136,22 +136,22 @@ unpack:
.IsRep0Long = (.IsRepG2 + .kNumStates) .IsRep0Long = (.IsRepG2 + .kNumStates)
.PosSlot = (.IsRep0Long + (.kNumStates shl .kNumPosBitsMax)) .PosSlot = (.IsRep0Long + (.kNumStates shl .kNumPosBitsMax))
.SpecPos = (.PosSlot + (.kNumLenToPosStates shl .kNumPosSlotBits)) .SpecPos = (.PosSlot + (.kNumLenToPosStates shl .kNumPosSlotBits))
.Align_ = (.SpecPos + .kNumFullDistances - .kEndPosModelIndex) .Align_ = (.SpecPos + .kNumFullDistances - .kEndPosModelIndex)
.Lencoder = (.Align_ + .kAlignTableSize) .Lencoder = (.Align_ + .kAlignTableSize)
.RepLencoder = (.Lencoder + .kNumLenProbs) .RepLencoder = (.Lencoder + .kNumLenProbs)
.Literal = (.RepLencoder + .kNumLenProbs) .Literal = (.RepLencoder + .kNumLenProbs)
.LZMA_BASE_SIZE = 1846 ; must be ==Literal .LZMA_BASE_SIZE = 1846 ; must be ==Literal
.LZMA_LIT_SIZE = 768 .LZMA_LIT_SIZE = 768
.kNumTopBits = 24 .kNumTopBits = 24
.kTopValue = (1 shl .kNumTopBits) .kTopValue = (1 shl .kNumTopBits)
.kNumBitModelTotalBits = 11 .kNumBitModelTotalBits = 11
.kBitModelTotal = (1 shl .kNumBitModelTotalBits) .kBitModelTotal = (1 shl .kNumBitModelTotalBits)
.kNumMoveBits = 5 .kNumMoveBits = 5
push edi push edi
; int state=0; ; int state=0;
xor ebx, ebx xor ebx, ebx
mov [.previousByte], bl mov [.previousByte], bl
@ -173,7 +173,7 @@ unpack:
; rd->Buffer = stream ; rd->Buffer = stream
; rd->BufferLim = stream+bufferSize ; rd->BufferLim = stream+bufferSize
; rd->Range = 0xFFFFFFFF ; rd->Range = 0xFFFFFFFF
pop edi pop edi
mov ebp, [esi-8] ; dest_length mov ebp, [esi-8] ; dest_length
add ebp, edi ; ebp = destination limit add ebp, edi ; ebp = destination limit
lodsd lodsd
@ -515,7 +515,8 @@ end if
uglobal uglobal
align 4 align 4
;unpack.p rd unpack.LZMA_BASE_SIZE + (unpack.LZMA_LIT_SIZE shl (unpack.lc+unpack.lp)) diff16 "unpacker.inc structures", 0, $
;unpack.p rd unpack.LZMA_BASE_SIZE + (unpack.LZMA_LIT_SIZE shl (unpack.lc+unpack.lp))
unpack.p dd ? unpack.p dd ?
unpack.code_ dd ? unpack.code_ dd ?
unpack.range dd ? unpack.range dd ?