Rev 380 | Rev 425 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 380 | Rev 412 | ||
---|---|---|---|
Line 48... | Line 48... | ||
48 | 48 | ||
49 | align 32 |
49 | align 32 |
50 | SYSENTER_VAR equ 0 |
50 | SYSENTER_VAR equ 0 |
51 | sysenter_entry: |
51 | sysenter_entry: |
52 | ; Íàñòðàèâàåì ñòåê |
- | |
- | 52 | ; Íàñòðàèâàåì ñòåê |
|
53 | cli |
53 | ; cli sysenter clear IF |
54 | push eax |
54 | ; push eax |
55 | mov eax, [ss:CURRENT_TASK] |
55 | ; mov eax, [ss:CURRENT_TASK] |
56 | shl eax, 8 |
56 | ; shl eax, 8 |
57 | mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack] |
57 | ; mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack] |
58 | lea esp, [ss:eax + RING0_STACK_SIZE] ; configure ESP |
58 | ; lea esp, [eax + RING0_STACK_SIZE] ; configure ESP |
- | 59 | ; mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app |
|
- | 60 | ||
- | 61 | mov esp, [ss:CURRENT_TASK] |
|
- | 62 | shl esp, 8 |
|
- | 63 | mov esp, [ss:SLOT_BASE + esp + APPDATA.pl0_stack] |
|
59 | mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app |
64 | add esp, RING0_STACK_SIZE ; configure ESP |
60 | sti |
65 | sti |
61 | ;------------------ |
66 | ;------------------ |
62 | push ds es |
67 | push ds es |
63 | pushad |
68 | pushad |
Line 91... | Line 96... | ||
91 | ;; SYSCALL ENTRY ;; |
96 | ;; SYSCALL ENTRY ;; |
92 | ;; ;; |
97 | ;; ;; |
93 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
98 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
94 | align 32 |
99 | align 32 |
95 | syscall_entry: |
100 | syscall_entry: |
96 | cli |
101 | ; cli syscall clear IF |
97 | xchg ecx, [esp] |
102 | xchg ecx, [esp] |
98 | mov [SYSENTER_VAR + 4], esp |
103 | mov [SYSENTER_VAR + 4], esp |
- | 104 | ||
99 | mov [ss:sysenter_stack - 4], eax |
105 | ; mov [ss:sysenter_stack - 4], eax |
100 | mov eax, [ss:CURRENT_TASK] |
106 | ; mov eax, [ss:CURRENT_TASK] |
101 | shl eax, 8 |
107 | ; shl eax, 8 |
102 | mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack] |
108 | ; mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack] |
103 | lea esp, [ss:eax + RING0_STACK_SIZE] ; configure ESP |
109 | ; lea esp, [eax + RING0_STACK_SIZE] ; configure ESP |
104 | mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app |
110 | ; mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app |
- | 111 | ||
- | 112 | mov esp, [ss:CURRENT_TASK] |
|
- | 113 | shl esp, 8 |
|
- | 114 | mov esp, [ss:SLOT_BASE + esp + APPDATA.pl0_stack] |
|
- | 115 | add esp, RING0_STACK_SIZE ; configure ESP |
|
- | 116 | ||
105 | sti |
117 | sti |
106 | ;------------------ |
118 | ;------------------ |
107 | push ds es |
119 | push ds es |
108 | pushad |
120 | pushad |
109 | cld |
121 | cld |
Line 125... | Line 137... | ||
125 | pop eax |
137 | pop eax |
Line 126... | Line 138... | ||
126 | 138 | ||
127 | popad |
139 | popad |
128 | pop es ds |
140 | pop es ds |
- | 141 | ;------------------ |
|
- | 142 | ||
129 | ;------------------ |
143 | cli |
130 | mov esp, [SYSENTER_VAR + 4] |
144 | mov esp, [SYSENTER_VAR + 4] |
131 | xchg ecx, [esp] |
145 | xchg ecx, [esp] |
132 | sysret |
146 | sysret |
133 | iglobal |
147 | iglobal |