/kernel/trunk/core/fpu.inc |
---|
181,110 → 181,3 |
iglobal |
fpu_owner dd 0 |
endg |
reg_eip equ ebp+4 |
reg_cs equ ebp+8 |
reg_eflags equ ebp+12 |
reg_esp equ ebp+16 |
reg_ss equ ebp+20 |
align 4 ;not used now |
proc except_16 ;fpu native exceptions handler |
test byte [esp+8+2], 2 |
jnz v86_except_16 |
push ebp |
mov ebp, esp |
push eax |
push ebx |
push ecx |
push edx |
mov ebx, [CURRENT_TASK] |
shl ebx, 8 |
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_handler] |
test eax, eax |
jz .default |
mov ecx, [reg_eip] |
mov edx, [reg_esp] |
sub edx, 4 |
mov [edx], ecx |
mov [reg_esp], edx |
mov dword [reg_eip], eax |
pop edx |
pop ecx |
pop ebx |
pop eax |
leave |
iretd |
.default: |
pop edx |
pop ecx |
pop ebx |
pop eax |
leave |
save_ring3_context ;debugger support |
mov bl, 16 |
jmp exc_c |
endp |
align 4 ;not used now |
proc except_19 ;sse exceptions handler |
test byte [esp+8+2], 2 |
jnz v86_except_19 |
push ebp |
mov ebp, esp |
push eax |
push ebx |
push ecx |
push edx |
mov ebx, [current_slot] |
mov eax, [ebx+APPDATA.sse_handler] |
test eax, eax |
jz .default |
mov ecx, [reg_eip] |
mov edx, [reg_esp] |
sub edx, 4 |
mov [edx], ecx |
mov [reg_esp], edx |
mov dword [reg_eip], eax |
pop edx |
pop ecx |
pop ebx |
pop eax |
leave |
iretd |
.default: |
pop edx |
pop ecx |
pop ebx |
pop eax |
leave |
save_ring3_context ;debugger support |
mov bl, 19 |
jmp exc_c |
endp |
restore reg_eip |
restore reg_cs |
restore reg_eflags |
restore reg_esp |
restore reg_ss |
/kernel/trunk/core/memory.inc |
---|
1033,10 → 1033,11 |
mov [esp+36], eax |
ret |
.15: |
mov ecx, [current_slot] |
mov eax, [ecx+APPDATA.fpu_handler] |
mov [ecx+APPDATA.fpu_handler], ebx |
mov [esp+36], eax |
mov eax, [current_slot] |
xchg ebx, [eax+APPDATA.exc_handler] |
xchg ecx, [eax+APPDATA.except_mask] |
mov [esp+36], ebx ; reg_eax+8 |
mov [esp+24], ecx ; reg_ebx+8 |
ret |
.16: |
test ebx, ebx |
1051,11 → 1052,12 |
mov [esp+36], eax |
ret |
.18: |
mov ecx, [current_slot] |
mov eax, [ecx+APPDATA.sse_handler] |
mov [ecx+APPDATA.sse_handler], ebx |
mov [esp+36], eax |
ret |
mov eax, [current_slot] |
btr [eax+APPDATA.except_mask],ebx |
setc byte[esp+36] |
jecxz @f |
bts [eax+APPDATA.except_mask],ebx |
@@: ret |
.19: |
cmp ebx, OS_BASE |
jae .fail |
/kernel/trunk/core/sys32.inc |
---|
124,22 → 124,20 |
Mov ds,ax,app_data ; çàãðóçèì ïðàâèëüíûå çíà÷åíèÿ |
mov es,ax ; â ñåãìåíòíûå ðåãèñòðû |
cld ; è ïðèâîäèì DF ê ñòàíäàðòó |
movzx ebx,bl |
; redirect to V86 manager? (EFLAGS & 0x20000) != 0? |
test byte[reg_eflags+2],2 |
jnz v86_exc_c |
cmp bl,14 ; #PF |
jne .l0 |
jne @f |
call page_fault_handler |
.l0: mov esi, [current_slot] |
mov eax,[esi+APPDATA.fpu_handler] |
cmp bl,16 ; #MF |
je .l1 |
cmp bl,19 ; #XF |
jne .l2 |
mov eax,[esi+APPDATA.sse_handler] |
.l1: test eax, eax |
@@: mov esi, [current_slot] |
btr [esi+APPDATA.except_mask], ebx |
jnc @f |
mov eax,[esi+APPDATA.exc_handler] |
test eax, eax |
jnz IRetToUserHook |
.l2: cli |
@@: cli |
mov eax, [esi+APPDATA.debugger_slot] |
test eax, eax |
jnz .debug |
154,15 → 152,16 |
; eax=debugger PID |
cmp bl,1 ; #DB |
je debug_ex |
movzx edx, bl ; debug_message data=Number_Of_Exception |
mov edx, ebx ; debug_message data=Number_Of_Exception |
mov ecx,1 ; debug_message code=other_exception |
jmp debug_ex.notify ; notify debugger and suspend ourself |
IRetToUserHook: |
xchg eax, [reg_eip] |
sub dword[reg_esp3], 4 |
sub dword[reg_esp3], 8 |
mov edi, [reg_esp3] |
stosd |
mov [edi], ebx |
restore_ring3_context |
unknown_interrupt: |
iretd |
176,8 → 175,7 |
cmp bl, 0x0e |
jbe .l1 |
.l0: mov bl, 0x09 |
.l1: movzx eax,bl |
mov eax,[msg_fault_sel+eax*4 - 0x08*4] |
.l1: mov eax,[msg_fault_sel+ebx*4 - 0x08*4] |
DEBUGF 1, "K : %s\n", eax |
mov eax, [reg_cs3+4] |
mov edi, msg_sel_app |
/kernel/trunk/core/taskman.inc |
---|
955,8 → 955,8 |
shl eax, 8 |
mov [eax+SLOT_BASE+APPDATA.fpu_state], edi |
mov [eax+SLOT_BASE+APPDATA.fpu_handler], 0 |
mov [eax+SLOT_BASE+APPDATA.sse_handler], 0 |
mov [eax+SLOT_BASE+APPDATA.exc_handler], 0 |
mov [eax+SLOT_BASE+APPDATA.except_mask], 0 |
;set default io permission map |
mov [eax+SLOT_BASE+APPDATA.io_map],\ |