fixed bug in malloc.inc

code cleanup in cursors.inc

git-svn-id: svn://kolibrios.org@326 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-02-07 12:25:23 +00:00
parent 3111c3f230
commit a79e7c4171
3 changed files with 7 additions and 49 deletions

View File

@ -27,6 +27,7 @@ malloc:
jae .large jae .large
mov ecx, esi mov ecx, esi
shr ecx, 3
or eax, -1 or eax, -1
shl eax, cl shl eax, cl
and eax, [mst.smallmap] and eax, [mst.smallmap]
@ -687,7 +688,6 @@ malloc_small:
lea eax, [edi+ebp+4] lea eax, [edi+ebp+4]
pop edi pop edi
or ecx, 3 or ecx, 3
pop esi
mov [ebx+4], ecx mov [ebx+4], ecx
or dword [eax], 1 or dword [eax], 1
pop ebp pop ebp
@ -918,9 +918,9 @@ malloc_large:
lea esi, [ebx+ebp] lea esi, [ebx+ebp]
call unlink_large_chunk call unlink_large_chunk
; if (rsize < 256) ; if (rsize < 16)
cmp edi, 256 cmp edi, 16
jae .large jae .large
; v->head = (rsize + nb)|PINUSE_BIT|CINUSE_BIT; ; v->head = (rsize + nb)|PINUSE_BIT|CINUSE_BIT;
@ -954,8 +954,9 @@ malloc_large:
; insert_large_chunk((tchunkptr)r, rsize); ; insert_large_chunk((tchunkptr)r, rsize);
mov [esi+edi], edi mov [esi+edi], edi
mov ebx, edi mov eax, edi
call insert_large_chunk mov ecx, esi
call insert_chunk
lea eax, [ebp+8] lea eax, [ebp+8]
add esp, 8 add esp, 8

View File

@ -491,7 +491,7 @@ proc ac97_irq
call [ctrl.ctrl_write8] call [ctrl.ctrl_write8]
mov eax, [civ_val] mov eax, [civ_val]
add eax, 2 add eax, 1
and eax, 31 and eax, 31
mov ebx, dword [buff_list+eax*4] mov ebx, dword [buff_list+eax*4]

View File

@ -260,23 +260,6 @@ proc vesa_init_cursor stdcall, dst:dword, src:dword
ret ret
endp endp
align 4
alloc_cursor:
mov eax, CURSOR_SIZE
call malloc
test eax, eax
jz .fail
xor ebx, ebx
mov [eax+CURSOR.magic], 'CURS'
; mov [eax+CURSOR.destructor], CURSOR_SIZE
mov [eax+CURSOR.pid], ebx
mov [eax+CURSOR.hot_x], ebx
mov [eax+CURSOR.hot_y], ebx
.fail:
ret
align 4 align 4
proc set_cursor stdcall, hcursor:dword proc set_cursor stdcall, hcursor:dword
mov eax, [hcursor] mov eax, [hcursor]
@ -426,31 +409,6 @@ proc delete_cursor stdcall, hcursor:dword
call [eax+APPOBJ.destroy] call [eax+APPOBJ.destroy]
.fail: .fail:
ret ret
;@@:
; mov eax, [hw_cursor]
; test eax, eax
; jz @F
; xor ebx, ebx
; mov ecx, [esi+CURSOR.base]
; mov [hsrv], eax
; mov [io_code], VIDEO_FREE
; mov [input], ecx
; mov [inp_size], 4
; mov [output], ebx
; mov [out_size], ebx
; lea eax, [hsrv]
; stdcall srv_handler, eax
; jmp .exit
;@@:
; stdcall kernel_free, [esi+CURSOR.base]
;.exit:
; mov eax, [hcursor]
; call destroy_kernel_object
;.fail:
; ret
endp endp
; param ; param
@ -463,7 +421,6 @@ destroy_cursor:
stdcall kernel_free, [eax+CURSOR.base] stdcall kernel_free, [eax+CURSOR.base]
pop eax pop eax
call destroy_kernel_object call destroy_kernel_object
ret ret