Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4423 → Rev 4424

/kernel/trunk/core/heap.inc
129,15 → 129,11
loop @B
 
stdcall alloc_pages, dword 32
 
or eax, PG_SW
mov ebx, HEAP_BASE
mov ecx, 32
mov edx, eax
mov edi, HEAP_BASE
.l1:
stdcall map_page, edi, edx, PG_SW
add edi, 0x1000
add edx, 0x1000
dec ecx
jnz .l1
call commit_pages
 
mov edi, HEAP_BASE ;descriptors
mov ebx, HEAP_BASE+sizeof.MEM_BLOCK ;free space
480,46 → 476,39
mov [pages_count], ebx
 
stdcall alloc_kernel_space, eax
mov [lin_addr], eax
mov ebx, [pages_count]
test eax, eax
jz .err
mov [lin_addr], eax
 
mov ecx, [pages_count]
mov edx, eax
mov ebx, ecx
 
shr ecx, 3
jz .next
shr ebx, 3
jz .tail
 
and ebx, not 7
push ebx
shl ebx, 3
stdcall alloc_pages, ebx
pop ecx ; yes ecx!!!
and eax, eax
test eax, eax
jz .err
 
mov edi, eax
mov edx, [lin_addr]
@@:
stdcall map_page, edx, edi, dword PG_SW
add edx, 0x1000
add edi, 0x1000
dec ecx
jnz @B
.next:
mov ecx, [pages_count]
and ecx, 7
mov ecx, ebx
or eax, PG_SW
mov ebx, [lin_addr]
call commit_pages
 
mov edx, ebx ; this dirty hack
.tail:
mov ebx, [pages_count]
and ebx, 7
jz .end
@@:
push ecx
call alloc_page
pop ecx
test eax, eax
jz .err
 
stdcall map_page, edx, eax, dword PG_SW
add edx, 0x1000
dec ecx
dec ebx
jnz @B
.end:
mov eax, [lin_addr]
/kernel/trunk/core/memory.inc
123,19 → 123,19
endp
 
align 4
proc map_page stdcall,lin_addr:dword,phis_addr:dword,flags:dword
;proc map_page stdcall,lin_addr:dword,phis_addr:dword,flags:dword
map_page:
push ebx
mov eax, [phis_addr]
mov eax, [esp+12] ; phis_addr
and eax, not 0xFFF
or eax, [flags]
mov ebx, [lin_addr]
or eax, [esp+16] ; flags
mov ebx, [esp+8] ; lin_addr
shr ebx, 12
mov [page_tabs+ebx*4], eax
mov eax, [lin_addr]
mov eax, [esp+8] ; lin_addr
pop ebx
invlpg [eax]
pop ebx
ret
endp
ret 12
 
align 4
map_space: ;not implemented
/kernel/trunk/core/taskman.inc
517,6 → 517,7
add edi, page_tabs
.remap:
lodsd
and eax, 0xFFFFF000
or eax, ebx; force user level r/w access
stosd
add edx, 0x1000
/kernel/trunk/gui/mouse.inc
523,9 → 523,6
;< esi = process slot
;< edi = pointer to WDATA struct
;------------------------------------------------------------------------------
; mov esi, [Screen_Max_X]
; inc esi
; imul esi, [mouse.state.pos.y]
mov esi, [mouse.state.pos.y]
mov esi, [d_width_calc_area + esi*4]
 
/kernel/trunk/gui/window.inc
1881,12 → 1881,7
 
; get WinMap start
push esi
; mov edi, [Screen_Max_X]
; inc edi
; mov esi, edi
mov esi, [Screen_Max_X]
inc esi
; imul edi, ebx
mov esi, [_display.width]
mov edi, [d_width_calc_area + ebx*4]
 
add edi, eax
1929,9 → 1924,6
 
; get WinMap start -> ebp
push eax
; mov eax, [Screen_Max_X] ; screen_sx
; inc eax
; imul eax, ebx
mov eax, [d_width_calc_area + ebx*4]
 
add eax, [esp]