kernel: minor optimizations

git-svn-id: svn://kolibrios.org@3588 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2013-06-02 09:36:14 +00:00
parent 8aeeb1b9b0
commit 996be4829b
5 changed files with 29 additions and 32 deletions

View File

@ -217,7 +217,7 @@ calc_vmodes_table:
test [es:mi.ModeAttributes], 10000000b ;LFB ? test [es:mi.ModeAttributes], 10000000b ;LFB ?
jz @f jz @f
cmp [es:mi.BitsPerPixel], 24 ;It show only videomodes to have support 24 and 32 bpp cmp [es:mi.BitsPerPixel], 32 ;It show only videomodes to have support 24 and 32 bpp
jb @f jb @f
; cmp [es:mi.BitsPerPixel],16 ; cmp [es:mi.BitsPerPixel],16

View File

@ -279,13 +279,8 @@ d_width_calc_area equ (OS_BASE+0x02CA000)
RESERVED_PORTS equ (OS_BASE+0x02D0000) RESERVED_PORTS equ (OS_BASE+0x02D0000)
BOOT_VAR equ (OS_BASE+0x02E0000) BOOT_VAR equ (OS_BASE+0x02E0000)
skin_data equ (OS_BASE+0x0318000)
draw_data equ (OS_BASE+0x0320000) draw_data equ (OS_BASE+0x0320000)
BgrDrawMode equ (OS_BASE+0x0323FF4)
BgrDataWidth equ (OS_BASE+0x0323FF8)
BgrDataHeight equ (OS_BASE+0x0323FFC)
sys_pgmap equ (OS_BASE+0x0324000) sys_pgmap equ (OS_BASE+0x0324000)
UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000)

View File

@ -434,9 +434,15 @@ mouse_pause rd 1
redrawmouse_unconditional rd 1 redrawmouse_unconditional rd 1
img_background rd 1 img_background rd 1
mem_BACKGROUND rd 1 mem_BACKGROUND rd 1
static_background_data rd 1 static_background_data rd 1
BgrDrawMode rd 1
BgrDataWidth rd 1
BgrDataHeight rd 1
skin_data rd 1
cache_ide0: cache_ide0:
cache_ide0_pointer rd 1 cache_ide0_pointer rd 1

View File

@ -17,21 +17,16 @@ read_skin_file:
stdcall load_file, ebx stdcall load_file, ebx
test eax, eax test eax, eax
jz .notfound jz .notfound
cmp dword [eax], 'SKIN' cmp dword [eax], 'SKIN'
jnz .noskin jnz .noskin
cmp ebx, 32*1024
jb @f
mov ebx, 32*1024
;--------------------------------------
align 4
@@:
lea ecx, [ebx+3]
shr ecx, 2
mov esi, eax
mov edi, skin_data
rep movsd
stdcall kernel_free, eax
xchg eax, [skin_data]
test eax, eax
jz @f
stdcall kernel_free, eax
@@:
call parse_skin_data call parse_skin_data
xor eax, eax xor eax, eax
ret ret
@ -45,8 +40,7 @@ align 4
align 4 align 4
.noskin: .noskin:
stdcall kernel_free, eax stdcall kernel_free, eax
push 2 mov eax, 2
pop eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
struct SKIN_HEADER struct SKIN_HEADER
@ -98,7 +92,7 @@ load_default_skin:
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
parse_skin_data: parse_skin_data:
mov ebp, skin_data mov ebp, [skin_data]
cmp [ebp+SKIN_HEADER.ident], 'SKIN' cmp [ebp+SKIN_HEADER.ident], 'SKIN'
jne .exit jne .exit
@ -109,7 +103,7 @@ parse_skin_data:
rep stosd rep stosd
mov ebx, [ebp+SKIN_HEADER.params] mov ebx, [ebp+SKIN_HEADER.params]
add ebx, skin_data add ebx, [skin_data]
mov eax, [ebx+SKIN_PARAMS.skin_height] mov eax, [ebx+SKIN_PARAMS.skin_height]
mov [_skinh], eax mov [_skinh], eax
mov eax, [ebx+SKIN_PARAMS.colors.inner] mov eax, [ebx+SKIN_PARAMS.colors.inner]
@ -135,7 +129,7 @@ parse_skin_data:
mov dword[_skinmargins+4], eax mov dword[_skinmargins+4], eax
mov ebx, [ebp+SKIN_HEADER.bitmaps] mov ebx, [ebp+SKIN_HEADER.bitmaps]
add ebx, skin_data add ebx, [skin_data]
;-------------------------------------- ;--------------------------------------
align 4 align 4
.lp1: .lp1:
@ -160,7 +154,7 @@ align 4
dec eax dec eax
jnz .not_oper jnz .not_oper
mov esi, [ebx+SKIN_BITMAPS.data] mov esi, [ebx+SKIN_BITMAPS.data]
add esi, skin_data add esi, [skin_data]
mov eax, [esi+0] mov eax, [esi+0]
neg eax neg eax
mov edx, skin_active.oper.data mov edx, skin_active.oper.data
@ -195,7 +189,7 @@ align 4
align 4 align 4
.next_bitmap: .next_bitmap:
mov ecx, [ebx+SKIN_BITMAPS.data] mov ecx, [ebx+SKIN_BITMAPS.data]
add ecx, skin_data add ecx, [skin_data]
mov [edx+4], eax mov [edx+4], eax
mov eax, [ecx+0] mov eax, [ecx+0]
mov [edx+8], eax mov [edx+8], eax
@ -207,7 +201,7 @@ align 4
align 4 align 4
.end_bitmaps: .end_bitmaps:
mov ebx, [ebp+SKIN_HEADER.buttons] mov ebx, [ebp+SKIN_HEADER.buttons]
add ebx, skin_data add ebx, [skin_data]
;-------------------------------------- ;--------------------------------------
align 4 align 4
.lp2: .lp2:
@ -396,7 +390,8 @@ _dw3l:
;-------------------------------------- ;--------------------------------------
align 4 align 4
@@: @@:
cmp dword[skin_data], 'SKIN' mov eax, [skin_data]
cmp [eax], dword 'SKIN'
je @f je @f
xor eax, eax xor eax, eax
xor ebx, ebx xor ebx, ebx
@ -438,7 +433,8 @@ draw_clientbar:
;-------------------------------------- ;--------------------------------------
align 4 align 4
_noinside2: _noinside2:
cmp dword[skin_data], 'SKIN' mov eax, [skin_data]
cmp [eax], dword 'SKIN'
jne no_skin_add_button jne no_skin_add_button
;* close button ;* close button
mov edi, [BTN_ADDR] mov edi, [BTN_ADDR]

View File

@ -2918,7 +2918,7 @@ sys_getbackground:
jnz nogb1 jnz nogb1
mov eax, [BgrDataWidth] mov eax, [BgrDataWidth]
shl eax, 16 shl eax, 16
mov ax, [BgrDataHeight] mov ax, word [BgrDataHeight]
mov [esp+32], eax mov [esp+32], eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------