]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Replace Opcode with the corresponding instructions.
authorJason <yun.lou@intel.com>
Mon, 10 Jan 2022 13:04:09 +0000 (21:04 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 1 Mar 2022 01:45:47 +0000 (01:45 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3790

Replace Opcode with the corresponding instructions.
The code changes have been verified with CompareBuild.py tool, which
can be used to compare the results of two different EDK II builds to
determine if they generate the same binaries.
link: https://github.com/mdkinney/edk2/tree/sandbox/CompareBuild)
Signed-off-by: Jason Lou <yun.lou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.nasm
MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.nasm

index cfb418748ffc1902c5c403ab834eda7742cab436..07fc912fe82df52b798089d41baacd612a6d62b3 100644 (file)
@@ -1,7 +1,7 @@
 ;/** @file\r
 ;  Low leve IA32 specific debug support functions.\r
 ;\r
-;  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+;  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>\r
 ;  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ;\r
 ;**/\r
 \r
 %define FXSTOR_FLAG 0x1000000         ; bit cpuid 24 of feature flags\r
 \r
-;; The FXSTOR and FXRSTOR commands are used for saving and restoring the x87,\r
-;; MMX, SSE, SSE2, etc registers.  The initialization of the debugsupport driver\r
-;; MUST check the CPUID feature flags to see that these instructions are available\r
-;; and fail to init if they are not.\r
-\r
-;; fxstor [edi]\r
-%macro FXSTOR_EDI 0\r
-                         db 0xf, 0xae, 00000111y ; mod = 00, reg/op = 000, r/m = 111 = [edi]\r
-%endmacro\r
-\r
-;; fxrstor [esi]\r
-%macro FXRSTOR_ESI 0\r
-                         db 0xf, 0xae, 00001110y ; mod = 00, reg/op = 001, r/m = 110 = [esi]\r
-%endmacro\r
 SECTION .data\r
 \r
 global ASM_PFX(OrigVector)\r
@@ -348,7 +334,7 @@ ExtraPushDone:
                 ; IMPORTANT!! The debug stack has been carefully constructed to\r
                 ; insure that esp and edi are 16 byte aligned when we get here.\r
                 ; They MUST be.  If they are not, a GP fault will occur.\r
-                FXSTOR_EDI\r
+                fxsave  [edi]\r
 \r
 ;; UEFI calling convention for IA32 requires that Direction flag in EFLAGs is clear\r
                 cld\r
@@ -372,7 +358,7 @@ ExtraPushDone:
 \r
 ;; FX_SAVE_STATE_IA32 FxSaveState;\r
                 mov     esi, esp\r
-                FXRSTOR_ESI\r
+                fxrstor [esi]\r
                 add     esp, 512\r
 \r
 ;; UINT32  Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r
index 9cc38a3128e35af83bc04a6ff5ad6ad2f8a0c22e..c6c5e4918931a569f3f6bdd6a14b88c5f0579c49 100644 (file)
@@ -1,7 +1,7 @@
 ;/** @file\r
 ;  Low level x64 routines used by the debug support driver.\r
 ;\r
-;  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+;  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>\r
 ;  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ;\r
 ;**/\r
 \r
 %define FXSTOR_FLAG 0x1000000         ; bit cpuid 24 of feature flags\r
 \r
-;; The FXSTOR and FXRSTOR commands are used for saving and restoring the x87,\r
-;; MMX, SSE, SSE2, etc registers.  The initialization of the debugsupport driver\r
-;; MUST check the CPUID feature flags to see that these instructions are available\r
-;; and fail to init if they are not.\r
-\r
-;; fxstor [rdi]\r
-%macro FXSTOR_RDI 0\r
-                         db 0xf, 0xae, 00000111y ; mod = 00, reg/op = 000, r/m = 111 = [rdi]\r
-%endmacro\r
-\r
-;; fxrstor [rsi]\r
-%macro FXRSTOR_RSI 0\r
-                         db 0xf, 0xae, 00001110y ; mod = 00, reg/op = 001, r/m = 110 = [rsi]\r
-%endmacro\r
-\r
 SECTION .data\r
 \r
 global ASM_PFX(OrigVector)\r
@@ -381,7 +366,7 @@ ExtraPushDone:
                 ; IMPORTANT!! The debug stack has been carefully constructed to\r
                 ; insure that rsp and rdi are 16 byte aligned when we get here.\r
                 ; They MUST be.  If they are not, a GP fault will occur.\r
-                FXSTOR_RDI\r
+                fxsave  [rdi]\r
 \r
 ;; UEFI calling convention for x64 requires that Direction flag in EFLAGs is clear\r
                 cld\r
@@ -404,7 +389,7 @@ ExtraPushDone:
 \r
 ;; FX_SAVE_STATE_X64 FxSaveState;\r
                 mov     rsi, rsp\r
-                FXRSTOR_RSI\r
+                fxrstor [rsi]\r
                 add     rsp, 512\r
 \r
 ;; UINT64  Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r