small optimization

git-svn-id: svn://kolibrios.org@1260 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2009-11-09 19:30:40 +00:00
parent dc1c59db4d
commit 5c55e63fc6
2 changed files with 35 additions and 22 deletions

View File

@ -151,8 +151,8 @@ proc fs_execute
.get_lock: .get_lock:
mov eax, 1 mov eax, 1
xchg eax, [application_table_status] xchg eax, [application_table_status]
cmp eax, 0 test eax, eax
jne .wait_lock jnz .wait_lock
call set_application_table_status call set_application_table_status

View File

@ -831,16 +831,18 @@ no_lib_load:
mov ebp, vrr_m mov ebp, vrr_m
call fs_execute_from_sysdir call fs_execute_from_sysdir
cmp eax,2 ; if vrr_m app found (PID=2) ; cmp eax,2 ; if vrr_m app found (PID=2)
je first_app_found sub eax,2
jz first_app_found
no_load_vrr_m: no_load_vrr_m:
mov ebp, firstapp mov ebp, firstapp
call fs_execute_from_sysdir call fs_execute_from_sysdir
cmp eax,2 ; continue if a process has been loaded ; cmp eax,2 ; continue if a process has been loaded
je first_app_found sub eax,2
jz first_app_found
mov esi, boot_failed mov esi, boot_failed
call boot_log call boot_log
@ -1428,9 +1430,11 @@ endg
nsyse1: nsyse1:
cmp eax,2 ; KEYBOARD ; cmp eax,2 ; KEYBOARD
sub eax,2
jnz nsyse2 jnz nsyse2
cmp ebx,1 ; cmp ebx,1
dec ebx
jnz kbnobase jnz kbnobase
mov edi,[TASK_BASE] mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start] add ecx,[edi+TASKDATA.mem_start]
@ -1440,7 +1444,8 @@ endg
call memmove call memmove
ret ret
kbnobase: kbnobase:
cmp ebx,2 ; cmp ebx,2
dec ebx
jnz kbnoshift jnz kbnoshift
mov edi,[TASK_BASE] mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start] add ecx,[edi+TASKDATA.mem_start]
@ -1450,8 +1455,9 @@ endg
call memmove call memmove
ret ret
kbnoshift: kbnoshift:
cmp ebx,3 ; cmp ebx,3
jne kbnoalt dec ebx
jnz kbnoalt
mov edi,[TASK_BASE] mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start] add ecx,[edi+TASKDATA.mem_start]
mov eax,ecx mov eax,ecx
@ -1460,7 +1466,8 @@ endg
call memmove call memmove
ret ret
kbnoalt: kbnoalt:
cmp ebx,9 ; cmp ebx,9
sub ebx,6
jnz kbnocountry jnz kbnocountry
mov word [keyboard],cx mov word [keyboard],cx
ret ret
@ -1468,7 +1475,8 @@ endg
mov [esp+36],dword 1 mov [esp+36],dword 1
ret ret
nsyse2: nsyse2:
cmp eax,3 ; CD ; cmp eax,3 ; CD
dec eax
jnz nsyse4 jnz nsyse4
test ebx,ebx test ebx,ebx
jz nosesl jz nosesl
@ -1501,14 +1509,16 @@ cd_base db 0
nsyse4: nsyse4:
cmp eax,5 ; SYSTEM LANGUAGE ; cmp eax,5 ; SYSTEM LANGUAGE
sub eax,2
jnz nsyse5 jnz nsyse5
mov [syslang],ebx mov [syslang],ebx
ret ret
nsyse5: nsyse5:
cmp eax,7 ; HD BASE ; cmp eax,7 ; HD BASE
jne nsyse7 sub eax,2
jnz nsyse7
test ebx,ebx test ebx,ebx
jz nosethd jz nosethd
cmp ebx,4 cmp ebx,4
@ -1555,8 +1565,9 @@ endg
nsyse7: nsyse7:
cmp eax,8 ; HD PARTITION ; cmp eax,8 ; HD PARTITION
jne nsyse8 dec eax
jnz nsyse8
mov [fat32part],ebx mov [fat32part],ebx
; call set_FAT32_variables ; call set_FAT32_variables
call reserve_hd1 call reserve_hd1
@ -1569,15 +1580,17 @@ nsyse7:
ret ret
nsyse8: nsyse8:
cmp eax,11 ; ENABLE LBA READ ; cmp eax,11 ; ENABLE LBA READ
jne no_set_lba_read sub eax,3
jnz no_set_lba_read
and ebx,1 and ebx,1
mov [lba_read_enabled],ebx mov [lba_read_enabled],ebx
ret ret
no_set_lba_read: no_set_lba_read:
cmp eax,12 ; ENABLE PCI ACCESS ; cmp eax,12 ; ENABLE PCI ACCESS
jne no_set_pci_access dec eax
jnz no_set_pci_access
and ebx,1 and ebx,1
mov [pci_access_enabled],ebx mov [pci_access_enabled],ebx
ret ret