forked from KolibriOS/kolibrios
1)fix user_realloc()
2)fix mouse events git-svn-id: svn://kolibrios.org@455 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1db510e6a9
commit
0305115a3b
@ -321,11 +321,12 @@ sys_pgmap equ (OS_BASE+0x00052000)
|
|||||||
|
|
||||||
new_app_base equ 0;
|
new_app_base equ 0;
|
||||||
|
|
||||||
twdw equ (CURRENT_TASK-window_data)
|
twdw equ 0x3000 ;(CURRENT_TASK-window_data)
|
||||||
|
|
||||||
std_application_base_address equ new_app_base
|
std_application_base_address equ new_app_base
|
||||||
RING0_STACK_SIZE equ (0x2000 - 512) ;512 áàéò äëÿ êîíòåêñòà FPU
|
RING0_STACK_SIZE equ (0x2000 - 512) ;512 áàéò äëÿ êîíòåêñòà FPU
|
||||||
|
|
||||||
|
if 0
|
||||||
REG_SS equ (RING0_STACK_SIZE-4)
|
REG_SS equ (RING0_STACK_SIZE-4)
|
||||||
REG_APP_ESP equ (RING0_STACK_SIZE-8)
|
REG_APP_ESP equ (RING0_STACK_SIZE-8)
|
||||||
REG_EFLAGS equ (RING0_STACK_SIZE-12)
|
REG_EFLAGS equ (RING0_STACK_SIZE-12)
|
||||||
@ -341,6 +342,23 @@ REG_EBP equ (RING0_STACK_SIZE-48)
|
|||||||
REG_ESI equ (RING0_STACK_SIZE-52)
|
REG_ESI equ (RING0_STACK_SIZE-52)
|
||||||
REG_EDI equ (RING0_STACK_SIZE-56)
|
REG_EDI equ (RING0_STACK_SIZE-56)
|
||||||
REG_RET equ (RING0_STACK_SIZE-60) ;irq0.return
|
REG_RET equ (RING0_STACK_SIZE-60) ;irq0.return
|
||||||
|
end if
|
||||||
|
|
||||||
|
REG_SS equ (RING0_STACK_SIZE-4)
|
||||||
|
REG_APP_ESP equ (RING0_STACK_SIZE-8)
|
||||||
|
REG_EFLAGS equ (RING0_STACK_SIZE-12)
|
||||||
|
REG_CS equ (RING0_STACK_SIZE-16)
|
||||||
|
REG_EIP equ (RING0_STACK_SIZE-20)
|
||||||
|
REG_EAX equ (RING0_STACK_SIZE-24)
|
||||||
|
REG_ECX equ (RING0_STACK_SIZE-28)
|
||||||
|
REG_EDX equ (RING0_STACK_SIZE-32)
|
||||||
|
REG_EBX equ (RING0_STACK_SIZE-36)
|
||||||
|
REG_ESP equ (RING0_STACK_SIZE-40) ;RING0_STACK_SIZE-20
|
||||||
|
REG_EBP equ (RING0_STACK_SIZE-44)
|
||||||
|
REG_ESI equ (RING0_STACK_SIZE-48)
|
||||||
|
REG_EDI equ (RING0_STACK_SIZE-52)
|
||||||
|
REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return
|
||||||
|
|
||||||
|
|
||||||
PG_UNMAP equ 0x000
|
PG_UNMAP equ 0x000
|
||||||
PG_MAP equ 0x001
|
PG_MAP equ 0x001
|
||||||
|
@ -864,16 +864,15 @@ user_realloc:
|
|||||||
jnz .nofreeall
|
jnz .nofreeall
|
||||||
mov eax, [page_tabs+ecx*4]
|
mov eax, [page_tabs+ecx*4]
|
||||||
and eax, not 0xFFF
|
and eax, not 0xFFF
|
||||||
mov edx, [CURRENT_TASK]
|
mov edx, [current_slot]
|
||||||
shl edx, 8
|
mov ebx, [APPDATA.mem_size+edx]
|
||||||
mov ebx, [SLOT_BASE+APPDATA.mem_size+edx]
|
|
||||||
sub ebx, eax
|
sub ebx, eax
|
||||||
add ebx, 0x1000
|
add ebx, 0x1000
|
||||||
or al, FREE_BLOCK
|
or al, FREE_BLOCK
|
||||||
mov [page_tabs+ecx*4], eax
|
mov [page_tabs+ecx*4], eax
|
||||||
push esi edi
|
push esi edi
|
||||||
mov esi, [SLOT_BASE+APPDATA.heap_base+edx]
|
mov esi, [APPDATA.heap_base+edx]
|
||||||
mov edi, [SLOT_BASE+APPDATA.heap_top+edx]
|
mov edi, [APPDATA.heap_top+edx]
|
||||||
call update_mem_size
|
call update_mem_size
|
||||||
call user_normalize
|
call user_normalize
|
||||||
pop edi esi
|
pop edi esi
|
||||||
@ -886,10 +885,9 @@ user_realloc:
|
|||||||
shr ebx, 12
|
shr ebx, 12
|
||||||
sub ebx, edx
|
sub ebx, edx
|
||||||
push ebx ecx edx
|
push ebx ecx edx
|
||||||
mov edx, [CURRENT_TASK]
|
mov edx, [current_slot]
|
||||||
shl edx, 8
|
|
||||||
shl ebx, 12
|
shl ebx, 12
|
||||||
sub ebx, [SLOT_BASE+APPDATA.mem_size+edx]
|
sub ebx, [APPDATA.mem_size+edx]
|
||||||
neg ebx
|
neg ebx
|
||||||
call update_mem_size
|
call update_mem_size
|
||||||
pop edx ecx ebx
|
pop edx ecx ebx
|
||||||
@ -901,9 +899,8 @@ user_realloc:
|
|||||||
shl ebx, 12
|
shl ebx, 12
|
||||||
jz .ret
|
jz .ret
|
||||||
push esi
|
push esi
|
||||||
mov esi, [CURRENT_TASK]
|
mov esi, [current_slot]
|
||||||
shl esi, 8
|
mov esi, [APPDATA.heap_top+esi]
|
||||||
mov esi, [SLOT_BASE+APPDATA.heap_top+esi]
|
|
||||||
shr esi, 12
|
shr esi, 12
|
||||||
@@:
|
@@:
|
||||||
cmp edx, esi
|
cmp edx, esi
|
||||||
@ -925,9 +922,8 @@ user_realloc:
|
|||||||
ret
|
ret
|
||||||
.realloc_add:
|
.realloc_add:
|
||||||
; get some additional memory
|
; get some additional memory
|
||||||
mov eax, [CURRENT_TASK]
|
mov eax, [current_slot]
|
||||||
shl eax, 8
|
mov eax, [APPDATA.heap_top+eax]
|
||||||
mov eax, [SLOT_BASE+APPDATA.heap_top+eax]
|
|
||||||
shr eax, 12
|
shr eax, 12
|
||||||
cmp edx, eax
|
cmp edx, eax
|
||||||
jae .cant_inplace
|
jae .cant_inplace
|
||||||
@ -958,19 +954,17 @@ user_realloc:
|
|||||||
cld
|
cld
|
||||||
rep stosd
|
rep stosd
|
||||||
pop edi
|
pop edi
|
||||||
mov edx, [CURRENT_TASK]
|
mov edx, [current_slot]
|
||||||
shl edx, 8
|
|
||||||
shl ebx, 12
|
shl ebx, 12
|
||||||
add ebx, [SLOT_BASE+APPDATA.mem_size+edx]
|
add ebx, [APPDATA.mem_size+edx]
|
||||||
call update_mem_size
|
call update_mem_size
|
||||||
pop eax edx ecx
|
pop eax edx ecx
|
||||||
ret
|
ret
|
||||||
.cant_inplace:
|
.cant_inplace:
|
||||||
push esi edi
|
push esi edi
|
||||||
mov eax, [CURRENT_TASK]
|
mov eax, [current_slot]
|
||||||
shl eax, 8
|
mov esi, [APPDATA.heap_base+eax]
|
||||||
mov esi, [SLOT_BASE+APPDATA.heap_base+eax]
|
mov edi, [APPDATA.heap_top+eax]
|
||||||
mov edi, [SLOT_BASE+APPDATA.heap_top+eax]
|
|
||||||
shr esi, 12
|
shr esi, 12
|
||||||
shr edi, 12
|
shr edi, 12
|
||||||
sub ebx, ecx
|
sub ebx, ecx
|
||||||
@ -1009,7 +1003,6 @@ user_realloc:
|
|||||||
inc esi
|
inc esi
|
||||||
mov eax, esi
|
mov eax, esi
|
||||||
shl eax, 12
|
shl eax, 12
|
||||||
sub eax, new_app_base
|
|
||||||
push eax
|
push eax
|
||||||
mov eax, [page_tabs+ecx*4]
|
mov eax, [page_tabs+ecx*4]
|
||||||
and eax, not 0xFFF
|
and eax, not 0xFFF
|
||||||
@ -1030,10 +1023,9 @@ user_realloc:
|
|||||||
dec edx
|
dec edx
|
||||||
jnz @b
|
jnz @b
|
||||||
push ebx
|
push ebx
|
||||||
mov edx, [CURRENT_TASK]
|
mov edx, [current_slot]
|
||||||
shl edx, 8
|
|
||||||
shl ebx, 12
|
shl ebx, 12
|
||||||
add ebx, [SLOT_BASE+APPDATA.mem_size+edx]
|
add ebx, [APPDATA.mem_size+edx]
|
||||||
call update_mem_size
|
call update_mem_size
|
||||||
pop ebx
|
pop ebx
|
||||||
@@:
|
@@:
|
||||||
|
@ -13,7 +13,7 @@ $Revision: 434 $
|
|||||||
|
|
||||||
align 32
|
align 32
|
||||||
irq0:
|
irq0:
|
||||||
pushfd
|
; pushfd
|
||||||
pushad
|
pushad
|
||||||
mov ax, app_data ;
|
mov ax, app_data ;
|
||||||
mov ds, ax
|
mov ds, ax
|
||||||
@ -40,7 +40,7 @@ irq0:
|
|||||||
mov [DONT_SWITCH], byte 0
|
mov [DONT_SWITCH], byte 0
|
||||||
|
|
||||||
popad
|
popad
|
||||||
popfd
|
; popfd
|
||||||
iretd
|
iretd
|
||||||
|
|
||||||
.change_task:
|
.change_task:
|
||||||
@ -60,7 +60,7 @@ irq0:
|
|||||||
|
|
||||||
.return:
|
.return:
|
||||||
popad
|
popad
|
||||||
popfd
|
; popfd
|
||||||
iretd
|
iretd
|
||||||
|
|
||||||
|
|
||||||
@ -197,6 +197,7 @@ do_change_task:
|
|||||||
shl ebx, 8
|
shl ebx, 8
|
||||||
add ebx, SLOT_BASE
|
add ebx, SLOT_BASE
|
||||||
mov [current_slot], ebx
|
mov [current_slot], ebx
|
||||||
|
|
||||||
shl esi, 8
|
shl esi, 8
|
||||||
add esi, SLOT_BASE
|
add esi, SLOT_BASE
|
||||||
|
|
||||||
|
@ -1018,7 +1018,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
|||||||
mov [ebx+REG_ECX], eax
|
mov [ebx+REG_ECX], eax
|
||||||
mov [ebx+REG_EAX], eax
|
mov [ebx+REG_EAX], eax
|
||||||
|
|
||||||
mov [ebx+REG_EFL_2], dword 0x1002
|
; mov [ebx+REG_EFL_2], dword 0x1002
|
||||||
|
|
||||||
mov eax, [esi+0x08] ;app_eip
|
mov eax, [esi+0x08] ;app_eip
|
||||||
mov [ebx+REG_EIP], eax ;app_entry
|
mov [ebx+REG_EIP], eax ;app_entry
|
||||||
|
@ -319,6 +319,8 @@ windowtypechanged rd 1
|
|||||||
hd_entries rd 1 ;unused ? 0xfe10
|
hd_entries rd 1 ;unused ? 0xfe10
|
||||||
|
|
||||||
;* start code - Mario79
|
;* start code - Mario79
|
||||||
|
|
||||||
|
mouse_active rd 1
|
||||||
mouse_pause rd 1
|
mouse_pause rd 1
|
||||||
MouseTickCounter rd 1
|
MouseTickCounter rd 1
|
||||||
ps2_mouse_detected rb 1
|
ps2_mouse_detected rb 1
|
||||||
|
@ -574,20 +574,20 @@ get_event_for_app:
|
|||||||
|
|
||||||
no_eventoccur3:
|
no_eventoccur3:
|
||||||
|
|
||||||
|
|
||||||
;mov edi,[TASK_BASE] ; mouse event
|
;mov edi,[TASK_BASE] ; mouse event
|
||||||
test [edi+TASKDATA.event_mask],dword 00100000b
|
test [edi+TASKDATA.event_mask],dword 00100000b
|
||||||
jz no_mouse_event
|
jz no_mouse_event
|
||||||
mov eax,[current_slot]
|
|
||||||
test [eax+APPDATA.event_mask],dword 00100000b
|
mov eax, [CURRENT_TASK]
|
||||||
|
shl eax, 8
|
||||||
|
test [eax+SLOT_BASE+APPDATA.event_mask],dword 00100000b
|
||||||
jz no_mouse_event
|
jz no_mouse_event
|
||||||
and [eax+APPDATA.event_mask],dword 0xffffffff-00100000b
|
and [eax+SLOT_BASE+APPDATA.event_mask],dword (not 00100000b)
|
||||||
popad
|
popad
|
||||||
mov eax,6
|
mov eax,6
|
||||||
ret
|
ret
|
||||||
no_mouse_event:
|
no_mouse_event:
|
||||||
|
|
||||||
|
|
||||||
;mov edi,[TASK_BASE] ; DESKTOP BACKGROUND REDRAW
|
;mov edi,[TASK_BASE] ; DESKTOP BACKGROUND REDRAW
|
||||||
test [edi+TASKDATA.event_mask],dword 16
|
test [edi+TASKDATA.event_mask],dword 16
|
||||||
jz no_eventoccur5
|
jz no_eventoccur5
|
||||||
|
@ -657,6 +657,7 @@ include 'vmodeld.inc'
|
|||||||
mov [CURRENT_TASK],dword 1
|
mov [CURRENT_TASK],dword 1
|
||||||
mov [TASK_COUNT],dword 1
|
mov [TASK_COUNT],dword 1
|
||||||
mov [current_slot], SLOT_BASE+256
|
mov [current_slot], SLOT_BASE+256
|
||||||
|
mov [TASK_BASE],dword TASK_DATA
|
||||||
mov [TASK_DATA+TASKDATA.wnd_number], 1 ; on screen number
|
mov [TASK_DATA+TASKDATA.wnd_number], 1 ; on screen number
|
||||||
mov [TASK_DATA+TASKDATA.pid], 1 ; process id number
|
mov [TASK_DATA+TASKDATA.pid], 1 ; process id number
|
||||||
mov [TASK_DATA+TASKDATA.mem_start], 0 ; process base address
|
mov [TASK_DATA+TASKDATA.mem_start], 0 ; process base address
|
||||||
@ -3322,9 +3323,6 @@ checkpixel:
|
|||||||
pop edx eax
|
pop edx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
uglobal
|
|
||||||
mouse_active db 0
|
|
||||||
endg
|
|
||||||
iglobal
|
iglobal
|
||||||
cpustring db '/RD/1/CPU',0
|
cpustring db '/RD/1/CPU',0
|
||||||
endg
|
endg
|
||||||
@ -3346,6 +3344,7 @@ checkmisc:
|
|||||||
xor edx,edx ; no flags
|
xor edx,edx ; no flags
|
||||||
call fs_RamdiskExecute.flags
|
call fs_RamdiskExecute.flags
|
||||||
mov [ctrl_alt_del], 0
|
mov [ctrl_alt_del], 0
|
||||||
|
|
||||||
nocpustart:
|
nocpustart:
|
||||||
cmp [mouse_active], 1
|
cmp [mouse_active], 1
|
||||||
jne mouse_not_active
|
jne mouse_not_active
|
||||||
@ -3354,11 +3353,10 @@ checkmisc:
|
|||||||
mov ecx, [TASK_COUNT]
|
mov ecx, [TASK_COUNT]
|
||||||
set_mouse_event:
|
set_mouse_event:
|
||||||
add edi, 256
|
add edi, 256
|
||||||
or [edi+SLOT_BASE+APPDATA.event_mask], dword 00100000b
|
or [edi+SLOT_BASE+APPDATA.event_mask], dword 100000b
|
||||||
loop set_mouse_event
|
loop set_mouse_event
|
||||||
|
|
||||||
mouse_not_active:
|
mouse_not_active:
|
||||||
|
|
||||||
|
|
||||||
cmp [REDRAW_BACKGROUND],byte 0 ; background update ?
|
cmp [REDRAW_BACKGROUND],byte 0 ; background update ?
|
||||||
jz nobackgr
|
jz nobackgr
|
||||||
cmp [background_defined], 0
|
cmp [background_defined], 0
|
||||||
|
Loading…
Reference in New Issue
Block a user