From d9044ec5553c946e20154b7b5c61cd3979472f60 Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Tue, 20 Jan 2015 08:46:31 +0000 Subject: Use RLE (Run Length Encoding) to improve debugging performance. DEBUG_AGENT_REVISION is DEBUG_AGENT_REVISION_03 to disable this feature and will be changed to DEBUG_AGENT_REVISION_04 when new version of HOST is released. Reduce the stack usage by re-using the same buffer to send/receive packet. Zero out the buffer before fxsave so that the reserved field in the buffer remains 0 for better RLE compression ratio. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Jeff Fan git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16628 6f19259b-4bc3-4df7-8a09-765794883524 --- .../DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32') diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm index 2aaf5b7b4c..377ade7c3b 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm @@ -1,6 +1,6 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
+; Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at @@ -302,17 +302,22 @@ NoExtrPush: mov eax, dr0 push eax + ;; Clear Direction Flag + cld + ;; FX_SAVE_STATE_IA32 FxSaveState; - sub esp, 512 - mov edi, esp + sub esp, 512 + mov edi, esp + ;; Clear the buffer + xor eax, eax + mov ecx, 128 ;= 512 / 4 + rep stosd + mov edi, esp db 0fh, 0aeh, 00000111y ;fxsave [edi] - ;; save the exception data + ;; save the exception data push dword ptr [ebp + 8] - ;; Clear Direction Flag - cld - ; call the C interrupt process function push esp ; Structure push ebx ; vector @@ -323,7 +328,7 @@ NoExtrPush: add esp, 4 ;; FX_SAVE_STATE_IA32 FxSaveState; - mov esi, esp + mov esi, esp db 0fh, 0aeh, 00001110y ; fxrstor [esi] add esp, 512 -- cgit v1.2.3