]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm
Use RLE (Run Length Encoding) to improve debugging performance.
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugAgent / DebugAgentCommon / Ia32 / AsmFuncs.asm
index 9b219fc07d57789dad9cb7c99ee1dba23b19c609..377ade7c3b3ed1aae423e5c092e7a9388d4dcae9 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -38,7 +38,7 @@ ENDM
 \r
 .data\r
 \r
-ExceptionStubHeaderSize   DW    Exception1Handle - Exception0Handle\r
+ExceptionStubHeaderSize   DD    Exception1Handle - Exception0Handle\r
 CommonEntryAddr           DD    CommonEntry\r
 \r
 .code\r
@@ -302,17 +302,22 @@ NoExtrPush:
     mov     eax, dr0\r
     push    eax\r
 \r
+    ;; Clear Direction Flag\r
+    cld\r
+\r
     ;; FX_SAVE_STATE_IA32 FxSaveState;\r
-    sub esp, 512\r
-    mov edi, esp\r
+    sub     esp, 512\r
+    mov     edi, esp\r
+    ;; Clear the buffer\r
+    xor     eax, eax\r
+    mov     ecx, 128 ;= 512 / 4\r
+    rep     stosd\r
+    mov     edi, esp\r
     db 0fh, 0aeh, 00000111y ;fxsave [edi]\r
 \r
-    ;; save the exception data    \r
+    ;; save the exception data\r
     push    dword ptr [ebp + 8]\r
 \r
-    ;; Clear Direction Flag\r
-    cld\r
-       \r
     ; call the C interrupt process function\r
     push    esp     ; Structure\r
     push    ebx     ; vector\r
@@ -323,7 +328,7 @@ NoExtrPush:
     add     esp, 4\r
 \r
     ;; FX_SAVE_STATE_IA32 FxSaveState;\r
-    mov esi, esp\r
+    mov     esi, esp\r
     db 0fh, 0aeh, 00001110y ; fxrstor [esi]\r
     add esp, 512\r
 \r