small optimization, not more

git-svn-id: svn://kolibrios.org@1076 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Galkov 2009-05-22 11:40:07 +00:00
parent d8f8c0faad
commit 2df36c4abf
2 changed files with 30 additions and 36 deletions

View File

@ -414,31 +414,3 @@ debugger_notify:
or byte [SLOT_BASE+eax+APPDATA.event_mask+1], 1 ; set flag 100h or byte [SLOT_BASE+eax+APPDATA.event_mask+1], 1 ; set flag 100h
.ret: .ret:
ret ret
debug_ex:
; we are debugged process, notify debugger and suspend ourself
; eax=debugger PID
mov edx, dr6 ; debug_message data=DR6_image
xor ebx, ebx
mov dr6, ebx
mov ebx, dr7
mov cl, not 8
.l1: shl bl,2
jc @f
and dl, cl
@@: sar cl,1
jc .l1
mov ecx,3 ; debug_message code=debug_exception
.notify:
push edx ; debug_message data
mov ebx, [TASK_BASE]
push [ebx+TASKDATA.pid] ; PID
push ecx ; debug_message code
mov ecx,12 ; debug_message size
call debugger_notify ;; only ONE using, inline ???
add esp,12
mov edx, [TASK_BASE]
mov byte [edx+TASKDATA.state], 1 ; suspended
call change_task
restore_ring3_context
iretd

View File

@ -33,7 +33,7 @@ iglobal
align 4 align 4
sys_int: sys_int:
;exception handlers addresses (for interrupt gate construction) ;exception handlers addresses (for interrupt gate construction)
dd e0,e1,e2,e3,e4,e5,e6,except_7 dd e0,e1,e2,e3,e4,e5,e6,except_7 ; SEE: core/fpu.inc
dd e8,e9,e10,e11,e12,e13,page_fault_exc,e15 dd e8,e9,e10,e11,e12,e13,page_fault_exc,e15
dd e16, e17,e18, e19 dd e16, e17,e18, e19
times 12 dd unknown_interrupt ;int_20..int_31 times 12 dd unknown_interrupt ;int_20..int_31
@ -53,7 +53,7 @@ iglobal
;int_0x40 gate trap (for directly copied) ;int_0x40 gate trap (for directly copied)
dw i40 and 0xFFFF, os_code, 11101111b shl 8, i40 shr 16 dw i40 and 0xFFFF, os_code, 11101111b shl 8, i40 shr 16
idtreg: ; data for LIDT instruction (must be immediately below sys_int data) idtreg: ; data for LIDT instruction (!!! must be immediately below sys_int data)
dw 2*($-sys_int-4)-1 dw 2*($-sys_int-4)-1
dd idts ;0x8000B100 dd idts ;0x8000B100
dw 0 ;ïðîñòî âûðàâíèâàíèå dw 0 ;ïðîñòî âûðàâíèâàíèå
@ -130,7 +130,7 @@ exc_c: ;
jnz v86_exc_c jnz v86_exc_c
cmp bl,14 ; #PF cmp bl,14 ; #PF
jne @f jne @f
call page_fault_handler call page_fault_handler ; SEE: core/memory.inc
@@: mov esi, [current_slot] @@: mov esi, [current_slot]
btr [esi+APPDATA.except_mask], ebx btr [esi+APPDATA.except_mask], ebx
jnc @f jnc @f
@ -146,15 +146,37 @@ exc_c: ;
call show_error_parameters ;; only ONE using, inline ??? call show_error_parameters ;; only ONE using, inline ???
;mov edx, [TASK_BASE] ;mov edx, [TASK_BASE]
mov [edx + TASKDATA.state], byte 4 ; terminate mov [edx + TASKDATA.state], byte 4 ; terminate
jmp change_task ; stack - here it does not matter at all jmp change_task ; stack - here it does not matter at all, SEE: core/shed.inc
.debug: .debug:
; we are debugged process, notify debugger and suspend ourself ; we are debugged process, notify debugger and suspend ourself
; eax=debugger PID ; eax=debugger PID
cmp bl,1 ; #DB
je debug_ex
mov edx, ebx ; debug_message data=Number_Of_Exception
mov ecx,1 ; debug_message code=other_exception mov ecx,1 ; debug_message code=other_exception
jmp debug_ex.notify ; notify debugger and suspend ourself cmp bl,1 ; #DB
jne .notify ; notify debugger and suspend ourself
mov ebx, dr6 ; debug_message data=DR6_image
xor edx, edx
mov dr6, edx
mov edx, dr7
mov cl, not 8
.l1: shl dl,2
jc @f
and bl, cl
@@: sar cl,1
jc .l1
mov cl, 3 ; debug_message code=debug_exception
.notify:
push ebx ; debug_message data
mov ebx, [TASK_BASE]
push [ebx+TASKDATA.pid] ; PID
push ecx ; debug_message code ((here: ecx==1/3))
mov cl, 12 ; debug_message size
call debugger_notify ;; only ONE using, inline ??? SEE: core/debug.inc
add esp,12
mov edx, [TASK_BASE]
mov byte [edx+TASKDATA.state], 1 ; suspended
call change_task ; SEE: core/shed.inc
restore_ring3_context
iretd
IRetToUserHook: IRetToUserHook:
xchg eax, [reg_eip] xchg eax, [reg_eip]