Rev 164 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 164 | Rev 168 | ||
---|---|---|---|
1 | reg_eip equ ebp+4 |
1 | reg_eip equ ebp+4 |
2 | reg_cs equ ebp+8 |
2 | reg_cs equ ebp+8 |
3 | reg_eflags equ ebp+12 |
3 | reg_eflags equ ebp+12 |
4 | reg_esp equ ebp+16 |
4 | reg_esp equ ebp+16 |
5 | reg_ss equ ebp+20 |
5 | reg_ss equ ebp+20 |
6 | fpu_ctrl equ ebp-28 |
6 | ;fpu_ctrl equ ebp-28 |
7 | 7 | ||
8 | align 4 |
8 | align 4 |
9 | except_16: |
9 | except_16: |
10 | push ebp |
10 | push ebp |
11 | mov ebp, esp |
11 | mov ebp, esp |
12 | sub esp, 28 |
12 | ; sub esp, 28 |
13 | 13 | ||
14 | push eax |
14 | push eax |
15 | push ebx |
15 | push ebx |
16 | push ecx |
16 | push ecx |
17 | push edx |
17 | push edx |
18 | 18 | ||
19 | mov ebx, [ss:CURRENT_TASK] |
19 | mov ebx, [ss:CURRENT_TASK] |
20 | shl ebx, 8 |
20 | shl ebx, 8 |
21 | 21 | ||
22 | mov eax, [ss:ebx+PROC_BASE+APPDATA.fpu_handler] |
22 | mov eax, [ss:ebx+PROC_BASE+APPDATA.fpu_handler] |
23 | test eax, eax |
23 | test eax, eax |
24 | jz .default |
24 | jz .default |
25 | 25 | ||
26 | mov ecx, [reg_eip] |
26 | mov ecx, [reg_eip] |
27 | mov edx, [reg_esp] |
27 | mov edx, [reg_esp] |
28 | sub edx, 4 |
28 | sub edx, 4 |
29 | mov [ss:edx+new_app_base], ecx |
29 | mov [ss:edx+new_app_base], ecx |
30 | mov [reg_esp], edx |
30 | mov [reg_esp], edx |
31 | mov dword [reg_eip], eax |
31 | mov dword [reg_eip], eax |
32 | 32 | ||
33 | pop edx |
33 | pop edx |
34 | pop ecx |
34 | pop ecx |
35 | pop ebx |
35 | pop ebx |
36 | pop eax |
36 | pop eax |
37 | 37 | ||
38 | leave |
38 | leave |
39 | iretd |
39 | iretd |
40 | 40 | ||
41 | .default: |
41 | .default: |
42 | 42 | pop edx |
|
43 | fnstenv [fpu_ctrl] |
43 | pop ecx |
- | 44 | pop ebx |
|
- | 45 | pop eax |
|
- | 46 | leave |
|
- | 47 | ||
- | 48 | save_ring3_context ;debugger support |
|
- | 49 | ||
- | 50 | mov bl, 16 |
|
- | 51 | jmp exc_c |
|
- | 52 | ||
- | 53 | ; fnstenv [fpu_ctrl] |
|
44 | fnclex |
54 | ; fnclex |
45 | or word [fpu_ctrl], 0111111b |
55 | ; or word [fpu_ctrl], 0111111b |
46 | fldenv [fpu_ctrl] |
56 | ; fldenv [fpu_ctrl] |
47 | 57 | ||
- | 58 | ; pop edx |
|
- | 59 | ; pop ecx |
|
- | 60 | ; pop ebx |
|
- | 61 | ; pop eax |
|
- | 62 | ||
- | 63 | ; leave |
|
- | 64 | ; iretd |
|
- | 65 | ||
- | 66 | align 16 |
|
- | 67 | except_19: |
|
- | 68 | push ebp |
|
- | 69 | mov ebp, esp |
|
- | 70 | ||
- | 71 | push eax |
|
- | 72 | push ebx |
|
- | 73 | push ecx |
|
- | 74 | push edx |
|
- | 75 | ||
- | 76 | mov ebx, [ss:CURRENT_TASK] |
|
- | 77 | shl ebx, 8 |
|
- | 78 | ||
- | 79 | mov eax, [ss:ebx+PROC_BASE+APPDATA.sse_handler] |
|
- | 80 | test eax, eax |
|
- | 81 | jz .default |
|
- | 82 | ||
- | 83 | mov ecx, [reg_eip] |
|
- | 84 | mov edx, [reg_esp] |
|
- | 85 | sub edx, 4 |
|
- | 86 | mov [ss:edx+new_app_base], ecx |
|
- | 87 | mov [reg_esp], edx |
|
- | 88 | mov dword [reg_eip], eax |
|
- | 89 | ||
48 | pop edx |
90 | pop edx |
49 | pop ecx |
91 | pop ecx |
50 | pop ebx |
92 | pop ebx |
51 | pop eax |
93 | pop eax |
52 | 94 | ||
53 | leave |
95 | leave |
54 | iretd |
96 | iretd |
55 | 97 | ||
56 | 98 | .default: |
|
- | 99 | pop edx |
|
- | 100 | pop ecx |
|
- | 101 | pop ebx |
|
- | 102 | pop eax |
|
- | 103 | leave |
|
- | 104 | ||
- | 105 | save_ring3_context ;debugger support |
|
- | 106 | ||
- | 107 | mov bl, 19 |
|
- | 108 | jmp exc_c |
|
- | 109 | ||
57 | restore reg_eip |
110 | restore reg_eip |
58 | restore reg_cs |
111 | restore reg_cs |
59 | restore reg_eflags |
112 | restore reg_eflags |
60 | restore reg_esp |
113 | restore reg_esp |
61 | restore reg_ss |
114 | restore reg_ss |
62 | restore fpu_ctrl |
115 | ;restore fpu_ctrl |
63 | 116 | ||
64 | 117 |