]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SourceLevelDebugPkg/DebugAgentCommon: Remove .S files
authorShenglei Zhang <shenglei.zhang@intel.com>
Fri, 29 Mar 2019 06:55:09 +0000 (14:55 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 3 Apr 2019 05:27:44 +0000 (13:27 +0800)
.nasm file has been added for X86 arch. .S assembly code
is not required any more.
https://bugzilla.tianocore.org/show_bug.cgi?id=1594

Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S [deleted file]
SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S [deleted file]
SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf

diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S
deleted file mode 100644 (file)
index 30d279e..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2010 - 2018, 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
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   AsmFuncs.S\r
-#\r
-# Abstract:\r
-#\r
-#   Debug interrupt handle functions.\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#include "DebugException.h"\r
-\r
-ASM_GLOBAL ASM_PFX(InterruptProcess)\r
-ASM_GLOBAL ASM_PFX(Exception0Handle)\r
-ASM_GLOBAL ASM_PFX(ExceptionStubHeaderSize)\r
-ASM_GLOBAL ASM_PFX(TimerInterruptHandle)\r
-ASM_GLOBAL ASM_PFX(CommonEntry)\r
-\r
-.macro  AGENT_HANDLER_SIGNATURE\r
-  .byte 0x41, 0x47, 0x54, 0x48   # AGENT_HANDLER_SIGNATURE     SIGNATURE_32('A','G','T','H')\r
-.endm\r
-\r
-.data\r
-\r
-ASM_PFX(ExceptionStubHeaderSize):  .long     ASM_PFX(Exception1Handle) - ASM_PFX(Exception0Handle)\r
-\r
-.text\r
-\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception0Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $0, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception1Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $1, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception2Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $2, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception3Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $3, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception4Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $4, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception5Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $5, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception6Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $6, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception7Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $7, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception8Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $8, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception9Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $9, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception10Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $10, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception11Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $11, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception12Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $12, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception13Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $13, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception14Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $14, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception15Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $15, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception16Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $16, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception17Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $17, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception18Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $18, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception19Handle):\r
-   cli\r
-   pushl %eax\r
-   mov   $19, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(TimerInterruptHandle):\r
-   cli\r
-   pushl %eax\r
-   mov   $32, %eax\r
-   jmp   ASM_PFX(CommonEntry)\r
-\r
-\r
-ASM_PFX(CommonEntry):\r
-\r
-#---------------------------------------;\r
-# _CommonEntry                  ;\r
-#----------------------------------------------------------------------------;\r
-# The follow algorithm is used for the common interrupt routine.\r
-# Entry from each interrupt with a push eax and eax=interrupt number\r
-#\r
-# +---------------------+\r
-# +    EFlags           +\r
-# +---------------------+\r
-# +    CS               +\r
-# +---------------------+\r
-# +    EIP              +\r
-# +---------------------+\r
-# +    Error Code       +\r
-# +---------------------+\r
-# + EAX / Vector Number +\r
-# +---------------------+\r
-# +    EBP              +\r
-# +---------------------+ <-- EBP\r
-#\r
-\r
-# We need to determine if any extra data was pushed by the exception\r
-  cmpl    $DEBUG_EXCEPT_DOUBLE_FAULT, %eax\r
-  je      NoExtrPush\r
-  cmpl    $DEBUG_EXCEPT_INVALID_TSS, %eax\r
-  je      NoExtrPush\r
-  cmpl    $DEBUG_EXCEPT_SEG_NOT_PRESENT, %eax\r
-  je      NoExtrPush\r
-  cmpl    $DEBUG_EXCEPT_STACK_FAULT, %eax\r
-  je      NoExtrPush\r
-  cmpl    $DEBUG_EXCEPT_GP_FAULT, %eax\r
-  je      NoExtrPush\r
-  cmpl    $DEBUG_EXCEPT_PAGE_FAULT, %eax\r
-  je      NoExtrPush\r
-  cmpl    $DEBUG_EXCEPT_ALIGNMENT_CHECK, %eax\r
-  je      NoExtrPush\r
-\r
-  pushl    (%esp)\r
-  movl     $0, 4(%esp)\r
-\r
-NoExtrPush:\r
-\r
-  pushl   %ebp\r
-  movl    %esp,%ebp\r
-\r
-  #\r
-  # Align stack to make sure that EFI_FX_SAVE_STATE_IA32 of EFI_SYSTEM_CONTEXT_IA32\r
-  # is 16-byte aligned\r
-  #\r
-  andl    $0xfffffff0,%esp\r
-  subl    $12,%esp\r
-\r
-## UINT32  Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax;\r
-  pushl   0x4(%ebp)\r
-  pushl   %ebx\r
-  pushl   %ecx\r
-  pushl   %edx\r
-  mov     %eax, %ebx                   # save vector in ebx\r
-  leal    24(%ebp),%ecx\r
-  pushl   %ecx                         # save original ESP\r
-  pushl   (%ebp)\r
-  pushl   %esi\r
-  pushl   %edi\r
-\r
-## UINT32  Cr0, Cr1, Cr2, Cr3, Cr4;\r
-## insure FXSAVE/FXRSTOR is enabled in CR4...\r
-## ... while we're at it, make sure DE is also enabled...\r
-  mov     $1, %eax\r
-  pushl   %ebx                         # temporarily save value of ebx on stack\r
-  cpuid                                # use CPUID to determine if FXSAVE/FXRESTOR\r
-                                       # and DE are supported\r
-  popl    %ebx                         # retore value of ebx that was overwritten\r
-                                       # by CPUID\r
-  movl    %cr4, %eax\r
-  pushl   %eax                         # push cr4 firstly\r
-  testl   $BIT24, %edx                 # Test for FXSAVE/FXRESTOR support\r
-  jz      L1\r
-  orl     $BIT9, %eax                  # Set CR4.OSFXSR\r
-L1:\r
-  testl   $BIT2, %edx                  # Test for Debugging Extensions support\r
-  jz      L2\r
-  orl     $BIT3, %eax                  # Set CR4.DE\r
-L2:\r
-  movl    %eax, %cr4\r
-  movl    %cr3, %eax\r
-  pushl   %eax\r
-  movl    %cr2, %eax\r
-  pushl   %eax\r
-  xorl    %eax,%eax\r
-  pushl   %eax\r
-  movl    %cr0, %eax\r
-  pushl   %eax\r
-\r
-## UINT32  Gs, Fs, Es, Ds, Cs, Ss;\r
-  movl    %ss,%eax\r
-  pushl   %eax\r
-  movzwl  16(%ebp), %eax\r
-  pushl   %eax\r
-  movl    %ds,%eax\r
-  pushl   %eax\r
-  movl    %es,%eax\r
-  pushl   %eax\r
-  movl    %fs,%eax\r
-  pushl   %eax\r
-  movl    %gs,%eax\r
-  pushl   %eax\r
-\r
-## UINT32  Eip;\r
-  pushl   12(%ebp)\r
-\r
-## UINT32  Gdtr[2], Idtr[2];\r
-  subl    $8,%esp\r
-  sidt    (%esp)\r
-  subl    $8,%esp\r
-  sgdt    (%esp)\r
-\r
-## UINT32  Ldtr, Tr;\r
-  xorl    %eax,%eax\r
-  strl    %eax\r
-  pushl   %eax\r
-  sldtl   %eax\r
-  pushl   %eax\r
-\r
-## UINT32  EFlags;\r
-  pushl   20(%ebp)\r
-\r
-## UINT32  Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r
-  movl    %dr7, %eax\r
-  pushl   %eax\r
-## clear Dr7 while executing debugger itself\r
-  xorl    %eax,%eax\r
-  movl    %eax, %dr7\r
-\r
-  movl    %dr6, %eax\r
-  pushl   %eax\r
-## insure all status bits in dr6 are clear...\r
-  xorl    %eax,%eax\r
-  movl    %eax, %dr6\r
-\r
-  movl    %dr3, %eax\r
-  pushl   %eax\r
-  movl    %dr2, %eax\r
-  pushl   %eax\r
-  movl    %dr1, %eax\r
-  pushl   %eax\r
-  movl    %dr0, %eax\r
-  pushl   %eax\r
-\r
-## FX_SAVE_STATE_IA32 FxSaveState;\r
-  subl    $512,%esp\r
-  movl    %esp,%edi\r
-  testl   $BIT24, %edx     # Test for FXSAVE/FXRESTOR support.\r
-                           # edx still contains result from CPUID above\r
-  jz      L3\r
-  .byte 0x0f, 0xae, 0x07   # fxsave [edi]\r
-L3:\r
-\r
-## save the exception data\r
-  pushl   8(%esp)\r
-\r
-## Clear Direction Flag\r
-  cld\r
-\r
-## Prepare parameter and call C function\r
-  pushl   %esp\r
-  pushl   %ebx\r
-  call    ASM_PFX(InterruptProcess)\r
-  addl    $8,%esp\r
-\r
-## skip the exception data\r
-  addl    $4,%esp\r
-\r
-## FX_SAVE_STATE_IA32 FxSaveState;\r
-  movl    %esp,%esi\r
-  movl    $1, %eax\r
-  cpuid                    # use CPUID to determine if FXSAVE/FXRESTOR\r
-                           # are supported\r
-  testl   $BIT24, %edx     # Test for FXSAVE/FXRESTOR support\r
-  jz      L4\r
-  .byte 0x0f, 0xae, 0x0e   # fxrstor [esi]\r
-L4:\r
-  addl    $512,%esp\r
-\r
-## UINT32  Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r
-  popl    %eax\r
-  movl    %eax, %dr0\r
-  popl    %eax\r
-  movl    %eax, %dr1\r
-  popl    %eax\r
-  movl    %eax, %dr2\r
-  popl    %eax\r
-  movl    %eax, %dr3\r
-## skip restore of dr6.  We cleared dr6 during the context save.\r
-  addl    $4,%esp\r
-  popl    %eax\r
-  movl    %eax, %dr7\r
-\r
-## UINT32  EFlags;\r
-  popl    20(%ebp)\r
-\r
-## UINT32  Ldtr, Tr;\r
-## UINT32  Gdtr[2], Idtr[2];\r
-## Best not let anyone mess with these particular registers...\r
-  addl     $24,%esp\r
-\r
-## UINT32  Eip;\r
-   pop     12(%ebp)\r
-\r
-## UINT32  Gs, Fs, Es, Ds, Cs, Ss;\r
-## NOTE - modified segment registers could hang the debugger...  We\r
-##        could attempt to insulate ourselves against this possibility,\r
-##        but that poses risks as well.\r
-##\r
-  popl    %gs\r
-  popl    %fs\r
-  popl    %es\r
-  popl    %ds\r
-  popl    16(%ebp)\r
-  popl    %ss\r
-\r
-## UINT32  Cr0, Cr1, Cr2, Cr3, Cr4;\r
-  popl    %eax\r
-  movl    %eax, %cr0\r
-  addl    $4,%esp   # not for Cr1\r
-  popl    %eax\r
-  movl    %eax, %cr2\r
-  popl    %eax\r
-  movl    %eax, %cr3\r
-  popl    %eax\r
-  movl    %eax, %cr4\r
-\r
-## UINT32  Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax;\r
-  popl    %edi\r
-  popl    %esi\r
-  addl    $4,%esp  # not for ebp\r
-  addl    $4,%esp  # not for esp\r
-  popl    %edx\r
-  popl    %ecx\r
-  popl    %ebx\r
-  popl    %eax\r
-\r
-  movl    %ebp,%esp\r
-  popl    %ebp\r
-  addl    $8,%esp   # skip eax\r
-  iretl\r
-\r
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S
deleted file mode 100644 (file)
index cdda41f..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2014, 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
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   AsmFuncs.S\r
-#\r
-# Abstract:\r
-#\r
-#   Debug interrupt handle functions.\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#include "DebugException.h"\r
-\r
-ASM_GLOBAL ASM_PFX(InterruptProcess)\r
-\r
-ASM_GLOBAL ASM_PFX(Exception0Handle)\r
-ASM_GLOBAL ASM_PFX(ExceptionStubHeaderSize)\r
-ASM_GLOBAL ASM_PFX(TimerInterruptHandle)\r
-ASM_GLOBAL ASM_PFX(CommonEntry)\r
-\r
-.macro  AGENT_HANDLER_SIGNATURE\r
-  .byte 0x41, 0x47, 0x54, 0x48   # AGENT_HANDLER_SIGNATURE     SIGNATURE_32('A','G','T','H')\r
-.endm\r
-\r
-.data\r
-\r
-ASM_PFX(ExceptionStubHeaderSize):  .long     ASM_PFX(Exception1Handle) - ASM_PFX(Exception0Handle)\r
-\r
-\r
-.text\r
-\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception0Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $0, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception1Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $1, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception2Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $2, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception3Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $3, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception4Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $4, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception5Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $5, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception6Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $6, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception7Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $7, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception8Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $8, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception9Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $9, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception10Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $10, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception11Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $11, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception12Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $12, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception13Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $13, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception14Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $14, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception15Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $15, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception16Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $16, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception17Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $17, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception18Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $18, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(Exception19Handle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $19, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-AGENT_HANDLER_SIGNATURE\r
-ASM_PFX(TimerInterruptHandle):\r
-   cli\r
-   pushq %rcx\r
-   mov   $32, %rcx\r
-   jmp   ASM_PFX(CommonEntry)\r
-\r
-\r
-ASM_PFX(CommonEntry):\r
-\r
-#---------------------------------------;\r
-# CommonInterruptEntry                  ;\r
-#---------------------------------------;\r
-# The follow algorithm is used for the common interrupt routine.\r
-\r
-#\r
-# +---------------------+ <-- 16-byte aligned ensured by processor\r
-# +    Old SS           +\r
-# +---------------------+\r
-# +    Old RSP          +\r
-# +---------------------+\r
-# +    RFlags           +\r
-# +---------------------+\r
-# +    CS               +\r
-# +---------------------+\r
-# +    RIP              +\r
-# +---------------------+\r
-# +    Error Code       +\r
-# +---------------------+\r
-# + RCX / Vector Number +\r
-# +---------------------+\r
-# +    RBP              +\r
-# +---------------------+ <-- RBP, 16-byte aligned\r
-#\r
-\r
-# We need to determine if any extra data was pushed by the exception\r
-  cmpq    $DEBUG_EXCEPT_DOUBLE_FAULT, %rcx\r
-  je      NoExtrPush\r
-  cmpq    $DEBUG_EXCEPT_INVALID_TSS, %rcx\r
-  je      NoExtrPush\r
-  cmpq    $DEBUG_EXCEPT_SEG_NOT_PRESENT, %rcx\r
-  je      NoExtrPush\r
-  cmpq    $DEBUG_EXCEPT_STACK_FAULT, %rcx\r
-  je      NoExtrPush\r
-  cmpq    $DEBUG_EXCEPT_GP_FAULT, %rcx\r
-  je      NoExtrPush\r
-  cmpq    $DEBUG_EXCEPT_PAGE_FAULT, %rcx\r
-  je      NoExtrPush\r
-  cmpq    $DEBUG_EXCEPT_ALIGNMENT_CHECK, %rcx\r
-  je      NoExtrPush\r
-\r
-  pushq   (%rsp)\r
-  movq    $0, 8(%rsp)\r
-\r
-NoExtrPush:\r
-  #\r
-  # All interrupt handlers are invoked through interrupt gates, so\r
-  # IF flag automatically cleared at the entry point\r
-  pushq   %rbp\r
-  movq    %rsp, %rbp\r
-\r
-  #\r
-  # Since here the stack pointer is 16-byte aligned, so\r
-  # EFI_FX_SAVE_STATE_X64 of EFI_SYSTEM_CONTEXT_x64\r
-  # is 16-byte aligned\r
-  #\r
-\r
-## UINT64  R8, R9, R10, R11, R12, R13, R14, R15;\r
-  pushq %r15\r
-  pushq %r14\r
-  pushq %r13\r
-  pushq %r12\r
-  pushq %r11\r
-  pushq %r10\r
-  pushq %r9\r
-  pushq %r8\r
-\r
-  movq  %cr8, %r8\r
-  pushq %r8\r
-\r
-## UINT64  Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax;\r
-  pushq %rax\r
-  pushq %rbx\r
-  pushq 8(%rbp)      # original rcx\r
-  pushq %rdx\r
-  pushq 48(%rbp)     # original rsp\r
-  pushq (%rbp)       # original rbp\r
-  pushq %rsi\r
-  pushq %rdi\r
-\r
-## UINT64  Cr0, Cr1, Cr2, Cr3, Cr4;\r
-  movq    %cr4, %rax\r
-  orq     $0x208, %rax\r
-  movq    %rax, %cr4\r
-  pushq   %rax\r
-  movq    %cr3, %rax\r
-  pushq   %rax\r
-  movq    %cr2, %rax\r
-  pushq   %rax\r
-  xorq    %rax, %rax\r
-  pushq   %rax\r
-  movq    %cr0, %rax\r
-  pushq   %rax\r
-\r
-## UINT64  Gs, Fs, Es, Ds, Cs, Ss;  insure high 16 bits of each is zero\r
-  xorq     %rax, %rax      # set rax to 0\r
-  movzwq   56(%rbp), %rax\r
-#  movq     %ss, %rax\r
-  pushq    %rax\r
-  movzwq   32(%rbp), %rax\r
-#  movq     %cs, %rax\r
-  pushq    %rax\r
-  mov      %ds, %rax\r
-  pushq    %rax\r
-  mov      %es, %rax\r
-  pushq    %rax\r
-  mov      %fs, %rax\r
-  pushq    %rax\r
-  mov      %gs, %rax\r
-  pushq    %rax\r
-\r
-## UINT64  Rip;\r
-  pushq    24(%rbp)\r
-\r
-## UINT64  Gdtr[2], Idtr[2];\r
-  subq     $16, %rsp\r
-  sidt    (%rsp)\r
-  subq     $16, %rsp\r
-  sgdt    (%rsp)\r
-\r
-## UINT64  Ldtr, Tr;\r
-  xorq    %rax, %rax\r
-  strw    %ax\r
-  pushq   %rax\r
-  sldtw   %ax\r
-  pushq   %rax\r
-\r
-## UINT64  RFlags;\r
-  pushq   40(%rbp)\r
-\r
-## UINT64  Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r
-   movq    %dr7, %rax\r
-  pushq   %rax\r
-## clear Dr7 while executing debugger itself\r
-   xorq    %rax, %rax\r
-   movq    %rax, %dr7\r
-\r
-   movq    %dr6, %rax\r
-  pushq    %rax\r
-## insure all status bits in dr6 are clear...\r
-   xorq    %rax, %rax\r
-   movq    %rax, %dr6\r
-\r
-   movq    %dr3, %rax\r
-  pushq    %rax\r
-   movq    %dr2, %rax\r
-  pushq    %rax\r
-   movq    %dr1, %rax\r
-  pushq    %rax\r
-   movq    %dr0, %rax\r
-  pushq    %rax\r
-\r
-## FX_SAVE_STATE_X64 FxSaveState;\r
-   subq    $512, %rsp\r
-   movq    %rsp, %rdi\r
-   .byte   0x0f, 0xae, 0b00000111\r
-\r
-## save the exception data;\r
-   pushq   16(%rbp)\r
-\r
-## Clear Direction Flag\r
-  cld\r
-\r
-## Prepare parameter and call\r
-#  movq    8(%rbp), %rcx\r
-   movq    %rsp, %rdx\r
-   movq    %rcx, %r15   # save vector in r15\r
-  #\r
-  # Per X64 calling convention, allocate maximum parameter stack space\r
-  # and make sure RSP is 16-byte aligned\r
-  #\r
-   subq    $(32 + 8), %rsp\r
-   call    ASM_PFX(InterruptProcess)\r
-   addq    $(32 + 8), %rsp\r
-\r
-## skip the exception data;\r
-   addq    $8, %rsp\r
-\r
-## FX_SAVE_STATE_X64 FxSaveState;\r
-\r
-   movq    %rsp, %rsi\r
-   .byte   0x0f, 0xae, 0b00001110\r
-   addq    $512, %rsp\r
-\r
-## UINT64  Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r
-   popq     %rax\r
-   movq     %rax, %dr0\r
-   popq     %rax\r
-   movq     %rax, %dr1\r
-   popq     %rax\r
-   movq     %rax, %dr2\r
-   popq     %rax\r
-   movq     %rax, %dr3\r
-## skip restore of dr6.  We cleared dr6 during the context save.\r
-   addq     $8, %rsp\r
-   popq     %rax\r
-   movq     %rax, %dr7\r
-\r
-## UINT64  RFlags;\r
-   popq    40(%rbp)\r
-\r
-## UINT64  Ldtr, Tr;\r
-## UINT64  Gdtr[2], Idtr[2];\r
-## Best not let anyone mess with these particular registers...\r
-   addq    $48, %rsp\r
-\r
-## UINT64  Rip;\r
-   popq    24(%rbp)\r
-\r
-## UINT64  Gs, Fs, Es, Ds, Cs, Ss;\r
-   popq     %rax\r
-  # mov     gs, rax ; not for gs\r
-   popq     %rax\r
-  # mov     fs, rax ; not for fs\r
-  # (X64 will not use fs and gs, so we do not restore it)\r
-   popq     %rax\r
-   mov      %rax, %es\r
-   popq     %rax\r
-   mov      %rax, %ds\r
-   popq     32(%rbp)\r
-   popq     56(%rbp)\r
-\r
-## UINT64  Cr0, Cr1, Cr2, Cr3, Cr4, Cr8;\r
-   popq     %rax\r
-   movq     %rax, %cr0\r
-   addq     $8, %rsp\r
-   popq     %rax\r
-   movq     %rax, %cr2\r
-   popq     %rax\r
-   movq     %rax, %cr3\r
-   popq     %rax\r
-   movq     %rax, %cr4\r
-\r
-## UINT64  Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax;\r
-## UINT64  R8, R9, R10, R11, R12, R13, R14, R15;\r
-   popq     %rdi\r
-   popq     %rsi\r
-   addq     $8, %rsp\r
-   addq     $8, %rsp\r
-   popq     %rdx\r
-   popq     %rcx\r
-   popq     %rbx\r
-   popq     %rax\r
-\r
-   popq     %r8\r
-   movq     %r8, %cr8\r
-\r
-   popq     %r8\r
-   popq     %r9\r
-   popq     %r10\r
-   popq     %r11\r
-   popq     %r12\r
-   popq     %r13\r
-   popq     %r14\r
-   popq     %r15\r
-\r
-   movq     %rbp, %rsp\r
-   popq     %rbp\r
-   addq     $16,  %rsp\r
-   iretq\r
index 38bd18d0fe5bc750f1df46f83271a17699790c51..b309c18d8844ec78e12b106263ce50449af30606 100644 (file)
   DebugAgentCommon/DebugMp.h\r
 \r
 [Sources.Ia32]\r
-  DebugAgentCommon/Ia32/AsmFuncs.S\r
   DebugAgentCommon/Ia32/AsmFuncs.nasm\r
   DebugAgentCommon/Ia32/ArchDebugSupport.h\r
   DebugAgentCommon/Ia32/ArchDebugSupport.c\r
   DebugAgentCommon/Ia32/DebugException.h\r
 \r
 [Sources.X64]\r
-  DebugAgentCommon/X64/AsmFuncs.S\r
   DebugAgentCommon/X64/AsmFuncs.nasm\r
   DebugAgentCommon/X64/ArchDebugSupport.h\r
   DebugAgentCommon/X64/ArchDebugSupport.c\r