OLD | NEW |
1 ; Copyright 2015 The Crashpad Authors. All rights reserved. | 1 ; Copyright 2015 The Crashpad Authors. All rights reserved. |
2 ; | 2 ; |
3 ; Licensed under the Apache License, Version 2.0 (the "License"); | 3 ; Licensed under the Apache License, Version 2.0 (the "License"); |
4 ; you may not use this file except in compliance with the License. | 4 ; you may not use this file except in compliance with the License. |
5 ; You may obtain a copy of the License at | 5 ; You may obtain a copy of the License at |
6 ; | 6 ; |
7 ; http://www.apache.org/licenses/LICENSE-2.0 | 7 ; http://www.apache.org/licenses/LICENSE-2.0 |
8 ; | 8 ; |
9 ; Unless required by applicable law or agreed to in writing, software | 9 ; Unless required by applicable law or agreed to in writing, software |
10 ; distributed under the License is distributed on an "AS IS" BASIS, | 10 ; distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 ; Copy the temporary fxsave area into the CONTEXT structure. | 345 ; Copy the temporary fxsave area into the CONTEXT structure. |
346 lea edi, [ebx.CONTEXT].c_ExtendedRegisters | 346 lea edi, [ebx.CONTEXT].c_ExtendedRegisters |
347 mov esi, esp | 347 mov esi, esp |
348 mov ecx, MAXIMUM_SUPPORTED_EXTENSION / sizeof(dword) ; 128 | 348 mov ecx, MAXIMUM_SUPPORTED_EXTENSION / sizeof(dword) ; 128 |
349 rep movsd | 349 rep movsd |
350 | 350 |
351 ; Free the stack space used for the temporary fxsave area. | 351 ; Free the stack space used for the temporary fxsave area. |
352 lea esp, [ebp-8] | 352 lea esp, [ebp-8] |
353 | 353 |
354 ; TODO(mark): AVX/xsave support. | 354 ; TODO(mark): AVX/xsave support. https://crashpad.chromium.org/bug/58 |
355 ; https://code.google.com/p/crashpad/issues/detail?id=58 | |
356 | 355 |
357 $FXSaveDone: | 356 $FXSaveDone: |
358 ; fnsave reinitializes the FPU with an implicit finit operation, so use frstor | 357 ; fnsave reinitializes the FPU with an implicit finit operation, so use frstor |
359 ; to restore the original state. | 358 ; to restore the original state. |
360 fnsave [ebx.CONTEXT].c_FloatSave | 359 fnsave [ebx.CONTEXT].c_FloatSave |
361 frstor [ebx.CONTEXT].c_FloatSave | 360 frstor [ebx.CONTEXT].c_FloatSave |
362 | 361 |
363 ; cr0 is inaccessible from user code, and this field would not be used anyway. | 362 ; cr0 is inaccessible from user code, and this field would not be used anyway. |
364 mov [ebx.CONTEXT].c_FloatSave.f_Cr0NpxState, 0 | 363 mov [ebx.CONTEXT].c_FloatSave.f_Cr0NpxState, 0 |
365 | 364 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 xor rax, rax | 483 xor rax, rax |
485 mov rcx, (sizeof(CONTEXT) - offsetof(CONTEXT, c_FltSave)) / \ | 484 mov rcx, (sizeof(CONTEXT) - offsetof(CONTEXT, c_FltSave)) / \ |
486 sizeof(qword) ; 122 | 485 sizeof(qword) ; 122 |
487 rep stosq | 486 rep stosq |
488 mov rcx, rbx | 487 mov rcx, rbx |
489 | 488 |
490 ; Save the floating point (including SSE) state. The CONTEXT structure is | 489 ; Save the floating point (including SSE) state. The CONTEXT structure is |
491 ; declared as 16-byte-aligned, which is correct for this operation. | 490 ; declared as 16-byte-aligned, which is correct for this operation. |
492 fxsave [rcx.CONTEXT].c_FltSave | 491 fxsave [rcx.CONTEXT].c_FltSave |
493 | 492 |
494 ; TODO(mark): AVX/xsave support. | 493 ; TODO(mark): AVX/xsave support. https://crashpad.chromium.org/bug/58 |
495 ; https://code.google.com/p/crashpad/issues/detail?id=58 | |
496 | 494 |
497 ; The register parameter home address fields aren’t used, so zero them out. | 495 ; The register parameter home address fields aren’t used, so zero them out. |
498 mov [rcx.CONTEXT].c_P1Home, 0 | 496 mov [rcx.CONTEXT].c_P1Home, 0 |
499 mov [rcx.CONTEXT].c_P2Home, 0 | 497 mov [rcx.CONTEXT].c_P2Home, 0 |
500 mov [rcx.CONTEXT].c_P3Home, 0 | 498 mov [rcx.CONTEXT].c_P3Home, 0 |
501 mov [rcx.CONTEXT].c_P4Home, 0 | 499 mov [rcx.CONTEXT].c_P4Home, 0 |
502 mov [rcx.CONTEXT].c_P5Home, 0 | 500 mov [rcx.CONTEXT].c_P5Home, 0 |
503 mov [rcx.CONTEXT].c_P6Home, 0 | 501 mov [rcx.CONTEXT].c_P6Home, 0 |
504 | 502 |
505 ; The debug registers can’t be read from user code, so zero them out in the | 503 ; The debug registers can’t be read from user code, so zero them out in the |
(...skipping 17 matching lines...) Expand all Loading... |
523 pop rbp | 521 pop rbp |
524 | 522 |
525 ret | 523 ret |
526 | 524 |
527 CAPTURECONTEXT_SYMBOL endp | 525 CAPTURECONTEXT_SYMBOL endp |
528 | 526 |
529 endif | 527 endif |
530 | 528 |
531 _TEXT ends | 529 _TEXT ends |
532 end | 530 end |
OLD | NEW |