Changeset 7294 in vbox
- Timestamp:
- Mar 5, 2008 10:37:35 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMGC/EMGCA.asm
r7286 r7294 179 179 align 16 180 180 BEGINPROC EMGCEmulateLockXAdd 181 push ebx 182 mov ecx, [esp + 04h + 4] ; ecx = first parameter 183 mov ebx, [esp + 08h + 4] ; ebx = 2nd parameter 184 mov eax, [esp + 0ch + 4] ; eax = size of parameters 185 186 cmp al, 4 187 je short .do_dword ; 4 bytes variant 188 cmp al, 2 189 je short .do_word ; 2 byte variant 190 cmp al, 1 191 je short .do_byte ; 1 bytes variant 192 int3 193 194 .do_dword: 195 ; load 2nd parameter's value 196 mov eax, dword [ebx] 181 mov ecx, [esp + 04h + 0] ; ecx = first parameter 182 mov edx, [esp + 08h + 0] ; edx = 2nd parameter 183 mov eax, [esp + 0ch + 0] ; eax = size of parameters 184 185 cmp al, 4 186 je short .do_dword ; 4 bytes variant 187 cmp al, 2 188 je short .do_word ; 2 byte variant 189 cmp al, 1 190 je short .do_byte ; 1 bytes variant 191 int3 192 193 .do_dword: 194 ; load 2nd parameter's value 195 mov eax, dword [edx] 197 196 lock xadd dword [ecx], eax ; do 4 bytes XADD 198 mov dword [e bx], eax199 jmp short .done 200 201 .do_word: 202 ; load 2nd parameter's value 203 mov eax, dword [e bx]197 mov dword [edx], eax 198 jmp short .done 199 200 .do_word: 201 ; load 2nd parameter's value 202 mov eax, dword [edx] 204 203 lock xadd word [ecx], ax ; do 2 bytes XADD 205 mov word [e bx], ax206 jmp short .done 207 208 .do_byte: 209 ; load 2nd parameter's value 210 mov eax, dword [e bx]204 mov word [edx], ax 205 jmp short .done 206 207 .do_byte: 208 ; load 2nd parameter's value 209 mov eax, dword [edx] 211 210 lock xadd byte [ecx], al ; do 1 bytes XADD 212 mov byte [ebx], al 213 214 .done: 215 ; collect flags and return. 216 pushf 217 pop eax 218 219 mov edx, [esp + 10h + 4] ; eflags pointer 220 mov dword [edx], eax 221 222 pop ebx 211 mov byte [edx], al 212 213 .done: 214 ; collect flags and return. 215 mov edx, [esp + 10h + 0] ; eflags pointer 216 pushf 217 pop dword [edx] 218 223 219 mov eax, VINF_SUCCESS 224 220 retn … … 226 222 ; Read error - we will be here after our page fault handler. 227 223 GLOBALNAME EMGCEmulateLockXAdd_Error 228 pop ebx229 224 mov eax, VERR_ACCESS_DENIED 230 225 ret … … 245 240 align 16 246 241 BEGINPROC EMGCEmulateXAdd 247 push ebx 248 mov ecx, [esp + 04h + 4] ; ecx = first parameter 249 mov ebx, [esp + 08h + 4] ; ebx = 2nd parameter (eax) 250 mov eax, [esp + 0ch + 4] ; eax = size of parameters 251 252 cmp al, 4 253 je short .do_dword ; 4 bytes variant 254 cmp al, 2 255 je short .do_word ; 2 byte variant 256 cmp al, 1 257 je short .do_byte ; 1 bytes variant 258 int3 259 260 .do_dword: 261 ; load 2nd parameter's value 262 mov eax, dword [ebx] 242 mov ecx, [esp + 04h + 0] ; ecx = first parameter 243 mov edx, [esp + 08h + 0] ; edx = 2nd parameter (eax) 244 mov eax, [esp + 0ch + 0] ; eax = size of parameters 245 246 cmp al, 4 247 je short .do_dword ; 4 bytes variant 248 cmp al, 2 249 je short .do_word ; 2 byte variant 250 cmp al, 1 251 je short .do_byte ; 1 bytes variant 252 int3 253 254 .do_dword: 255 ; load 2nd parameter's value 256 mov eax, dword [edx] 263 257 xadd dword [ecx], eax ; do 4 bytes XADD 264 mov dword [e bx], eax265 jmp short .done 266 267 .do_word: 268 ; load 2nd parameter's value 269 mov eax, dword [e bx]258 mov dword [edx], eax 259 jmp short .done 260 261 .do_word: 262 ; load 2nd parameter's value 263 mov eax, dword [edx] 270 264 xadd word [ecx], ax ; do 2 bytes XADD 271 mov word [e bx], ax272 jmp short .done 273 274 .do_byte: 275 ; load 2nd parameter's value 276 mov eax, dword [e bx]265 mov word [edx], ax 266 jmp short .done 267 268 .do_byte: 269 ; load 2nd parameter's value 270 mov eax, dword [edx] 277 271 xadd byte [ecx], al ; do 1 bytes XADD 278 mov byte [ebx], al 279 280 .done: 281 ; collect flags and return. 282 pushf 283 pop eax 284 285 mov edx, [esp + 10h + 4] ; eflags pointer 286 mov dword [edx], eax 287 288 pop ebx 272 mov byte [edx], al 273 274 .done: 275 ; collect flags and return. 276 mov edx, [esp + 10h + 0] ; eflags pointer 277 pushf 278 pop dword [edx] 279 289 280 mov eax, VINF_SUCCESS 290 281 retn … … 292 283 ; Read error - we will be here after our page fault handler. 293 284 GLOBALNAME EMGCEmulateXAdd_Error 294 pop ebx295 285 mov eax, VERR_ACCESS_DENIED 296 286 ret
Note:
See TracChangeset
for help on using the changeset viewer.