From nobody Fri May 3 05:27:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152622191741514.135811140010219; Sun, 13 May 2018 07:31:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1827C210D6CCD; Sun, 13 May 2018 07:31:57 -0700 (PDT) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B0D2520D7B25E for ; Sun, 13 May 2018 07:31:55 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2018 07:31:55 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.158.42]) by fmsmga004.fm.intel.com with ESMTP; 13 May 2018 07:31:54 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,396,1520924400"; d="scan'208";a="53911603" From: Liming Gao To: edk2-devel@lists.01.org Date: Sun, 13 May 2018 22:31:37 +0800 Message-Id: <1526221902-9060-2-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1526221902-9060-1-git-send-email-liming.gao@intel.com> References: <1526221902-9060-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [Patch 1/5] IntelFrameworkModulePkg: Remove X86 ASM and S files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" NASM has replaced ASM and S files. Rmove ASM from all modules. Remove S files from the drivers only. After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- .../Csm/LegacyBiosDxe/IA32/InterruptTable.S | 67 ------------------= -- .../Csm/LegacyBiosDxe/IA32/InterruptTable.asm | 73 ------------------= ---- .../Csm/LegacyBiosDxe/LegacyBiosDxe.inf | 4 -- .../Csm/LegacyBiosDxe/X64/InterruptTable.S | 72 ------------------= --- .../Csm/LegacyBiosDxe/X64/InterruptTable.asm | 71 ------------------= --- 5 files changed, 287 deletions(-) delete mode 100644 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/Interrup= tTable.S delete mode 100644 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/Interrup= tTable.asm delete mode 100644 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/Interrupt= Table.S delete mode 100644 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/Interrupt= Table.asm diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/InterruptTable.= S b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/InterruptTable.S deleted file mode 100644 index a785256..0000000 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/InterruptTable.S +++ /dev/null @@ -1,67 +0,0 @@ -## @file -# Interrupt Redirection Template -# -# Copyright (c) 2006, 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 -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -ASM_GLOBAL ASM_PFX(InterruptRedirectionTemplate) - -#-------------------------------------------------------------------------= --- -# Procedure: InterruptRedirectionTemplate: Redirects interrupts 0x68-0x= 6F=20 -# -# Input: None -# -# Output: None -# -# Prototype: VOID -# InterruptRedirectionTemplate ( =20 -# VOID -# ); -# -# Saves: None -# -# Modified: None -# -# Description: Contains the code that is copied into low memory (below 64= 0K). -# This code reflects interrupts 0x68-0x6f to interrupts 0x08= -0x0f. -# This template must be copied into low memory, and the IDT = entries -# 0x68-0x6F must be point to the low memory copy of this cod= e. Each -# entry is 4 bytes long, so IDT entries 0x68-0x6F can be eas= ily=20 -# computed. -# -#-------------------------------------------------------------------------= --- -ASM_PFX(InterruptRedirectionTemplate): - int $0x8 - .byte 0xcf - nop - int $0x9 - .byte 0xcf - nop - int $0xa - .byte 0xcf - nop - int $0xb - .byte 0xcf - nop - int $0xc - .byte 0xcf - nop - int $0xd - .byte 0xcf - nop - int $0xe - .byte 0xcf - nop - int $0xf - .byte 0xcf - nop diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/InterruptTable.= asm b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/InterruptTable.asm deleted file mode 100644 index 410ce5b..0000000 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/IA32/InterruptTable.asm +++ /dev/null @@ -1,73 +0,0 @@ -;; @file -; Interrupt Redirection Template -; -; Copyright (c) 2006, 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 -; http://opensource.org/licenses/bsd-license.php -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -;; - -.686P -.MODEL FLAT, C -.CODE - -;-------------------------------------------------------------------------= --- -; Procedure: InterruptRedirectionTemplate: Redirects interrupts 0x68-0x= 6F=20 -; -; Input: None -; -; Output: None -; -; Prototype: VOID -; InterruptRedirectionTemplate ( =20 -; VOID -; ); -; -; Saves: None -; -; Modified: None -; -; Description: Contains the code that is copied into low memory (below 64= 0K). -; This code reflects interrupts 0x68-0x6f to interrupts 0x08= -0x0f. -; This template must be copied into low memory, and the IDT = entries -; 0x68-0x6F must be point to the low memory copy of this cod= e. Each -; entry is 4 bytes long, so IDT entries 0x68-0x6F can be eas= ily=20 -; computed. -; -;-------------------------------------------------------------------------= --- - -InterruptRedirectionTemplate PROC C - int 08h - DB 0cfh ; IRET - nop - int 09h - DB 0cfh ; IRET - nop - int 0ah - DB 0cfh ; IRET - nop - int 0bh - DB 0cfh ; IRET - nop - int 0ch - DB 0cfh ; IRET - nop - int 0dh - DB 0cfh ; IRET - nop - int 0eh - DB 0cfh ; IRET - nop - int 0fh - DB 0cfh ; IRET - nop -InterruptRedirectionTemplate ENDP - -END \ No newline at end of file diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf b/= IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf index 180c18e..6ff6f53 100644 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf @@ -41,8 +41,6 @@ LegacyPci.c =20 [Sources.Ia32] - IA32/InterruptTable.S - IA32/InterruptTable.asm IA32/InterruptTable.nasm Thunk.c LegacyBootSupport.c @@ -51,8 +49,6 @@ =20 [Sources.X64] X64/InterruptTable.nasm - X64/InterruptTable.asm - X64/InterruptTable.S Thunk.c LegacyBootSupport.c LegacyBbs.c diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/InterruptTable.S= b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/InterruptTable.S deleted file mode 100644 index 0c9ce01..0000000 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/InterruptTable.S +++ /dev/null @@ -1,72 +0,0 @@ -## @file -# Interrupt Redirection Template -# -# Copyright (c) 2006, 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 -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -#text SEGMENT - - -#-------------------------------------------------------------------------= --- -# Procedure: InterruptRedirectionTemplate: Redirects interrupts 0x68-0x= 6F -# -# Input: None -# -# Output: None -# -# Prototype: VOID -# InterruptRedirectionTemplate ( -# VOID -# ); -# -# Saves: None -# -# Modified: None -# -# Description: Contains the code that is copied into low memory (below 64= 0K). -# This code reflects interrupts 0x68-0x6f to interrupts 0x08= -0x0f. -# This template must be copied into low memory, and the IDT = entries -# 0x68-0x6F must be point to the low memory copy of this cod= e. Each -# entry is 4 bytes long, so IDT entries 0x68-0x6F can be eas= ily -# computed. -# -#-------------------------------------------------------------------------= --- - -ASM_GLOBAL ASM_PFX(InterruptRedirectionTemplate) -ASM_PFX(InterruptRedirectionTemplate): - int $0x08 - .byte 0x0cf # IRET - nop - int $0x09 - .byte 0x0cf # IRET - nop - int $0x0a - .byte 0x0cf # IRET - nop - int $0x0b - .byte 0x0cf # IRET - nop - int $0x0c - .byte 0x0cf # IRET - nop - int $0x0d - .byte 0x0cf # IRET - nop - int $0x0e - .byte 0x0cf # IRET - nop - int $0x0f - .byte 0x0cf # IRET - nop - -#END diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/InterruptTable.a= sm b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/InterruptTable.asm deleted file mode 100644 index 750423e..0000000 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/X64/InterruptTable.asm +++ /dev/null @@ -1,71 +0,0 @@ -;; @file -; Interrupt Redirection Template -; -; Copyright (c) 2006, 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 -; http://opensource.org/licenses/bsd-license.php -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -;; - -text SEGMENT - -;-------------------------------------------------------------------------= --- -; Procedure: InterruptRedirectionTemplate: Redirects interrupts 0x68-0x= 6F=20 -; -; Input: None -; -; Output: None -; -; Prototype: VOID -; InterruptRedirectionTemplate ( =20 -; VOID -; ); -; -; Saves: None -; -; Modified: None -; -; Description: Contains the code that is copied into low memory (below 64= 0K). -; This code reflects interrupts 0x68-0x6f to interrupts 0x08= -0x0f. -; This template must be copied into low memory, and the IDT = entries -; 0x68-0x6F must be point to the low memory copy of this cod= e. Each -; entry is 4 bytes long, so IDT entries 0x68-0x6F can be eas= ily=20 -; computed. -; -;-------------------------------------------------------------------------= --- - -InterruptRedirectionTemplate PROC - int 08h - DB 0cfh ; IRET - nop - int 09h - DB 0cfh ; IRET - nop - int 0ah - DB 0cfh ; IRET - nop - int 0bh - DB 0cfh ; IRET - nop - int 0ch - DB 0cfh ; IRET - nop - int 0dh - DB 0cfh ; IRET - nop - int 0eh - DB 0cfh ; IRET - nop - int 0fh - DB 0cfh ; IRET - nop -InterruptRedirectionTemplate ENDP - -END \ No newline at end of file --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 05:27:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1526221925591473.6891644775052; Sun, 13 May 2018 07:32:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4DA2D210D6CD7; Sun, 13 May 2018 07:32:05 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7B02620D7B25E for ; Sun, 13 May 2018 07:32:03 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2018 07:32:02 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.158.42]) by fmsmga004.fm.intel.com with ESMTP; 13 May 2018 07:32:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,396,1520924400"; d="scan'208";a="53911619" From: Liming Gao To: edk2-devel@lists.01.org Date: Sun, 13 May 2018 22:31:39 +0800 Message-Id: <1526221902-9060-4-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1526221902-9060-1-git-send-email-liming.gao@intel.com> References: <1526221902-9060-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [Patch 2/5] MdeModulePkg: Remove X86 ASM and S files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" NASM has replaced ASM and S files. Rmove ASM from all modules. Remove S files from the drivers only. After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 2 - MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.S | 80 --- MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.asm | 88 --- .../BootScriptExecutorDxe.inf | 4 - .../Acpi/BootScriptExecutorDxe/IA32/S3Asm.S | 66 --- .../Acpi/BootScriptExecutorDxe/IA32/S3Asm.asm | 71 --- .../Acpi/BootScriptExecutorDxe/X64/S3Asm.S | 130 ----- .../Acpi/BootScriptExecutorDxe/X64/S3Asm.asm | 135 ----- MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf | 2 - .../Universal/CapsulePei/X64/PageFaultHandler.S | 81 --- .../Universal/CapsulePei/X64/PageFaultHandler.asm | 87 --- .../Universal/DebugSupportDxe/DebugSupportDxe.inf | 4 - .../Universal/DebugSupportDxe/Ia32/AsmFuncs.S | 407 -------------- .../Universal/DebugSupportDxe/Ia32/AsmFuncs.asm | 509 ------------------ .../Universal/DebugSupportDxe/X64/AsmFuncs.S | 551 -----------------= -- .../Universal/DebugSupportDxe/X64/AsmFuncs.asm | 596 -----------------= ---- MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf | 4 - MdeModulePkg/Universal/EbcDxe/EbcDxe.inf | 4 - MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.S | 83 --- MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.asm | 207 ------- MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.S | 147 ----- MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.asm | 246 --------- 22 files changed, 3504 deletions(-) delete mode 100644 MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.S delete mode 100644 MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.asm delete mode 100644 MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/= S3Asm.S delete mode 100644 MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/= S3Asm.asm delete mode 100644 MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S= 3Asm.S delete mode 100644 MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S= 3Asm.asm delete mode 100644 MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.S delete mode 100644 MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.= asm delete mode 100644 MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S delete mode 100644 MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm delete mode 100644 MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S delete mode 100644 MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm delete mode 100644 MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.S delete mode 100644 MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.asm delete mode 100644 MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.S delete mode 100644 MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.asm diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/Dx= eIplPeim/DxeIpl.inf index ba1d9c6..e07f3e3 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf @@ -43,8 +43,6 @@ X64/VirtualMemory.c Ia32/DxeLoadFunc.c Ia32/IdtVectorAsm.nasm - Ia32/IdtVectorAsm.asm - Ia32/IdtVectorAsm.S =20 [Sources.X64] X64/VirtualMemory.h diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.S b/MdeModulePk= g/Core/DxeIplPeim/Ia32/IdtVectorAsm.S deleted file mode 100644 index 96a3acb..0000000 --- a/MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.S +++ /dev/null @@ -1,80 +0,0 @@ -#/** @file -# =20 -# IDT vector entry. -# =20 -# Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# =20 -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# =20 -#**/ - - .text - .code32 - - - .p2align 3 - ASM_GLOBAL ASM_PFX(AsmGetVectorTemplatInfo) - ASM_GLOBAL ASM_PFX(AsmVectorFixup) -/* -; -;----------------------------------------------------------------------- -; Template of IDT Vector Handlers.=20 -; -;----------------------------------------------------------------------- -*/ -VectorTemplateBase: - pushl %eax - .byte 0x6a # push #VectorNum -VectorNum: - .byte 0 - movl CommonInterruptEntry, %eax - jmp *%eax -VectorTemplateEnd: - - -ASM_PFX(AsmGetVectorTemplatInfo): - movl 4(%esp), %ecx - movl $VectorTemplateBase, (%ecx) - movl $(VectorTemplateEnd - VectorTemplateBase), %eax - ret - -ASM_PFX(AsmVectorFixup): - movl 8(%esp), %eax - movl 4(%esp), %ecx - movb %al, (VectorNum - VectorTemplateBase)(%ecx) - ret - -/* -; The follow algorithm is used for the common interrupt routine. - -; -; +---------------------+ <-- 16-byte aligned ensured by processor -; + Old SS + -; +---------------------+ -; + Old RSP + -; +---------------------+ -; + RFlags + -; +---------------------+ -; + CS + -; +---------------------+ -; + RIP + -; +---------------------+ -; + Error Code + -; +---------------------+ -; + Vector Number + -; +---------------------+ -*/ - -CommonInterruptEntry:=20 - cli -1: - jmp 1b - - - - diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.asm b/MdeModule= Pkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.asm deleted file mode 100644 index 69fb9a1..0000000 --- a/MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.asm +++ /dev/null @@ -1,88 +0,0 @@ -;/** @file -; =20 -; IDT vector entry. -; =20 -; Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the B= SD License -; which accompanies this distribution. The full text of the license may = be found at -; http://opensource.org/licenses/bsd-license.php -; =20 -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -; =20 -;**/ - - .686p - .model flat,C - .code - -; -;-------------------------------------------------------------------------= ----- -; Generic IDT Vector Handlers for the Host.=20 -; -;-------------------------------------------------------------------------= ----- - -ALIGN 8 -PUBLIC AsmGetVectorTemplatInfo -PUBLIC AsmVectorFixup - -PUBLIC AsmVectorFixup - -@VectorTemplateBase: - push eax - db 6ah ; push #VectorNumber -@VectorNum: - db 0 - mov eax, CommonInterruptEntry - jmp eax -@VectorTemplateEnd: - - -AsmGetVectorTemplatInfo PROC - mov ecx, [esp + 4] - mov [ecx], @VectorTemplateBase - mov eax, (@VectorTemplateEnd - @VectorTemplateBase) - ret -AsmGetVectorTemplatInfo ENDP - - -AsmVectorFixup PROC - mov eax, dword ptr [esp + 8] - mov ecx, [esp + 4] - mov [ecx + (@VectorNum - @VectorTemplateBase)], al - ret -AsmVectorFixup ENDP - - -;---------------------------------------; -; CommonInterruptEntry ; -;---------------------------------------; -; The follow algorithm is used for the common interrupt routine. - -; -; +---------------------+ <-- 16-byte aligned ensured by processor -; + Old SS + -; +---------------------+ -; + Old RSP + -; +---------------------+ -; + RFlags + -; +---------------------+ -; + CS + -; +---------------------+ -; + RIP + -; +---------------------+ -; + Error Code + -; +---------------------+ -; + Vector Number + -; +---------------------+ - -CommonInterruptEntry PROC=20 - cli -=20 - jmp $ -CommonInterruptEntry ENDP - -END - - diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptEx= ecutorDxe.inf b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScrip= tExecutorDxe.inf index aac1321..af856e7 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf @@ -40,14 +40,10 @@ [Sources.X64] X64/SetIdtEntry.c =20 X64/S3Asm.nasm - X64/S3Asm.asm - X64/S3Asm.S =20 [Sources.Ia32] IA32/SetIdtEntry.c =20 IA32/S3Asm.nasm - IA32/S3Asm.asm - IA32/S3Asm.S =20 [Packages] MdePkg/MdePkg.dec diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.S= b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.S deleted file mode 100644 index 21516d5..0000000 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.S +++ /dev/null @@ -1,66 +0,0 @@ -## @file -# -# Copyright (c) 2010, Intel Corporation. All rights reserved.
-# -# This program and the accompanying materials are -# licensed and made available under the terms and conditions of the BSD Li= cense -# which accompanies this distribution. The full text of the license may b= e found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -#----------------------------------------- -#VOID -#AsmTransferControl ( -# IN UINT32 S3WakingVector, -# IN UINT32 AcpiLowMemoryBase -# ); -#----------------------------------------- - -ASM_GLOBAL ASM_PFX(AsmTransferControl) -ASM_PFX(AsmTransferControl): - # S3WakingVector :DWORD - # AcpiLowMemoryBase :DWORD - pushl %ebp - movl %esp,%ebp - leal LABLE, %eax - pushl $0x28 # CS - pushl %eax - movl 8(%ebp),%ecx - shrdl $20,%ecx,%ebx - andl $0xf,%ecx - movw %cx,%bx - movl %ebx, jmp_addr - lret -LABLE:=20 - .byte 0xb8,0x30,0 # mov ax, 30h as selector - movw %ax,%ds - movw %ax,%es - movw %ax,%fs - movw %ax,%gs - movw %ax,%ss - movl %cr0, %eax # Get control register 0 =20 - .byte 0x66 - .byte 0x83,0xe0,0xfe # and eax, 0fffffffeh ; Clear PE bit (bit = #0) - .byte 0xf,0x22,0xc0 # mov cr0, eax ; Activate real mode - .byte 0xea # jmp far @jmp_addr -jmp_addr:=20 - .long 0 - -ASM_GLOBAL ASM_PFX(AsmTransferControl32) -ASM_PFX(AsmTransferControl32): - jmp ASM_PFX(AsmTransferControl) - -# dummy -ASM_GLOBAL ASM_PFX(AsmTransferControl16) -ASM_PFX(AsmTransferControl16): -ASM_GLOBAL ASM_PFX(AsmFixAddress16) -ASM_PFX(AsmFixAddress16): - .long 0 -ASM_GLOBAL ASM_PFX(AsmJmpAddr32) -ASM_PFX(AsmJmpAddr32): - .long 0 - diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.a= sm b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.asm deleted file mode 100644 index 2fc14a1..0000000 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.asm +++ /dev/null @@ -1,71 +0,0 @@ -;; @file -; This is the assembly code for transferring to control to OS S3 waking = vector -; for IA32 platform -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -;; - .586P - .model flat,C - .code - -PUBLIC AsmFixAddress16 -PUBLIC AsmJmpAddr32 - =20 -;----------------------------------------- -;VOID -;AsmTransferControl ( -; IN UINT32 S3WakingVector, -; IN UINT32 AcpiLowMemoryBase -; ); -;----------------------------------------- - =20 -AsmTransferControl PROC - ; S3WakingVector :DWORD - ; AcpiLowMemoryBase :DWORD - push ebp - mov ebp, esp =20 - lea eax, @F - push 28h ; CS - push eax - mov ecx, [ebp + 8] - shrd ebx, ecx, 20 - and ecx, 0fh =20 - mov bx, cx =20 - mov [@jmp_addr], ebx - retf -@@: - DB 0b8h, 30h, 0 ; mov ax, 30h as selector - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - mov eax, cr0 ; Get control register 0 =20 - DB 66h - DB 83h, 0e0h, 0feh ; and eax, 0fffffffeh ; Clear PE bit (bit = #0) - DB 0fh, 22h, 0c0h ; mov cr0, eax ; Activate real mode - DB 0eah ; jmp far @jmp_addr -@jmp_addr DD ? - -AsmTransferControl ENDP - -AsmTransferControl32 PROC - jmp AsmTransferControl -AsmTransferControl32 ENDP - -; dummy -AsmTransferControl16 PROC -AsmFixAddress16 DD ? -AsmJmpAddr32 DD ? -AsmTransferControl16 ENDP - - END \ No newline at end of file diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.S = b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.S deleted file mode 100644 index e59fd04..0000000 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.S +++ /dev/null @@ -1,130 +0,0 @@ -## @file -# This is the assembly code for transferring to control to OS S3 waking = vector -# for X64 platform -# -# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-# -# This program and the accompanying materials are -# licensed and made available under the terms and conditions of the BSD Li= cense -# which accompanies this distribution. The full text of the license may b= e found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -ASM_GLOBAL ASM_PFX(AsmTransferControl) -ASM_PFX(AsmTransferControl): - # rcx S3WakingVector :DWORD - # rdx AcpiLowMemoryBase :DWORD - lea _AsmTransferControl_al_0000(%rip), %eax=20 - movq $0x2800000000, %r8=20 - orq %r8, %rax - pushq %rax - shrd $20, %ecx, %ebx - andl $0x0f, %ecx=20 - movw %cx, %bx - movl %ebx, jmp_addr(%rip)=20 - lret -_AsmTransferControl_al_0000: - .byte 0x0b8, 0x30, 0 # mov ax, 30h as selector - movl %eax, %ds - movl %eax, %es - movl %eax, %fs - movl %eax, %gs - movl %eax, %ss - movq %cr0, %rax - movq %cr4, %rbx - .byte 0x66 - andl $0x7ffffffe, %eax=20 - andb $0xdf, %bl=20 - movq %rax, %cr0 - .byte 0x66 - movl $0x0c0000080, %ecx=20 - rdmsr - andb $0xfe, %ah=20 - wrmsr - movq %rbx, %cr4 - .byte 0x0ea # jmp far jmp_addr -jmp_addr: - .long 0 - -ASM_GLOBAL ASM_PFX(AsmTransferControl32) -ASM_PFX(AsmTransferControl32): - # S3WakingVector :DWORD - # AcpiLowMemoryBase :DWORD - pushq %rbp - movl %esp,%ebp - .byte 0x8d, 0x05 # lea eax, AsmTransferControl16 -ASM_GLOBAL ASM_PFX(AsmFixAddress16) -ASM_PFX(AsmFixAddress16): - .long 0 - pushq $0x28 # CS - pushq %rax - lret - -ASM_GLOBAL ASM_PFX(AsmTransferControl16) -ASM_PFX(AsmTransferControl16): - .byte 0xb8,0x30,0 # mov ax, 30h as selector - movw %ax,%ds - movw %ax,%es - movw %ax,%fs - movw %ax,%gs - movw %ax,%ss - movq %cr0, %rax # Get control register 0 =20 - .byte 0x66 - .byte 0x83,0xe0,0xfe # and eax, 0fffffffeh ; Clear PE bit (bit = #0) - .byte 0xf,0x22,0xc0 # mov cr0, eax ; Activate real mode - .byte 0xea # jmp far AsmJmpAddr32 -ASM_GLOBAL ASM_PFX(AsmJmpAddr32) -ASM_PFX(AsmJmpAddr32): - .long 0 - -ASM_GLOBAL ASM_PFX(PageFaultHandlerHook) -ASM_PFX(PageFaultHandlerHook): - pushq %rax # save all volatile registers - pushq %rcx - pushq %rdx - pushq %r8 - pushq %r9 - pushq %r10 - pushq %r11 - # save volatile fp registers - addq $-0x68, %rsp - stmxcsr 0x60(%rsp) - movdqa %xmm0, 0x0(%rsp)=20 - movdqa %xmm1, 0x10(%rsp)=20 - movdqa %xmm2, 0x20(%rsp)=20 - movdqa %xmm3, 0x30(%rsp)=20 - movdqa %xmm4, 0x40(%rsp)=20 - movdqa %xmm5, 0x50(%rsp)=20 - - addq $-0x20, %rsp - call ASM_PFX(PageFaultHandler) - addq $0x20, %rsp - - # load volatile fp registers - ldmxcsr 0x60(%rsp) - movdqa 0x0(%rsp), %xmm0 - movdqa 0x10(%rsp), %xmm1 - movdqa 0x20(%rsp), %xmm2 - movdqa 0x30(%rsp), %xmm3 - movdqa 0x40(%rsp), %xmm4 - movdqa 0x50(%rsp), %xmm5 - addq $0x68, %rsp - - testb %al, %al - - popq %r11 - popq %r10 - popq %r9 - popq %r8 - popq %rdx - popq %rcx - popq %rax # restore all volatile registers - jnz L1 - jmpq *ASM_PFX(mOriginalHandler)(%rip) -L1: - addq $0x08, %rsp # skip error code for PF - iretq diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.as= m b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.asm deleted file mode 100644 index 4422f22..0000000 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.asm +++ /dev/null @@ -1,135 +0,0 @@ -;; @file -; This is the assembly code for transferring to control to OS S3 waking = vector -; for X64 platform -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -;; - -EXTERN mOriginalHandler:QWORD -EXTERN PageFaultHandler:PROC - - .code - =20 -PUBLIC AsmFixAddress16 -PUBLIC AsmJmpAddr32 - =20 -AsmTransferControl PROC - ; rcx S3WakingVector :DWORD - ; rdx AcpiLowMemoryBase :DWORD - lea eax, @F - mov r8, 2800000000h - or rax, r8 - push rax - shrd ebx, ecx, 20 - and ecx, 0fh =20 - mov bx, cx =20 - mov [@jmp_addr], ebx - retf -@@: - DB 0b8h, 30h, 0 ; mov ax, 30h as selector - mov ds, eax - mov es, eax - mov fs, eax - mov gs, eax - mov ss, eax - mov rax, cr0 - mov rbx, cr4 =20 - DB 66h - and eax, ((NOT 080000001h) AND 0ffffffffh) - and bl, NOT (1 SHL 5) - mov cr0, rax - DB 66h - mov ecx, 0c0000080h - rdmsr - and ah, NOT 1 - wrmsr - mov cr4, rbx - DB 0eah ; jmp far @jmp_addr -@jmp_addr DD ? -AsmTransferControl ENDP - -AsmTransferControl32 PROC - ; S3WakingVector :DWORD - ; AcpiLowMemoryBase :DWORD - push rbp - mov ebp, esp =20 - DB 8dh, 05h ; lea eax, AsmTransferControl16 -AsmFixAddress16 DD ? - push 28h ; CS - push rax - retf -AsmTransferControl32 ENDP - -AsmTransferControl16 PROC - DB 0b8h, 30h, 0 ; mov ax, 30h as selector - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - mov rax, cr0 ; Get control register 0 =20 - DB 66h - DB 83h, 0e0h, 0feh ; and eax, 0fffffffeh ; Clear PE bit (bit = #0) - DB 0fh, 22h, 0c0h ; mov cr0, eax ; Activate real mode - DB 0eah ; jmp far AsmJmpAddr32 -AsmJmpAddr32 DD ? -AsmTransferControl16 ENDP - -PageFaultHandlerHook PROC - push rax ; save all volatile registers - push rcx - push rdx - push r8 - push r9 - push r10 - push r11 - ; save volatile fp registers - add rsp, -68h - stmxcsr [rsp + 60h] - movdqa [rsp + 0h], xmm0 - movdqa [rsp + 10h], xmm1 - movdqa [rsp + 20h], xmm2 - movdqa [rsp + 30h], xmm3 - movdqa [rsp + 40h], xmm4 - movdqa [rsp + 50h], xmm5 - - add rsp, -20h - call PageFaultHandler - add rsp, 20h - =20 - ; load volatile fp registers - ldmxcsr [rsp + 60h] - movdqa xmm0, [rsp + 0h] - movdqa xmm1, [rsp + 10h] - movdqa xmm2, [rsp + 20h] - movdqa xmm3, [rsp + 30h] - movdqa xmm4, [rsp + 40h] - movdqa xmm5, [rsp + 50h] - add rsp, 68h - - test al, al - =20 - pop r11 - pop r10 - pop r9 - pop r8 - pop rdx - pop rcx - pop rax ; restore all volatile registers - jnz @F - jmp mOriginalHandler -@@: - add rsp, 08h ; skip error code for PF - iretq -PageFaultHandlerHook ENDP - - END diff --git a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf b/MdeModulePk= g/Universal/CapsulePei/CapsuleX64.inf index 8318eaa..f2b667a 100644 --- a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf +++ b/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf @@ -39,8 +39,6 @@ [Sources] X64/X64Entry.c X64/PageFaultHandler.nasm - X64/PageFaultHandler.asm - X64/PageFaultHandler.S Common/CapsuleCoalesce.c =20 [Packages] diff --git a/MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.S b/Mde= ModulePkg/Universal/CapsulePei/X64/PageFaultHandler.S deleted file mode 100644 index 9e17cc3..0000000 --- a/MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.S +++ /dev/null @@ -1,81 +0,0 @@ -## @file -# This is the assembly code for page fault handler hook. -# -# Copyright (c) 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 Li= cense -# which accompanies this distribution. The full text of the license may b= e found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -ASM_GLOBAL ASM_PFX(PageFaultHandlerHook) -ASM_PFX(PageFaultHandlerHook): - addq $-0x10, %rsp - # save rax - movq %rax, 0x08(%rsp) - - # pushq %rax # save all volatile registers - pushq %rcx - pushq %rdx - pushq %r8 - pushq %r9 - pushq %r10 - pushq %r11 - # save volatile fp registers - # 68h + 08h(for alignment) - addq $-0x70, %rsp - stmxcsr 0x60(%rsp) - movdqa %xmm0, 0x0(%rsp)=20 - movdqa %xmm1, 0x10(%rsp)=20 - movdqa %xmm2, 0x20(%rsp)=20 - movdqa %xmm3, 0x30(%rsp)=20 - movdqa %xmm4, 0x40(%rsp)=20 - movdqa %xmm5, 0x50(%rsp)=20 - - addq $-0x20, %rsp - call ASM_PFX(PageFaultHandler) - addq $0x20, %rsp - - # load volatile fp registers - ldmxcsr 0x60(%rsp) - movdqa 0x0(%rsp), %xmm0 - movdqa 0x10(%rsp), %xmm1 - movdqa 0x20(%rsp), %xmm2 - movdqa 0x30(%rsp), %xmm3 - movdqa 0x40(%rsp), %xmm4 - movdqa 0x50(%rsp), %xmm5 - addq $0x70, %rsp - - popq %r11 - popq %r10 - popq %r9 - popq %r8 - popq %rdx - popq %rcx - # popq %rax # restore all volatile registe= rs - - addq $0x10, %rsp - - # rax returned from PageFaultHandler is NULL or OriginalHandler address - # NULL if the page fault is handled by PageFaultHandler - # OriginalHandler address if the page fault is not handled by PageFaul= tHandler - testq %rax, %rax - - # save OriginalHandler address - movq %rax, -0x10(%rsp) - # restore rax - movq -0x08(%rsp), %rax - - jz L1 - - # jump to OriginalHandler - jmpq *-0x10(%rsp) - -L1: - addq $0x08, %rsp # skip error code for PF - iretq diff --git a/MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.asm b/M= deModulePkg/Universal/CapsulePei/X64/PageFaultHandler.asm deleted file mode 100644 index 2f1eab7..0000000 --- a/MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.asm +++ /dev/null @@ -1,87 +0,0 @@ -;; @file -; This is the assembly code for page fault handler hook. -; -; Copyright (c) 2015, Intel Corporation. All rights reserved.
-; -; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -;; - -EXTERN PageFaultHandler:PROC - - .code - -PageFaultHandlerHook PROC - add rsp, -10h - ; save rax - mov [rsp + 08h], rax - - ;push rax ; save all volatile registers - push rcx - push rdx - push r8 - push r9 - push r10 - push r11 - ; save volatile fp registers - ; 68h + 08h(for alignment) - add rsp, -70h - stmxcsr [rsp + 60h] - movdqa [rsp + 0h], xmm0 - movdqa [rsp + 10h], xmm1 - movdqa [rsp + 20h], xmm2 - movdqa [rsp + 30h], xmm3 - movdqa [rsp + 40h], xmm4 - movdqa [rsp + 50h], xmm5 - - add rsp, -20h - call PageFaultHandler - add rsp, 20h - - ; load volatile fp registers - ldmxcsr [rsp + 60h] - movdqa xmm0, [rsp + 0h] - movdqa xmm1, [rsp + 10h] - movdqa xmm2, [rsp + 20h] - movdqa xmm3, [rsp + 30h] - movdqa xmm4, [rsp + 40h] - movdqa xmm5, [rsp + 50h] - add rsp, 70h - - pop r11 - pop r10 - pop r9 - pop r8 - pop rdx - pop rcx - ;pop rax ; restore all volatile registers - - add rsp, 10h - - ; rax returned from PageFaultHandler is NULL or OriginalHandler address - ; NULL if the page fault is handled by PageFaultHandler - ; OriginalHandler address if the page fault is not handled by PageFaul= tHandler - test rax, rax - - ; save OriginalHandler address - mov [rsp - 10h], rax - ; restore rax - mov rax, [rsp - 08h] - - jz @F - - ; jump to OriginalHandler - jmp qword ptr [rsp - 10h] - -@@: - add rsp, 08h ; skip error code for PF - iretq -PageFaultHandlerHook ENDP - - END diff --git a/MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf b/M= deModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf index 72a5dad..ab89ee9 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf +++ b/MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf @@ -42,8 +42,6 @@ Ia32/PlDebugSupport.h Ia32/PlDebugSupportIa32.c Ia32/AsmFuncs.nasm - Ia32/AsmFuncs.S - Ia32/AsmFuncs.asm =20 [Sources.X64] Ia32/DebugSupport.h @@ -51,8 +49,6 @@ X64/PlDebugSupport.h X64/PlDebugSupportX64.c X64/AsmFuncs.nasm - X64/AsmFuncs.S - X64/AsmFuncs.asm =20 [Sources.IPF] Ipf/PlDebugSupport.h diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S b/MdeMo= dulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S deleted file mode 100644 index fd1a96b..0000000 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S +++ /dev/null @@ -1,407 +0,0 @@ -#/**@file -# Low leve IA32 specific debug support functions. -# -# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BS= D License -# which accompanies this distribution. The full text of the license may b= e found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -#**/ - -ASM_GLOBAL ASM_PFX(OrigVector) -ASM_GLOBAL ASM_PFX(InterruptEntryStub) -ASM_GLOBAL ASM_PFX(StubSize) -ASM_GLOBAL ASM_PFX(CommonIdtEntry) -ASM_GLOBAL ASM_PFX(FxStorSupport) - -ASM_PFX(StubSize): .long ASM_PFX(InterruptEntryStubEnd) - ASM_PFX(= InterruptEntryStub) -ASM_PFX(AppEsp): .long 0x11111111 # ? -ASM_PFX(DebugEsp): .long 0x22222222 # ? -ASM_PFX(ExtraPush): .long 0x33333333 # ? -ASM_PFX(ExceptData): .long 0x44444444 # ? -ASM_PFX(Eflags): .long 0x55555555 # ? -ASM_PFX(OrigVector): .long 0x66666666 # ? - -#-------------------------------------------------------------------------= ----- -# BOOLEAN -# FxStorSupport ( -# void -# ) -# -# Abstract: Returns TRUE if FxStor instructions are supported -# -ASM_GLOBAL ASM_PFX(FxStorSupport) -ASM_PFX(FxStorSupport): -# -# cpuid corrupts ebx which must be preserved per the C calling convention -# - push %ebx - mov $0x1,%eax - cpuid - mov %edx,%eax - and $0x1000000,%eax - shr $0x18,%eax - pop %ebx - ret -#-------------------------------------------------------------------------= ----- -# void -# Vect2Desc ( -# DESCRIPTOR * DestDesc, -# void (*Vector) (void) -# ) -# -# Abstract: Encodes an IDT descriptor with the given physical address -# - -ASM_GLOBAL ASM_PFX(Vect2Desc) -ASM_PFX(Vect2Desc): - push %ebp - mov %esp,%ebp - mov 0xc(%ebp),%eax - mov 0x8(%ebp),%ecx - mov %ax,(%ecx) - movw $0x20,0x2(%ecx) - movw $0x8e00,0x4(%ecx) - shr $0x10,%eax - mov %ax,0x6(%ecx) - leave - ret - -ASM_GLOBAL ASM_PFX(InterruptEntryStub) -ASM_PFX(InterruptEntryStub): - mov %esp,0x0 # save stack top - mov $0x0,%esp # switch to debugger stack - push $0x0 # push vector number - will be = modified before installed - jmp ASM_PFX(CommonIdtEntry) # jump CommonIdtEntry -ASM_GLOBAL ASM_PFX(InterruptEntryStubEnd) -ASM_PFX(InterruptEntryStubEnd): - -#-------------------------------------------------------------------------= ----- -# CommonIdtEntry -# -# Abstract: This code is not a function, but is the common part for all IDT -# vectors. -# -ASM_GLOBAL ASM_PFX(CommonIdtEntry) -ASM_PFX(CommonIdtEntry): -## -## At this point, the stub has saved the current application stack esp int= o AppEsp -## and switched stacks to the debug stack, where it pushed the vector numb= er -## -## The application stack looks like this: -## -## ... -## (last application stack entry) -## eflags from interrupted task -## CS from interrupted task -## EIP from interrupted task -## Error code <-------------------- Only present for some exe= ption types -## -## - - -## The stub switched us to the debug stack and pushed the interrupt number. -## -## Next, construct the context record. It will be build on the debug stac= k by -## pushing the registers in the correct order so as to create the context = structure -## on the debug stack. The context record must be built from the end back= to the -## beginning because the stack grows down... -# -## For reference, the context record looks like this: -## -## typedef -## struct { -## UINT32 ExceptionData; -## FX_SAVE_STATE_IA32 FxSaveState; -## UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -## UINT32 Cr0, Cr2, Cr3, Cr4; -## UINT32 EFlags; -## UINT32 Ldtr, Tr; -## UINT32 Gdtr[2], Idtr[2]; -## UINT32 Eip; -## UINT32 Gs, Fs, Es, Ds, Cs, Ss; -## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; -## } SYSTEM_CONTEXT_IA32; // 32 bit system context record - -## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - pusha -## Save interrupt state eflags register... - pushf - pop %eax -## We need to determine if any extra data was pushed by the exception, and= if so, save it -## To do this, we check the exception number pushed by the stub, and cache= the -## result in a variable since we'll need this again. - mov %eax,0x0 - cmpl $0x8,0x0 - jne ASM_PFX(CommonIdtEntry+0x20) - movl $0x1,0x0 - jmp ASM_PFX(CommonIdtEntry+0xa8) - cmpl $0xa,0x0 - jne ASM_PFX(CommonIdtEntry+0x35) - movl $0x1,0x0 - jmp ASM_PFX(CommonIdtEntry+0xa8) - cmpl $0xb,0x0 - jne ASM_PFX(CommonIdtEntry+0x4a) - movl $0x1,0x0 - jmp ASM_PFX(CommonIdtEntry+0xa8) - cmpl $0xc,0x0 - jne ASM_PFX(CommonIdtEntry+0x5f) - movl $0x1,0x0 - jmp ASM_PFX(CommonIdtEntry+0xa8) - cmpl $0xd,0x0 - jne ASM_PFX(CommonIdtEntry+0x74) - movl $0x1,0x0 - jmp ASM_PFX(CommonIdtEntry+0xa8) - cmpl $0xe,0x0 - jne ASM_PFX(CommonIdtEntry+0x89) - movl $0x1,0x0 - jmp ASM_PFX(CommonIdtEntry+0xa8) - cmpl $0x11,0x0 - jne ASM_PFX(CommonIdtEntry+0x9e) - movl $0x1,0x0 - jmp ASM_PFX(CommonIdtEntry+0xa8) - movl $0x0,0x0 -## If there's some extra data, save it also, and modify the saved AppEsp t= o effectively -## pop this value off the application's stack. - - cmpl $0x1,0x0 - jne ASM_PFX(CommonIdtEntry+0xc8) - mov 0x0,%eax - mov (%eax),%ebx - mov %ebx,0x0 - add $0x4,%eax - mov %eax,0x0 - jmp ASM_PFX(CommonIdtEntry+0xd2) - movl $0x0,0x0 -## The "pushad" above pushed the debug stack esp. Since what we're actual= ly doing -## is building the context record on the debug stack, we need to save the = pushed -## debug ESP, and replace it with the application's last stack entry... - mov 0xc(%esp),%eax - mov %eax,0x0 - mov 0x0,%eax - add $0xc,%eax - # application stack has eflags, cs, & eip, so - # last actual application stack entry is - # 12 bytes into the application stack. - mov %eax,0xc(%esp) -## continue building context record -## UINT32 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero - mov %ss,%eax - push %eax - =20 - # CS from application is one entry back in application stack - mov 0x0,%eax - movzwl 0x4(%eax),%eax - push %eax - mov %ds,%eax - push %eax - mov %es,%eax - push %eax - mov %fs,%eax - push %eax - mov %gs,%eax - push %eax - -## UINT32 Eip; - # Eip from application is on top of application stack - mov 0x0,%eax - pushl (%eax) - -## UINT32 Gdtr[2], Idtr[2]; - push $0x0 - push $0x0 - sidtl (%esp) - push $0x0 - push $0x0 - sgdtl (%esp) - -## UINT32 Ldtr, Tr; - xor %eax,%eax - str %eax - push %eax - sldt %eax - push %eax - -## UINT32 EFlags; -## Eflags from application is two entries back in application stack - mov 0x0,%eax - pushl 0x8(%eax) - -## UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; -## insure FXSAVE/FXRSTOR is enabled in CR4... -## ... while we're at it, make sure DE is also enabled... - mov %cr4,%eax - or $0x208,%eax - mov %eax,%cr4 - push %eax - mov %cr3,%eax - push %eax - mov %cr2,%eax - push %eax - push $0x0 - mov %cr0,%eax - push %eax - -## UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - mov %db7,%eax - push %eax - -## clear Dr7 while executing debugger itself - xor %eax,%eax - mov %eax,%db7 - mov %db6,%eax - push %eax - -## insure all status bits in dr6 are clear... - xor %eax,%eax - mov %eax,%db6 - mov %db3,%eax - push %eax - mov %db2,%eax - push %eax - mov %db1,%eax - push %eax - mov %db0,%eax - push %eax - -## FX_SAVE_STATE_IA32 FxSaveState; - sub $0x200,%esp - mov %esp,%edi - # IMPORTANT!! The debug stack has been carefully constructed to - # insure that esp and edi are 16 byte aligned when we get here. - # They MUST be. If they are not, a GP fault will occur. - fxsave (%edi) - -## UEFI calling convention for IA32 requires that Direction flag in EFLAGs= is clear - cld - =20 -## UINT32 ExceptionData; - mov 0x0,%eax - push %eax - -# call to C code which will in turn call registered handler -# pass in the vector number - mov %esp,%eax - push %eax - mov 0x0,%eax - push %eax - call ASM_PFX(CommonIdtEntry+0x184) - add $0x8,%esp - -# restore context... -## UINT32 ExceptionData; - add $0x4,%esp - -## FX_SAVE_STATE_IA32 FxSaveState; - mov %esp,%esi - fxrstor (%esi) - add $0x200,%esp - -## UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - pop %eax - mov %eax,%db0 - pop %eax - mov %eax,%db1 - pop %eax - mov %eax,%db2 - pop %eax - mov %eax,%db3 - -## skip restore of dr6. We cleared dr6 during the context save. - add $0x4,%esp - pop %eax - mov %eax,%db7 - -## UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; - pop %eax - mov %eax,%cr0 - add $0x4,%esp - pop %eax - mov %eax,%cr2 - pop %eax - mov %eax,%cr3 - pop %eax - mov %eax,%cr4 - -## UINT32 EFlags; - mov 0x0,%eax - popl 0x8(%eax) - -## UINT32 Ldtr, Tr; -## UINT32 Gdtr[2], Idtr[2]; -## Best not let anyone mess with these particular registers... - add $0x18,%esp - -## UINT32 Eip; - popl (%eax) - -## UINT32 SegGs, SegFs, SegEs, SegDs, SegCs, SegSs; -## NOTE - modified segment registers could hang the debugger... We -## could attempt to insulate ourselves against this possibility, -## but that poses risks as well. -## - - pop %gs - pop %fs - pop %es - pop %ds - popl 0x4(%eax) - pop %ss - mov 0xc(%esp),%ebx - -## The next stuff to restore is the general purpose registers that were pu= shed -## using the "pushad" instruction. -## -## The value of ESP as stored in the context record is the application ESP -## including the 3 entries on the application stack caused by the exception -## itself. It may have been modified by the debug agent, so we need to -## determine if we need to relocate the application stack. - - mov 0x0,%eax # move the potentially modified AppEsp in= to ebx - add $0xc,%eax - cmp %eax,%ebx - je ASM_PFX(CommonIdtEntry+0x202) - mov 0x0,%eax - mov (%eax),%ecx # EIP - mov %ecx,(%ebx) - mov 0x4(%eax),%ecx # CS - mov %ecx,0x4(%ebx) - mov 0x8(%eax),%ecx # EFLAGS - mov %ecx,0x8(%ebx) -=09 - mov %ebx,%eax # modify the saved AppEsp to the new AppE= sp - mov %eax,0x0 - mov 0x0,%eax # restore the DebugEsp on the debug stack - # so our "popad" will not cause a stack sw= itch - mov %eax,0xc(%esp) =20 - cmpl $0x68,0x0 - jne PhonyIretd+0xd -## Restore eflags so when we chain, the flags will be exactly as if we wer= e never here. -## We gin up the stack to do an iretd so we can get ALL the flags. - mov 0x0,%eax - mov 0x8(%eax),%ebx - and $0xfffffcff,%ebx # special handling for IF and TF - push %ebx - push %cs - push $0x0 - iret - -PhonyIretd: -## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - popa - -## Switch back to application stack - mov 0x0,%esp - jmp *0x0 -## Jump to original handler -## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - popa -## Switch back to application stack - mov 0x0,%esp - -## We're outa here... - iret diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm b/Mde= ModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm deleted file mode 100644 index 32cbc31..0000000 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm +++ /dev/null @@ -1,509 +0,0 @@ -;/** @file -; Low leve IA32 specific debug support functions. -; -; Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the B= SD License -; which accompanies this distribution. The full text of the license may = be found at -; http://opensource.org/licenses/bsd-license.php -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -; -;**/ - -.586p -.MODEL FLAT, C - -EXCPT32_DIVIDE_ERROR EQU 0 -EXCPT32_DEBUG EQU 1 -EXCPT32_NMI EQU 2 -EXCPT32_BREAKPOINT EQU 3 -EXCPT32_OVERFLOW EQU 4 -EXCPT32_BOUND EQU 5 -EXCPT32_INVALID_OPCODE EQU 6 -EXCPT32_DOUBLE_FAULT EQU 8 -EXCPT32_INVALID_TSS EQU 10 -EXCPT32_SEG_NOT_PRESENT EQU 11 -EXCPT32_STACK_FAULT EQU 12 -EXCPT32_GP_FAULT EQU 13 -EXCPT32_PAGE_FAULT EQU 14 -EXCPT32_FP_ERROR EQU 16 -EXCPT32_ALIGNMENT_CHECK EQU 17 -EXCPT32_MACHINE_CHECK EQU 18 -EXCPT32_SIMD EQU 19 - -FXSTOR_FLAG EQU 01000000h ; bit cpuid 24 of feature= flags - -;; The FXSTOR and FXRSTOR commands are used for saving and restoring the x= 87, -;; MMX, SSE, SSE2, etc registers. The initialization of the debugsupport = driver -;; MUST check the CPUID feature flags to see that these instructions are a= vailable -;; and fail to init if they are not. - -;; fxstor [edi] -FXSTOR_EDI MACRO - db 0fh, 0aeh, 00000111y ; mod =3D 00, reg/op =3D = 000, r/m =3D 111 =3D [edi] -ENDM - -;; fxrstor [esi] -FXRSTOR_ESI MACRO - db 0fh, 0aeh, 00001110y ; mod =3D 00, reg/op =3D = 001, r/m =3D 110 =3D [esi] -ENDM -.DATA - -public OrigVector, InterruptEntryStub, StubSize, CommonIdtEntry, = FxStorSupport - -StubSize dd InterruptEntryStubEnd - InterruptEntryStub -AppEsp dd 11111111h ; ? -DebugEsp dd 22222222h ; ? -ExtraPush dd 33333333h ; ? -ExceptData dd 44444444h ; ? -Eflags dd 55555555h ; ? -OrigVector dd 66666666h ; ? - -;; The declarations below define the memory region that will be used for t= he debug stack. -;; The context record will be built by pushing register values onto this s= tack. -;; It is imparitive that alignment be carefully managed, since the FXSTOR = and -;; FXRSTOR instructions will GP fault if their memory operand is not 16 by= te aligned. -;; -;; The stub will switch stacks from the application stack to the debuger s= tack -;; and pushes the exception number. -;; -;; Then we building the context record on the stack. Since the stack grows= down, -;; we push the fields of the context record from the back to the front. T= here -;; are 132 bytes of stack used prior allocating the 512 bytes of stack to = be -;; used as the memory buffer for the fxstor instruction. Therefore address= of -;; the buffer used for the FXSTOR instruction is &Eax - 132 - 512, which -;; must be 16 byte aligned. -;; -;; We carefully locate the stack to make this happen. -;; -;; For reference, the context structure looks like this: -;; struct { -;; UINT32 ExceptionData; -;; FX_SAVE_STATE_IA32 FxSaveState; // 512 bytes, must be 16 byte= aligned -;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; -;; UINT32 EFlags; -;; UINT32 Ldtr, Tr; -;; UINT32 Gdtr[2], Idtr[2]; -;; UINT32 Eip; -;; UINT32 Gs, Fs, Es, Ds, Cs, Ss; -;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; -;; } SYSTEM_CONTEXT_IA32; // 32 bit system context record - - -align 16 -DebugStackEnd db "DbgStkEnd >>>>>>" ;; 16 byte long string - m= ust be 16 bytes to preserve alignment - dd 1ffdh dup (000000000h) ;; 32K should be enough st= ack - ;; This allocation is co= ocked to insure - ;; that the the buffer f= or the FXSTORE instruction - ;; will be 16 byte align= ed also. - ;; -ExceptionNumber dd ? ;; first entry will be the= vector number pushed by the stub - -DebugStackBegin db "<<<< DbgStkBegin" ;; initial debug ESP =3D= =3D DebugStackBegin, set in stub - -.CODE - -externdef InterruptDistrubutionHub:near - -;-------------------------------------------------------------------------= ----- -; BOOLEAN -; FxStorSupport ( -; void -; ) -; -; Abstract: Returns TRUE if FxStor instructions are supported -; -FxStorSupport PROC C PUBLIC - -; -; cpuid corrupts ebx which must be preserved per the C calling convention -; - push ebx - mov eax, 1 - cpuid - mov eax, edx - and eax, FXSTOR_FLAG - shr eax, 24 - pop ebx - ret -FxStorSupport ENDP - - - -;-------------------------------------------------------------------------= ----- -; void -; Vect2Desc ( -; DESCRIPTOR * DestDesc, -; void (*Vector) (void) -; ) -; -; Abstract: Encodes an IDT descriptor with the given physical address -; -Vect2Desc PROC C PUBLIC DestPtr:DWORD, Vector:DWORD - - mov eax, Vector - mov ecx, DestPtr - mov word ptr [ecx], ax ; write bits 1= 5..0 of offset - mov dx, cs - mov word ptr [ecx+2], dx ; SYS_CODE_SEL= from GDT - mov word ptr [ecx+4], 0e00h OR 8000h ; type =3D 386= interrupt gate, present - shr eax, 16 - mov word ptr [ecx+6], ax ; write bits 3= 1..16 of offset - - ret - -Vect2Desc ENDP - - - -;-------------------------------------------------------------------------= ----- -; InterruptEntryStub -; -; Abstract: This code is not a function, but is a small piece of code that= is -; copied and fixed up once for each IDT entry that is hooked. -; -InterruptEntryStub:: - mov AppEsp, esp ; save stack top - mov esp, offset DebugStackBegin ; switch to debugger = stack - push 0 ; push vector number = - will be modified before installed - db 0e9h ; jump rel32 - dd 0 ; fixed up to relativ= e address of CommonIdtEntry -InterruptEntryStubEnd: - - - -;-------------------------------------------------------------------------= ----- -; CommonIdtEntry -; -; Abstract: This code is not a function, but is the common part for all IDT -; vectors. -; -CommonIdtEntry:: -;; -;; At this point, the stub has saved the current application stack esp int= o AppEsp -;; and switched stacks to the debug stack, where it pushed the vector numb= er -;; -;; The application stack looks like this: -;; -;; ... -;; (last application stack entry) -;; eflags from interrupted task -;; CS from interrupted task -;; EIP from interrupted task -;; Error code <-------------------- Only present for some exe= ption types -;; -;; - - -;; The stub switched us to the debug stack and pushed the interrupt number. -;; -;; Next, construct the context record. It will be build on the debug stac= k by -;; pushing the registers in the correct order so as to create the context = structure -;; on the debug stack. The context record must be built from the end back= to the -;; beginning because the stack grows down... -; -;; For reference, the context record looks like this: -;; -;; typedef -;; struct { -;; UINT32 ExceptionData; -;; FX_SAVE_STATE_IA32 FxSaveState; -;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -;; UINT32 Cr0, Cr2, Cr3, Cr4; -;; UINT32 EFlags; -;; UINT32 Ldtr, Tr; -;; UINT32 Gdtr[2], Idtr[2]; -;; UINT32 Eip; -;; UINT32 Gs, Fs, Es, Ds, Cs, Ss; -;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; -;; } SYSTEM_CONTEXT_IA32; // 32 bit system context record - -;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - pushad - -;; Save interrupt state eflags register... - pushfd - pop eax - mov dword ptr Eflags, eax - -;; We need to determine if any extra data was pushed by the exception, and= if so, save it -;; To do this, we check the exception number pushed by the stub, and cache= the -;; result in a variable since we'll need this again. - .IF ExceptionNumber =3D=3D EXCPT32_DOUBLE_FAULT - mov ExtraPush, 1 - .ELSEIF ExceptionNumber =3D=3D EXCPT32_INVALID_TSS - mov ExtraPush, 1 - .ELSEIF ExceptionNumber =3D=3D EXCPT32_SEG_NOT_PRESENT - mov ExtraPush, 1 - .ELSEIF ExceptionNumber =3D=3D EXCPT32_STACK_FAULT - mov ExtraPush, 1 - .ELSEIF ExceptionNumber =3D=3D EXCPT32_GP_FAULT - mov ExtraPush, 1 - .ELSEIF ExceptionNumber =3D=3D EXCPT32_PAGE_FAULT - mov ExtraPush, 1 - .ELSEIF ExceptionNumber =3D=3D EXCPT32_ALIGNMENT_CHECK - mov ExtraPush, 1 - .ELSE - mov ExtraPush, 0 - .ENDIF - -;; If there's some extra data, save it also, and modify the saved AppEsp t= o effectively -;; pop this value off the application's stack. - .IF ExtraPush =3D=3D 1 - mov eax, AppEsp - mov ebx, [eax] - mov ExceptData, ebx - add eax, 4 - mov AppEsp, eax - .ELSE - mov ExceptData, 0 - .ENDIF - -;; The "pushad" above pushed the debug stack esp. Since what we're actual= ly doing -;; is building the context record on the debug stack, we need to save the = pushed -;; debug ESP, and replace it with the application's last stack entry... - mov eax, [esp + 12] - mov DebugEsp, eax - mov eax, AppEsp - add eax, 12 - ; application stack has eflags, cs, & eip, so - ; last actual application stack entry is - ; 12 bytes into the application stack. - mov [esp + 12], eax - -;; continue building context record -;; UINT32 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero - mov eax, ss - push eax - - ; CS from application is one entry back in application sta= ck - mov eax, AppEsp - movzx eax, word ptr [eax + 4] - push eax - - mov eax, ds - push eax - mov eax, es - push eax - mov eax, fs - push eax - mov eax, gs - push eax - -;; UINT32 Eip; - ; Eip from application is on top of application stack - mov eax, AppEsp - push dword ptr [eax] - -;; UINT32 Gdtr[2], Idtr[2]; - push 0 - push 0 - sidt fword ptr [esp] - push 0 - push 0 - sgdt fword ptr [esp] - -;; UINT32 Ldtr, Tr; - xor eax, eax - str ax - push eax - sldt ax - push eax - -;; UINT32 EFlags; -;; Eflags from application is two entries back in application stack - mov eax, AppEsp - push dword ptr [eax + 8] - -;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; -;; insure FXSAVE/FXRSTOR is enabled in CR4... -;; ... while we're at it, make sure DE is also enabled... - mov eax, cr4 - or eax, 208h - mov cr4, eax - push eax - mov eax, cr3 - push eax - mov eax, cr2 - push eax - push 0 - mov eax, cr0 - push eax - -;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - mov eax, dr7 - push eax -;; clear Dr7 while executing debugger itself - xor eax, eax - mov dr7, eax - - mov eax, dr6 - push eax -;; insure all status bits in dr6 are clear... - xor eax, eax - mov dr6, eax - - mov eax, dr3 - push eax - mov eax, dr2 - push eax - mov eax, dr1 - push eax - mov eax, dr0 - push eax - -;; FX_SAVE_STATE_IA32 FxSaveState; - sub esp, 512 - mov edi, esp - ; IMPORTANT!! The debug stack has been carefully construct= ed to - ; insure that esp and edi are 16 byte aligned when we get = here. - ; They MUST be. If they are not, a GP fault will occur. - FXSTOR_EDI - -;; UEFI calling convention for IA32 requires that Direction flag in EFLAGs= is clear - cld - -;; UINT32 ExceptionData; - mov eax, ExceptData - push eax - -; call to C code which will in turn call registered handler -; pass in the vector number - mov eax, esp - push eax - mov eax, ExceptionNumber - push eax - call InterruptDistrubutionHub - add esp, 8 - -; restore context... -;; UINT32 ExceptionData; - add esp, 4 - -;; FX_SAVE_STATE_IA32 FxSaveState; - mov esi, esp - FXRSTOR_ESI - add esp, 512 - -;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - pop eax - mov dr0, eax - pop eax - mov dr1, eax - pop eax - mov dr2, eax - pop eax - mov dr3, eax -;; skip restore of dr6. We cleared dr6 during the context save. - add esp, 4 - pop eax - mov dr7, eax - -;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; - pop eax - mov cr0, eax - add esp, 4 - pop eax - mov cr2, eax - pop eax - mov cr3, eax - pop eax - mov cr4, eax - -;; UINT32 EFlags; - mov eax, AppEsp - pop dword ptr [eax + 8] - -;; UINT32 Ldtr, Tr; -;; UINT32 Gdtr[2], Idtr[2]; -;; Best not let anyone mess with these particular registers... - add esp, 24 - -;; UINT32 Eip; - pop dword ptr [eax] - -;; UINT32 SegGs, SegFs, SegEs, SegDs, SegCs, SegSs; -;; NOTE - modified segment registers could hang the debugger... We -;; could attempt to insulate ourselves against this possibility, -;; but that poses risks as well. -;; - - pop gs - pop fs - pop es - pop ds - pop [eax + 4] - pop ss - -;; The next stuff to restore is the general purpose registers that were pu= shed -;; using the "pushad" instruction. -;; -;; The value of ESP as stored in the context record is the application ESP -;; including the 3 entries on the application stack caused by the exception -;; itself. It may have been modified by the debug agent, so we need to -;; determine if we need to relocate the application stack. - - mov ebx, [esp + 12] ; move the potentially modified A= ppEsp into ebx - mov eax, AppEsp - add eax, 12 - cmp ebx, eax - je NoAppStackMove - - mov eax, AppEsp - mov ecx, [eax] ; EIP - mov [ebx], ecx - - mov ecx, [eax + 4] ; CS - mov [ebx + 4], ecx - - mov ecx, [eax + 8] ; EFLAGS - mov [ebx + 8], ecx - - mov eax, ebx ; modify the saved AppEsp to the = new AppEsp - mov AppEsp, eax -NoAppStackMove: - mov eax, DebugEsp ; restore the DebugEsp on the deb= ug stack - ; so our "popad" will not cause a= stack switch - mov [esp + 12], eax - - cmp ExceptionNumber, 068h - jne NoChain - -Chain: - -;; Restore eflags so when we chain, the flags will be exactly as if we wer= e never here. -;; We gin up the stack to do an iretd so we can get ALL the flags. - mov eax, AppEsp - mov ebx, [eax + 8] - and ebx, NOT 300h ; special handling for IF and TF - push ebx - push cs - push PhonyIretd - iretd -PhonyIretd: - -;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - popad - -;; Switch back to application stack - mov esp, AppEsp - -;; Jump to original handler - jmp OrigVector - -NoChain: -;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - popad - -;; Switch back to application stack - mov esp, AppEsp - -;; We're outa here... - iretd -END - - - diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S b/MdeMod= ulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S deleted file mode 100644 index fcc6838..0000000 --- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S +++ /dev/null @@ -1,551 +0,0 @@ -///**@file -// Low leve x64 specific debug support functions. -// -// Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
-// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may = be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -//**/ - -ASM_GLOBAL ASM_PFX(OrigVector) -ASM_GLOBAL ASM_PFX(InterruptEntryStub) -ASM_GLOBAL ASM_PFX(StubSize) -ASM_GLOBAL ASM_PFX(CommonIdtEntry) -ASM_GLOBAL ASM_PFX(FxStorSupport) - -.data - -ASM_PFX(StubSize): .long ASM_PFX(InterruptEntryStubEnd) - ASM_PF= X(InterruptEntryStub) -ASM_PFX(AppRsp): .long 0x11111111 # ? - .long 0x11111111 # ? -ASM_PFX(DebugRsp): .long 0x22222222 # ? - .long 0x22222222 # ? -ASM_PFX(ExtraPush): .long 0x33333333 # ? - .long 0x33333333 # ? -ASM_PFX(ExceptData): .long 0x44444444 # ? - .long 0x44444444 # ? -ASM_PFX(Rflags): .long 0x55555555 # ? - .long 0x55555555 # ? -ASM_PFX(OrigVector): .long 0x66666666 # ? - .long 0x66666666 # ? - -// The declarations below define the memory region that will be used for t= he debug stack. -// The context record will be built by pushing register values onto this s= tack. -// It is imparitive that alignment be carefully managed, since the FXSTOR = and -// FXRSTOR instructions will GP fault if their memory operand is not 16 by= te aligned. -// -// The stub will switch stacks from the application stack to the debuger s= tack -// and pushes the exception number. -// -// Then we building the context record on the stack. Since the stack grows= down, -// we push the fields of the context record from the back to the front. T= here -// are 336 bytes of stack used prior allocating the 512 bytes of stack to = be -// used as the memory buffer for the fxstor instruction. Therefore address= of -// the buffer used for the FXSTOR instruction is &Eax - 336 - 512, which -// must be 16 byte aligned. -// -// We carefully locate the stack to make this happen. -// -// For reference, the context structure looks like this: -// struct { -// UINT64 ExceptionData; -// FX_SAVE_STATE_X64 FxSaveState; // 512 bytes, must be 16 byte = aligned -// UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -// UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; -// UINT64 RFlags; -// UINT64 Ldtr, Tr; -// UINT64 Gdtr[2], Idtr[2]; -// UINT64 Rip; -// UINT64 Gs, Fs, Es, Ds, Cs, Ss; -// UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -// UINT64 R8, R9, R10, R11, R12, R13, R14, R15; -// } SYSTEM_CONTEXT_X64; // 64 bit system context record - -.p2align 4 -DebugStackEnd : .ascii "DbgStkEnd >>>>>>" # 16 byte long string - m= ust be 16 bytes to preserve alignment - .fill 0x1ffc, 4, 0x00000000 - # 32K should be enough st= ack - # This allocation is co= ocked to insure - # that the the buffer f= or the FXSTORE instruction - # will be 16 byte align= ed also. - # -ASM_PFX(ExceptionNumber): .long 0x77777777 # first entry will be the= vector number pushed by the stub - .long 0x77777777 # ? - -DebugStackBegin : .ascii "<<<< DbgStkBegin" # initial debug ESP =3D= =3D DebugStackBegin, set in stub - - -.text - -//------------------------------------------------------------------------= ------ -// BOOLEAN -// FxStorSupport ( -// void -// ) -// -// Abstract: Returns TRUE if FxStor instructions are supported -// -ASM_GLOBAL ASM_PFX(FxStorSupport) -ASM_PFX(FxStorSupport): -// -// cpuid corrupts rbx which must be preserved per the C calling convention -// - pushq %rbx - movq $1, %rax - cpuid - movl %edx, %eax - andq $0x01000000, %rax - shrq $24, %rax - popq %rbx - ret -//------------------------------------------------------------------------= ------ -// void -// Vect2Desc ( -// IA32_IDT_GATE_DESCRIPTOR * DestDesc, // rcx -// void (*Vector) (void) // rdx -// ) -// -// Abstract: Encodes an IDT descriptor with the given physical address -// -ASM_GLOBAL ASM_PFX(Vect2Desc) -ASM_PFX(Vect2Desc): - movq %rdx, %rax - movw %ax, (%rcx) # write bits 15..0 of= offset - movw %cs, %dx - movw %dx, 2(%rcx) # SYS_CODE_SEL from G= DT - movw $(0x0e00 | 0x8000), 4(%rcx) # type =3D 386 interr= upt gate, present - shrq $16, %rax - movw %ax, 6(%rcx) # write bits 31..16 o= f offset - shrq $16, %rax - movl %eax, 8(%rcx) # write bits 63..32 o= f offset - - ret - -//------------------------------------------------------------------------= ------ -// InterruptEntryStub -// -// Abstract: This code is not a function, but is a small piece of code tha= t is -// copied and fixed up once for each IDT entry that is hooke= d. -// -ASM_GLOBAL ASM_PFX(InterruptEntryStub) -ASM_PFX(InterruptEntryStub): - - pushq $0 # push vector number - wil= l be modified before installed - jmp ASM_PFX(CommonIdtEntry) - -ASM_GLOBAL ASM_PFX(InterruptEntryStubEnd) -ASM_PFX(InterruptEntryStubEnd): - -//------------------------------------------------------------------------= ------ -// CommonIdtEntry -// -// Abstract: This code is not a function, but is the common part for all I= DT -// vectors. -// -ASM_GLOBAL ASM_PFX(CommonIdtEntry) -// -// At this point, the stub has saved the current application stack esp int= o AppRsp -// and switched stacks to the debug stack, where it pushed the vector numb= er -// -// The application stack looks like this: -// -// ... -// (last application stack entry) -// [16 bytes alignment, do not care it] -// SS from interrupted task -// RSP from interrupted task -// rflags from interrupted task -// CS from interrupted task -// RIP from interrupted task -// Error code <-------------------- Only present for some exe= ption types -// -// Vector Number <----------------- pushed in our IDT Entry -// - - -// The stub switched us to the debug stack and pushed the interrupt number. -// -// Next, construct the context record. It will be build on the debug stac= k by -// pushing the registers in the correct order so as to create the context = structure -// on the debug stack. The context record must be built from the end back= to the -// beginning because the stack grows down... -// -// For reference, the context record looks like this: -// -// typedef -// struct { -// UINT64 ExceptionData; -// FX_SAVE_STATE_X64 FxSaveState; -// UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -// UINT64 Cr0, Cr2, Cr3, Cr4, Cr8; -// UINT64 RFlags; -// UINT64 Ldtr, Tr; -// UINT64 Gdtr[2], Idtr[2]; -// UINT64 Rip; -// UINT64 Gs, Fs, Es, Ds, Cs, Ss; -// UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -// UINT64 R8, R9, R10, R11, R12, R13, R14, R15; -// } SYSTEM_CONTEXT_X64; // 64 -ASM_PFX(CommonIdtEntry): -// NOTE: we save rsp here to prevent compiler put rip reference cause erro= r AppRsp - pushq %rax - movq (8)(%rsp), %rax # save vector num= ber - movq %rax, ASM_PFX(ExceptionNumber)(%rip) # save vect= or number - popq %rax - addq $8, %rsp # pop vector numb= er - movq %rsp, ASM_PFX(AppRsp)(%rip) # save stack top - movq DebugStackBegin(%rip), %rsp # switch to debug= ger stack - subq $8, %rsp # leave space for= vector number -// UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -// UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - pushq %r15 - pushq %r14 - pushq %r13 - pushq %r12 - pushq %r11 - pushq %r10 - pushq %r9 - pushq %r8 - pushq %rax - pushq %rcx - pushq %rdx - pushq %rbx - pushq %rsp - pushq %rbp - pushq %rsi - pushq %rdi -// Save interrupt state rflags register... - pushfq - popq %rax - movq %rax, ASM_PFX(Rflags)(%rip) -// We need to determine if any extra data was pushed by the exception, and= if so, save it -// To do this, we check the exception number pushed by the stub, and cache= the -// result in a variable since we'll need this again. - cmpl $0, ASM_PFX(ExceptionNumber)(%rip) - jz ExtraPushOne - cmpl $10, ASM_PFX(ExceptionNumber)(%rip) - jz ExtraPushOne - cmpl $11, ASM_PFX(ExceptionNumber)(%rip) - jz ExtraPushOne - cmpl $12, ASM_PFX(ExceptionNumber)(%rip) - jz ExtraPushOne - cmpl $13, ASM_PFX(ExceptionNumber)(%rip) - jz ExtraPushOne - cmpl $14, ASM_PFX(ExceptionNumber)(%rip) - jz ExtraPushOne - cmpl $17, ASM_PFX(ExceptionNumber)(%rip) - jz ExtraPushOne - movl $0, ASM_PFX(ExtraPush)(%rip) - movl $0, ASM_PFX(ExceptData)(%rip) - jmp ExtraPushDone -ExtraPushOne: - movl $1, ASM_PFX(ExtraPush)(%rip) - -// If there's some extra data, save it also, and modify the saved AppRsp t= o effectively -// pop this value off the application's stack. - movq ASM_PFX(AppRsp)(%rip), %rax - movq (%rax), %rbx - movq %rbx, ASM_PFX(ExceptData)(%rip) - addq $8, %rax - movq %rax, ASM_PFX(AppRsp)(%rip) - -ExtraPushDone: - -// The "push" above pushed the debug stack rsp. Since what we're actually= doing -// is building the context record on the debug stack, we need to save the = pushed -// debug RSP, and replace it with the application's last stack entry... - movq 24(%rsp), %rax - movq %rax, ASM_PFX(DebugRsp)(%rip) - movq ASM_PFX(AppRsp)(%rip), %rax - movq 24(%rax), %rax - # application stack has ss, rsp, rflags, cs, & rip, so - # last actual application stack entry is saved at offset - # 24 bytes from stack top. - movq %rax, 24(%rsp) - -// continue building context record -// UINT64 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero - mov %ss, %rax - pushq %rax - # CS from application is one entry back in application sta= ck - movq ASM_PFX(AppRsp)(%rip), %rax - movzwq 8(%rax), %rax - pushq %rax - - mov %ds, %rax - pushq %rax - mov %es, %rax - pushq %rax - mov %fs, %rax - pushq %rax - mov %gs, %rax - pushq %rax -// UINT64 Rip; - # Rip from application is on top of application stack - movq ASM_PFX(AppRsp)(%rip), %rax - pushq (%rax) -// UINT64 Gdtr[2], Idtr[2]; - push $0 - push $0 - sidtq (%rsp) - push $0 - push $0 - sgdtq (%rsp) - -// UINT64 Ldtr, Tr; - xorq %rax, %rax - str %ax - pushq %rax - sldt %ax - pushq %rax - -// UINT64 RFlags; -// Rflags from application is two entries back in application stack - movq ASM_PFX(AppRsp)(%rip), %rax - pushq 16(%rax) -// UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; -// insure FXSAVE/FXRSTOR is enabled in CR4... -// ... while we're at it, make sure DE is also enabled... - movq %cr8, %rax - pushq %rax - movq %cr4, %rax - orq $0x208, %rax - movq %rax, %cr4 - pushq %rax - movq %cr3, %rax - pushq %rax - movq %cr2, %rax - pushq %rax - push $0 - movq %cr0, %rax - pushq %rax -// UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - movq %dr7, %rax - pushq %rax -// clear Dr7 while executing debugger itself - xorq %rax, %rax - movq %rax, %dr7 - - movq %dr6, %rax - pushq %rax -// insure all status bits in dr6 are clear... - xorq %rax, %rax - movq %rax, %dr6 - - movq %dr3, %rax - pushq %rax - movq %dr2, %rax - pushq %rax - movq %dr1, %rax - pushq %rax - movq %dr0, %rax - pushq %rax - -// FX_SAVE_STATE_X64 FxSaveState; - subq $512, %rsp - movq %rsp, %rdi - # IMPORTANT!! The debug stack has been carefully construct= ed to - # insure that rsp and rdi are 16 byte aligned when we get = here. - # They MUST be. If they are not, a GP fault will occur. - - # FXSTOR_RDI - fxsave (%rdi) - -// UEFI calling convention for x64 requires that Direction flag in EFLAGs = is clear - cld - =20 -// UINT64 ExceptionData; - movq ASM_PFX(ExceptData)(%rip), %rax - pushq %rax - -// call to C code which will in turn call registered handler -// pass in the vector number - movq %rsp, %rdx - movq ASM_PFX(ExceptionNumber)(%rip), %rcx - subq $40, %rsp - call ASM_PFX(InterruptDistrubutionHub) - addq $40, %rsp -// restore context... -// UINT64 ExceptionData; - addq $8, %rsp - -// FX_SAVE_STATE_X64 FxSaveState; - movq %rsp, %rsi - - # FXRSTOR_RSI - fxrstor (%rsi) - - addq $512, %rsp - -// UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - popq %rax - movq %rax, %dr0 - popq %rax - movq %rax, %dr1 - popq %rax - movq %rax, %dr2 - popq %rax - movq %rax, %dr3 - -// skip restore of dr6. We cleared dr6 during the context save. - addq $8, %rsp - popq %rax - movq %rax, %dr7 - -// UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; - popq %rax - movq %rax, %cr0 - addq $8, %rsp - popq %rax - movq %rax, %cr2 - popq %rax - movq %rax, %cr3 - popq %rax - movq %rax, %cr4 - popq %rax - movq %rax, %cr8 -// UINT64 RFlags; - movq ASM_PFX(AppRsp)(%rip), %rax - popq 16(%rax) -// UINT64 Ldtr, Tr; -// UINT64 Gdtr[2], Idtr[2]; -// Best not let anyone mess with these particular registers... - addq $48, %rsp -// UINT64 Rip; - popq (%rax) - -// UINT64 Gs, Fs, Es, Ds, Cs, Ss; -// NOTE - modified segment registers could hang the debugger... We -// could attempt to insulate ourselves against this possibility, -// but that poses risks as well. -// - - popq %rax - # mov %rax, %gs - popq %rax - # mov %rax, %fs - popq %rax - mov %rax, %es - popq %rax - mov %rax, %ds - movq ASM_PFX(AppRsp)(%rip), %rax - popq 8(%rax) - popq %rax - mov %rax, %ss -## The next stuff to restore is the general purpose registers that were pu= shed -## using the "push" instruction. -## -## The value of RSP as stored in the context record is the application RSP -## including the 5 entries on the application stack caused by the exception -## itself. It may have been modified by the debug agent, so we need to -## determine if we need to relocate the application stack. - - movq 24(%rsp), %rbx # move the potentially modified Ap= pRsp into rbx - movq ASM_PFX(AppRsp)(%rip), %rax - movq 24(%rax), %rax - cmpq %rax, %rbx - je NoAppStackMove - - movq ASM_PFX(AppRsp)(%rip), %rax - movq (%rax), %rcx # RIP - movq %rcx, (%rbx) - - movq 8(%rax), %rcx # CS - movq %rcx, 8(%rbx) - - movq 16(%rax), %rcx # RFLAGS - movq %rcx, 16(%rbx) - - movq 24(%rax), %rcx # RSP - movq %rcx, 24(%rbx) - - movq 32(%rax), %rcx # SS - movq %rcx, 32(%rbx) - - movq %rbx, %rax # modify the saved AppRsp to the = new AppRsp - movq %rax, ASM_PFX(AppRsp)(%rip) -NoAppStackMove: - movq ASM_PFX(DebugRsp)(%rip), %rax # restore the Debu= gRsp on the debug stack - # so our "pop" will not cause a s= tack switch - movq %rax, 24(%rsp) - - cmpl $0x068, ASM_PFX(ExceptionNumber)(%rip) - jne NoChain - -Chain: - -// Restore rflags so when we chain, the flags will be exactly as if we wer= e never here. -// We gin up the stack to do an iretq so we can get ALL the flags. - movq ASM_PFX(AppRsp)(%rip), %rax - movq 40(%rax), %rbx - pushq %rbx - mov %ss, %rax - pushq %rax - movq %rsp, %rax - addq $16, %rax - pushq %rax - movq ASM_PFX(AppRsp)(%rip), %rax - movq 16(%rax), %rbx - andq $0xfffffffffffffcff, %rbx # special handling for = IF and TF - pushq %rbx - mov %cs, %rax - pushq %rax - movq PhonyIretq(%rip), %rax - pushq %rax - iretq -PhonyIretq: - -// UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -// UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - popq %rdi - popq %rsi - popq %rbp - popq %rsp - popq %rbx - popq %rdx - popq %rcx - popq %rax - popq %r8 - popq %r9 - popq %r10 - popq %r11 - popq %r12 - popq %r13 - popq %r14 - popq %r15 - -// Switch back to application stack - movq ASM_PFX(AppRsp)(%rip), %rsp -// Jump to original handler - jmp ASM_PFX(OrigVector) -NoChain: -// UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -// UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - popq %rdi - popq %rsi - popq %rbp - popq %rsp - popq %rbx - popq %rdx - popq %rcx - popq %rax - popq %r8 - popq %r9 - popq %r10 - popq %r11 - popq %r12 - popq %r13 - popq %r14 - popq %r15 - -// Switch back to application stack - movq ASM_PFX(AppRsp)(%rip), %rsp - -// We're outa here... - iret diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm b/MdeM= odulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm deleted file mode 100644 index bce49ef..0000000 --- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm +++ /dev/null @@ -1,596 +0,0 @@ -;/** @file -; Low level x64 routines used by the debug support driver. -; -; Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the B= SD License -; which accompanies this distribution. The full text of the license may = be found at -; http://opensource.org/licenses/bsd-license.php -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -; -;**/ - -EXCPT64_DIVIDE_ERROR EQU 0 -EXCPT64_DEBUG EQU 1 -EXCPT64_NMI EQU 2 -EXCPT64_BREAKPOINT EQU 3 -EXCPT64_OVERFLOW EQU 4 -EXCPT64_BOUND EQU 5 -EXCPT64_INVALID_OPCODE EQU 6 -EXCPT64_DOUBLE_FAULT EQU 8 -EXCPT64_INVALID_TSS EQU 10 -EXCPT64_SEG_NOT_PRESENT EQU 11 -EXCPT64_STACK_FAULT EQU 12 -EXCPT64_GP_FAULT EQU 13 -EXCPT64_PAGE_FAULT EQU 14 -EXCPT64_FP_ERROR EQU 16 -EXCPT64_ALIGNMENT_CHECK EQU 17 -EXCPT64_MACHINE_CHECK EQU 18 -EXCPT64_SIMD EQU 19 - -FXSTOR_FLAG EQU 01000000h ; bit cpuid 24 of feature= flags - -;; The FXSTOR and FXRSTOR commands are used for saving and restoring the x= 87, -;; MMX, SSE, SSE2, etc registers. The initialization of the debugsupport = driver -;; MUST check the CPUID feature flags to see that these instructions are a= vailable -;; and fail to init if they are not. - -;; fxstor [rdi] -FXSTOR_RDI MACRO - db 0fh, 0aeh, 00000111y ; mod =3D 00, reg/op =3D = 000, r/m =3D 111 =3D [rdi] -ENDM - -;; fxrstor [rsi] -FXRSTOR_RSI MACRO - db 0fh, 0aeh, 00001110y ; mod =3D 00, reg/op =3D = 001, r/m =3D 110 =3D [rsi] -ENDM - -data SEGMENT - -public OrigVector, InterruptEntryStub, StubSize, CommonIdtEntry, = FxStorSupport - -StubSize dd InterruptEntryStubEnd - InterruptEntryStub -AppRsp dq 1111111111111111h ; ? -DebugRsp dq 2222222222222222h ; ? -ExtraPush dq 3333333333333333h ; ? -ExceptData dq 4444444444444444h ; ? -Rflags dq 5555555555555555h ; ? -OrigVector dq 6666666666666666h ; ? - -;; The declarations below define the memory region that will be used for t= he debug stack. -;; The context record will be built by pushing register values onto this s= tack. -;; It is imparitive that alignment be carefully managed, since the FXSTOR = and -;; FXRSTOR instructions will GP fault if their memory operand is not 16 by= te aligned. -;; -;; The stub will switch stacks from the application stack to the debuger s= tack -;; and pushes the exception number. -;; -;; Then we building the context record on the stack. Since the stack grows= down, -;; we push the fields of the context record from the back to the front. T= here -;; are 336 bytes of stack used prior allocating the 512 bytes of stack to = be -;; used as the memory buffer for the fxstor instruction. Therefore address= of -;; the buffer used for the FXSTOR instruction is &Eax - 336 - 512, which -;; must be 16 byte aligned. -;; -;; We carefully locate the stack to make this happen. -;; -;; For reference, the context structure looks like this: -;; struct { -;; UINT64 ExceptionData; -;; FX_SAVE_STATE_X64 FxSaveState; // 512 bytes, must be 16 byte = aligned -;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; -;; UINT64 RFlags; -;; UINT64 Ldtr, Tr; -;; UINT64 Gdtr[2], Idtr[2]; -;; UINT64 Rip; -;; UINT64 Gs, Fs, Es, Ds, Cs, Ss; -;; UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -;; UINT64 R8, R9, R10, R11, R12, R13, R14, R15; -;; } SYSTEM_CONTEXT_X64; // 64 bit system context record - -align 16 -DebugStackEnd db "DbgStkEnd >>>>>>" ;; 16 byte long string - m= ust be 16 bytes to preserve alignment - dd 1ffch dup (000000000h) ;; 32K should be enough st= ack - ;; This allocation is co= ocked to insure - ;; that the the buffer f= or the FXSTORE instruction - ;; will be 16 byte align= ed also. - ;; -ExceptionNumber dq ? ;; first entry will be the= vector number pushed by the stub - -DebugStackBegin db "<<<< DbgStkBegin" ;; initial debug ESP =3D= =3D DebugStackBegin, set in stub - -data ENDS - -text SEGMENT - -externdef InterruptDistrubutionHub:near - -;-------------------------------------------------------------------------= ----- -; BOOLEAN -; FxStorSupport ( -; void -; ) -; -; Abstract: Returns TRUE if FxStor instructions are supported -; -FxStorSupport PROC PUBLIC - -; -; cpuid corrupts rbx which must be preserved per the C calling convention -; - push rbx - mov rax, 1 - cpuid - mov eax, edx - and rax, FXSTOR_FLAG - shr rax, 24 - pop rbx - ret -FxStorSupport ENDP - -;-------------------------------------------------------------------------= ----- -; void -; Vect2Desc ( -; IA32_IDT_GATE_DESCRIPTOR * DestDesc, // rcx -; void (*Vector) (void) // rdx -; ) -; -; Abstract: Encodes an IDT descriptor with the given physical address -; -Vect2Desc PROC PUBLIC - - mov rax, rdx - mov word ptr [rcx], ax ; write bits 1= 5..0 of offset - mov dx, cs - mov word ptr [rcx+2], dx ; SYS_CODE_SEL= from GDT - mov word ptr [rcx+4], 0e00h OR 8000h ; type =3D 386= interrupt gate, present - shr rax, 16 - mov word ptr [rcx+6], ax ; write bits 3= 1..16 of offset - shr rax, 16 - mov dword ptr [rcx+8], eax ; write bits 6= 3..32 of offset - - ret - -Vect2Desc ENDP - - - -;-------------------------------------------------------------------------= ----- -; InterruptEntryStub -; -; Abstract: This code is not a function, but is a small piece of code that= is -; copied and fixed up once for each IDT entry that is hooked. -; -InterruptEntryStub:: - push 0 ; push vector number - wil= l be modified before installed - db 0e9h ; jump rel32 - dd 0 ; fixed up to relative add= ress of CommonIdtEntry -InterruptEntryStubEnd: - - - -;-------------------------------------------------------------------------= ----- -; CommonIdtEntry -; -; Abstract: This code is not a function, but is the common part for all IDT -; vectors. -; -CommonIdtEntry:: -;; -;; At this point, the stub has saved the current application stack esp int= o AppRsp -;; and switched stacks to the debug stack, where it pushed the vector numb= er -;; -;; The application stack looks like this: -;; -;; ... -;; (last application stack entry) -;; [16 bytes alignment, do not care it] -;; SS from interrupted task -;; RSP from interrupted task -;; rflags from interrupted task -;; CS from interrupted task -;; RIP from interrupted task -;; Error code <-------------------- Only present for some exe= ption types -;; -;; Vector Number <----------------- pushed in our IDT Entry -;; - - -;; The stub switched us to the debug stack and pushed the interrupt number. -;; -;; Next, construct the context record. It will be build on the debug stac= k by -;; pushing the registers in the correct order so as to create the context = structure -;; on the debug stack. The context record must be built from the end back= to the -;; beginning because the stack grows down... -; -;; For reference, the context record looks like this: -;; -;; typedef -;; struct { -;; UINT64 ExceptionData; -;; FX_SAVE_STATE_X64 FxSaveState; -;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -;; UINT64 Cr0, Cr2, Cr3, Cr4, Cr8; -;; UINT64 RFlags; -;; UINT64 Ldtr, Tr; -;; UINT64 Gdtr[2], Idtr[2]; -;; UINT64 Rip; -;; UINT64 Gs, Fs, Es, Ds, Cs, Ss; -;; UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -;; UINT64 R8, R9, R10, R11, R12, R13, R14, R15; -;; } SYSTEM_CONTEXT_X64; // 64 bit system context record - -;; NOTE: we save rsp here to prevent compiler put rip reference cause erro= r AppRsp - push rax - mov rax, qword ptr [rsp][8] ; save vector num= ber - mov ExceptionNumber, rax ; save vector num= ber - pop rax - add rsp, 8 ; pop vector numb= er - mov AppRsp, rsp ; save stack top - mov rsp, offset DebugStackBegin ; switch to debug= ger stack - sub rsp, 8 ; leave space for= vector number - -;; UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -;; UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - push r15 - push r14 - push r13 - push r12 - push r11 - push r10 - push r9 - push r8 - push rax - push rcx - push rdx - push rbx - push rsp - push rbp - push rsi - push rdi - -;; Save interrupt state rflags register... - pushfq - pop rax - mov qword ptr Rflags, rax - -;; We need to determine if any extra data was pushed by the exception, and= if so, save it -;; To do this, we check the exception number pushed by the stub, and cache= the -;; result in a variable since we'll need this again. - cmp ExceptionNumber, EXCPT64_DOUBLE_FAULT - jz ExtraPushOne - cmp ExceptionNumber, EXCPT64_INVALID_TSS - jz ExtraPushOne - cmp ExceptionNumber, EXCPT64_SEG_NOT_PRESENT - jz ExtraPushOne - cmp ExceptionNumber, EXCPT64_STACK_FAULT - jz ExtraPushOne - cmp ExceptionNumber, EXCPT64_GP_FAULT - jz ExtraPushOne - cmp ExceptionNumber, EXCPT64_PAGE_FAULT - jz ExtraPushOne - cmp ExceptionNumber, EXCPT64_ALIGNMENT_CHECK - jz ExtraPushOne - mov ExtraPush, 0 - mov ExceptData, 0 - jmp ExtraPushDone -ExtraPushOne: - mov ExtraPush, 1 - -;; If there's some extra data, save it also, and modify the saved AppRsp t= o effectively -;; pop this value off the application's stack. - mov rax, AppRsp - mov rbx, [rax] - mov ExceptData, rbx - add rax, 8 - mov AppRsp, rax - -ExtraPushDone: - -;; The "push" above pushed the debug stack rsp. Since what we're actually= doing -;; is building the context record on the debug stack, we need to save the = pushed -;; debug RSP, and replace it with the application's last stack entry... - mov rax, [rsp + 24] - mov DebugRsp, rax - mov rax, AppRsp - mov rax, QWORD PTR [rax + 24] - ; application stack has ss, rsp, rflags, cs, & rip, so - ; last actual application stack entry is saved at offset - ; 24 bytes from stack top. - mov [rsp + 24], rax - -;; continue building context record -;; UINT64 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero - mov rax, ss - push rax - - ; CS from application is one entry back in application sta= ck - mov rax, AppRsp - movzx rax, word ptr [rax + 8] - push rax - - mov rax, ds - push rax - mov rax, es - push rax - mov rax, fs - push rax - mov rax, gs - push rax - -;; UINT64 Rip; - ; Rip from application is on top of application stack - mov rax, AppRsp - push qword ptr [rax] - -;; UINT64 Gdtr[2], Idtr[2]; - push 0 - push 0 - sidt fword ptr [rsp] - push 0 - push 0 - sgdt fword ptr [rsp] - -;; UINT64 Ldtr, Tr; - xor rax, rax - str ax - push rax - sldt ax - push rax - -;; UINT64 RFlags; -;; Rflags from application is two entries back in application stack - mov rax, AppRsp - push qword ptr [rax + 16] - -;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; -;; insure FXSAVE/FXRSTOR is enabled in CR4... -;; ... while we're at it, make sure DE is also enabled... - mov rax, cr8 - push rax - mov rax, cr4 - or rax, 208h - mov cr4, rax - push rax - mov rax, cr3 - push rax - mov rax, cr2 - push rax - push 0 - mov rax, cr0 - push rax - -;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - mov rax, dr7 - push rax -;; clear Dr7 while executing debugger itself - xor rax, rax - mov dr7, rax - - mov rax, dr6 - push rax -;; insure all status bits in dr6 are clear... - xor rax, rax - mov dr6, rax - - mov rax, dr3 - push rax - mov rax, dr2 - push rax - mov rax, dr1 - push rax - mov rax, dr0 - push rax - -;; FX_SAVE_STATE_X64 FxSaveState; - sub rsp, 512 - mov rdi, rsp - ; IMPORTANT!! The debug stack has been carefully construct= ed to - ; insure that rsp and rdi are 16 byte aligned when we get = here. - ; They MUST be. If they are not, a GP fault will occur. - FXSTOR_RDI - -;; UEFI calling convention for x64 requires that Direction flag in EFLAGs = is clear - cld - -;; UINT64 ExceptionData; - mov rax, ExceptData - push rax - -; call to C code which will in turn call registered handler -; pass in the vector number - mov rdx, rsp - mov rcx, ExceptionNumber - sub rsp, 40 - call InterruptDistrubutionHub - add rsp, 40 - -; restore context... -;; UINT64 ExceptionData; - add rsp, 8 - -;; FX_SAVE_STATE_X64 FxSaveState; - mov rsi, rsp - FXRSTOR_RSI - add rsp, 512 - -;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - pop rax - mov dr0, rax - pop rax - mov dr1, rax - pop rax - mov dr2, rax - pop rax - mov dr3, rax -;; skip restore of dr6. We cleared dr6 during the context save. - add rsp, 8 - pop rax - mov dr7, rax - -;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; - pop rax - mov cr0, rax - add rsp, 8 - pop rax - mov cr2, rax - pop rax - mov cr3, rax - pop rax - mov cr4, rax - pop rax - mov cr8, rax - -;; UINT64 RFlags; - mov rax, AppRsp - pop qword ptr [rax + 16] - -;; UINT64 Ldtr, Tr; -;; UINT64 Gdtr[2], Idtr[2]; -;; Best not let anyone mess with these particular registers... - add rsp, 48 - -;; UINT64 Rip; - pop qword ptr [rax] - -;; UINT64 Gs, Fs, Es, Ds, Cs, Ss; -;; NOTE - modified segment registers could hang the debugger... We -;; could attempt to insulate ourselves against this possibility, -;; but that poses risks as well. -;; - - pop rax - ; mov gs, rax - pop rax - ; mov fs, rax - pop rax - mov es, rax - pop rax - mov ds, rax - mov rax, AppRsp - pop qword ptr [rax + 8] - pop rax - mov ss, rax - -;; The next stuff to restore is the general purpose registers that were pu= shed -;; using the "push" instruction. -;; -;; The value of RSP as stored in the context record is the application RSP -;; including the 5 entries on the application stack caused by the exception -;; itself. It may have been modified by the debug agent, so we need to -;; determine if we need to relocate the application stack. - - mov rbx, [rsp + 24] ; move the potentially modified A= ppRsp into rbx - mov rax, AppRsp - mov rax, QWORD PTR [rax + 24] - cmp rbx, rax - je NoAppStackMove - - mov rax, AppRsp - mov rcx, [rax] ; RIP - mov [rbx], rcx - - mov rcx, [rax + 8] ; CS - mov [rbx + 8], rcx - - mov rcx, [rax + 16] ; RFLAGS - mov [rbx + 16], rcx - - mov rcx, [rax + 24] ; RSP - mov [rbx + 24], rcx - - mov rcx, [rax + 32] ; SS - mov [rbx + 32], rcx - - mov rax, rbx ; modify the saved AppRsp to the = new AppRsp - mov AppRsp, rax -NoAppStackMove: - mov rax, DebugRsp ; restore the DebugRsp on the deb= ug stack - ; so our "pop" will not cause a s= tack switch - mov [rsp + 24], rax - - cmp ExceptionNumber, 068h - jne NoChain - -Chain: - -;; Restore rflags so when we chain, the flags will be exactly as if we wer= e never here. -;; We gin up the stack to do an iretq so we can get ALL the flags. - mov rax, AppRsp - mov rbx, [rax + 40] - push rbx - mov rax, ss - push rax - mov rax, rsp - add rax, 16 - push rax - mov rax, AppRsp - mov rbx, [rax + 16] - and rbx, NOT 300h ; special handling for IF and TF - push rbx - mov rax, cs - push rax - mov rax, offset PhonyIretq - push rax - iretq -PhonyIretq: - -;; UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -;; UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - pop rdi - pop rsi - pop rbp - pop rsp - pop rbx - pop rdx - pop rcx - pop rax - pop r8 - pop r9 - pop r10 - pop r11 - pop r12 - pop r13 - pop r14 - pop r15 - -;; Switch back to application stack - mov rsp, AppRsp - -;; Jump to original handler - jmp OrigVector - -NoChain: -;; UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -;; UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - pop rdi - pop rsi - pop rbp - pop rsp - pop rbx - pop rdx - pop rcx - pop rax - pop r8 - pop r9 - pop r10 - pop r11 - pop r12 - pop r13 - pop r14 - pop r15 - -;; Switch back to application stack - mov rsp, AppRsp - -;; We're outa here... - iretq -text ENDS - -END - - - diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf b/MdeModulePkg/U= niversal/EbcDxe/EbcDebugger.inf index ce413c0..4131136 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf @@ -68,14 +68,10 @@ [Sources.Ia32] Ia32/EbcSupport.c Ia32/EbcLowLevel.nasm - Ia32/EbcLowLevel.S - Ia32/EbcLowLevel.asm =20 [Sources.X64] X64/EbcSupport.c X64/EbcLowLevel.nasm - X64/EbcLowLevel.S - X64/EbcLowLevel.asm =20 [Sources.IPF] Ipf/EbcSupport.h diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf b/MdeModulePkg/Univer= sal/EbcDxe/EbcDxe.inf index d11888e..232370a 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf +++ b/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf @@ -43,14 +43,10 @@ [Sources.Ia32] Ia32/EbcSupport.c Ia32/EbcLowLevel.nasm - Ia32/EbcLowLevel.S - Ia32/EbcLowLevel.asm =20 [Sources.X64] X64/EbcSupport.c X64/EbcLowLevel.nasm - X64/EbcLowLevel.S - X64/EbcLowLevel.asm =20 [Sources.IPF] Ipf/EbcSupport.h diff --git a/MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.S b/MdeModulePk= g/Universal/EbcDxe/Ia32/EbcLowLevel.S deleted file mode 100644 index caf8d40..0000000 --- a/MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.S +++ /dev/null @@ -1,83 +0,0 @@ -#/** @file -# =20 -# Low level IA32 specific EBC support routines. -# =20 -# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# =20 -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# =20 -#**/ - -ASM_GLOBAL ASM_PFX(CopyMem) -ASM_GLOBAL ASM_PFX(EbcInterpret) -ASM_GLOBAL ASM_PFX(ExecuteEbcImageEntryPoint) - -ASM_GLOBAL ASM_PFX(EbcLLCALLEXNative) -ASM_PFX(EbcLLCALLEXNative): - push %ebp - push %ebx - mov %esp,%ebp - mov 0xc(%esp),%ecx - mov 0x14(%esp),%eax - mov 0x10(%esp),%edx - sub %edx,%eax - sub %eax,%esp - mov %esp,%ebx - push %ecx - push %eax - push %edx - push %ebx - call ASM_PFX(CopyMem) - pop %eax - pop %eax - pop %eax - pop %ecx - call *%ecx - mov %ebp,%esp - mov %ebp,%esp - pop %ebx - pop %ebp - ret - -ASM_GLOBAL ASM_PFX(EbcLLEbcInterpret) -ASM_PFX(EbcLLEbcInterpret): - # Construct new stack - push %ebp - mov %esp, %ebp - push %esi - push %edi - sub $0x40, %esp - push %eax - mov %ebp, %esi - add $0x8, %esi - mov %esp, %edi - add $0x4, %edi - mov $0x10, %ecx - rep movsd - =20 - # call C-code - call ASM_PFX(EbcInterpret) - add $0x44, %esp - pop %edi - pop %esi - pop %ebp - ret - -ASM_GLOBAL ASM_PFX(EbcLLExecuteEbcImageEntryPoint) -ASM_PFX(EbcLLExecuteEbcImageEntryPoint): - # Construct new stack - mov %eax, -0xC(%esp) - mov 0x4(%esp), %eax - mov %eax, -0x8(%esp) - mov 0x8(%esp), %eax - mov %eax, -0x4(%esp) - # call C-code - sub $0xC, %esp - call ASM_PFX(ExecuteEbcImageEntryPoint) - add $0xC, %esp - ret diff --git a/MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.asm b/MdeModule= Pkg/Universal/EbcDxe/Ia32/EbcLowLevel.asm deleted file mode 100644 index d5e7423..0000000 --- a/MdeModulePkg/Universal/EbcDxe/Ia32/EbcLowLevel.asm +++ /dev/null @@ -1,207 +0,0 @@ -;/** @file -; =20 -; This code provides low level routines that support the Virtual Machine -; for option ROMs. -; =20 -; Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the B= SD License -; which accompanies this distribution. The full text of the license may = be found at -; http://opensource.org/licenses/bsd-license.php -; =20 -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -; =20 -;**/ - - page ,132 - title VM ASSEMBLY LANGUAGE ROUTINES - -;-------------------------------------------------------------------------= -- -; Equate files needed. -;-------------------------------------------------------------------------= -- - -.XLIST - -.LIST - -;-------------------------------------------------------------------------= -- -; Assembler options -;-------------------------------------------------------------------------= -- - -.686p -.model flat, C -.code -CopyMem PROTO Destination:PTR DWORD, Source:PTR DWORD, Count:DWORD -EbcInterpret PROTO -ExecuteEbcImageEntryPoint PROTO - -;*************************************************************************= *** -; EbcLLCALLEXNative -; -; This function is called to execute an EBC CALLEX instruction -; to native code. -; This instruction requires that we thunk out to external native -; code. For IA32, we simply switch stacks and jump to the -; specified function. On return, we restore the stack pointer -; to its original location. -; -; Destroys no working registers. -;*************************************************************************= *** -; INT64 EbcLLCALLEXNative(UINTN FuncAddr, UINTN NewStackPointer, VOID *Fra= mePtr) -EbcLLCALLEXNative PROC PUBLIC - push ebp - push ebx - mov ebp, esp ; standard function prolog - - ; Get function address in a register - ; mov ecx, FuncAddr =3D> mov ecx, dword ptr [FuncAddr] - mov ecx, dword ptr [esp + 0Ch] - - ; Set stack pointer to new value - ; mov eax, NewStackPointer =3D> mov eax, dword ptr [NewSp] - mov eax, dword ptr [esp + 14h] - mov edx, dword ptr [esp + 10h] - sub eax, edx - sub esp, eax - mov ebx, esp - push ecx - push eax - push edx - push ebx - call CopyMem - pop eax - pop eax - pop eax - pop ecx - - ; Now call the external routine - call ecx - - ; ebp is preserved by the callee. In this function it - ; equals the original esp, so set them equal - mov esp, ebp - - ; Standard function epilog - mov esp, ebp - pop ebx - pop ebp - ret -EbcLLCALLEXNative ENDP - -;*************************************************************************= *** -; EbcLLEbcInterpret -; -; Begin executing an EBC image. -;*************************************************************************= *** -; UINT64 EbcLLEbcInterpret(VOID) -EbcLLEbcInterpret PROC PUBLIC - ; - ;; mov eax, 0xca112ebc - ;; mov eax, EbcEntryPoint - ;; mov ecx, EbcLLEbcInterpret - ;; jmp ecx - ; - ; Caller uses above instruction to jump here - ; The stack is below: - ; +-----------+ - ; | RetAddr | - ; +-----------+ - ; |EntryPoint | (EAX) - ; +-----------+ - ; | Arg1 | <- EDI - ; +-----------+ - ; | Arg2 | - ; +-----------+ - ; | ... | - ; +-----------+ - ; | Arg16 | - ; +-----------+ - ; | EDI | - ; +-----------+ - ; | ESI | - ; +-----------+ - ; | EBP | <- EBP - ; +-----------+ - ; | RetAddr | <- ESP is here - ; +-----------+ - ; | Arg1 | <- ESI - ; +-----------+ - ; | Arg2 | - ; +-----------+ - ; | ... | - ; +-----------+ - ; | Arg16 | - ; +-----------+ - ;=20 - - ; Construct new stack - push ebp - mov ebp, esp - push esi - push edi - sub esp, 40h - push eax - mov esi, ebp - add esi, 8 - mov edi, esp - add edi, 4 - mov ecx, 16 - rep movsd - =20 - ; call C-code - call EbcInterpret - add esp, 44h - pop edi - pop esi - pop ebp - ret -EbcLLEbcInterpret ENDP - -;*************************************************************************= *** -; EbcLLExecuteEbcImageEntryPoint -; -; Begin executing an EBC image. -;*************************************************************************= *** -; UINT64 EbcLLExecuteEbcImageEntryPoint(VOID) -EbcLLExecuteEbcImageEntryPoint PROC PUBLIC - ; - ;; mov eax, 0xca112ebc - ;; mov eax, EbcEntryPoint - ;; mov ecx, EbcLLExecuteEbcImageEntryPoint - ;; jmp ecx - ; - ; Caller uses above instruction to jump here - ; The stack is below: - ; +-----------+ - ; | RetAddr | - ; +-----------+ - ; |EntryPoint | (EAX) - ; +-----------+ - ; |ImageHandle| - ; +-----------+ - ; |SystemTable| - ; +-----------+ - ; | RetAddr | <- ESP is here - ; +-----------+ - ; |ImageHandle| - ; +-----------+ - ; |SystemTable| - ; +-----------+ - ;=20 - =20 - ; Construct new stack - mov [esp - 0Ch], eax - mov eax, [esp + 04h] - mov [esp - 08h], eax - mov eax, [esp + 08h] - mov [esp - 04h], eax - =20 - ; call C-code - sub esp, 0Ch - call ExecuteEbcImageEntryPoint - add esp, 0Ch - ret -EbcLLExecuteEbcImageEntryPoint ENDP - -END diff --git a/MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.S b/MdeModulePkg= /Universal/EbcDxe/X64/EbcLowLevel.S deleted file mode 100644 index b01486a..0000000 --- a/MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.S +++ /dev/null @@ -1,147 +0,0 @@ -#/** @file -# =20 -# This code provides low level routines that support the Virtual Machine -# for option ROMs. -# =20 -# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# =20 -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# =20 -#**/ - -#-------------------------------------------------------------------------= -- -# Equate files needed. -#-------------------------------------------------------------------------= -- - -ASM_GLOBAL ASM_PFX(CopyMem); -ASM_GLOBAL ASM_PFX(EbcInterpret); -ASM_GLOBAL ASM_PFX(ExecuteEbcImageEntryPoint); - -#*************************************************************************= *** -# EbcLLCALLEX -# -# This function is called to execute an EBC CALLEX instruction. -# This instruction requires that we thunk out to external native -# code. For x64, we switch stacks, copy the arguments to the stack -# and jump to the specified function. -# On return, we restore the stack pointer to its original location. -# -# Destroys no working registers. -#*************************************************************************= *** -# VOID EbcLLCALLEXNative(UINTN FuncAddr, UINTN NewStackPointer, VOID *Fram= ePtr) -ASM_GLOBAL ASM_PFX(EbcLLCALLEXNative); -ASM_PFX(EbcLLCALLEXNative): - push %rbp - push %rbx - mov %rsp, %rbp - # Function prolog - - # Copy FuncAddr to a preserved register. - mov %rcx, %rbx - - # Set stack pointer to new value - sub %rdx, %r8 =20 - =20 - # - # Fix X64 native function call prolog. Prepare space for at least 4 = arguments, - # even if the native function's arguments are less than 4. - # - # From MSDN x64 Software Conventions, Overview of x64 Calling Conven= tions: - # "The caller is responsible for allocating space for parameters t= o the - # callee, and must always allocate sufficient space for the 4 regi= ster - # parameters, even if the callee doesn't have that many parameters. - # This aids in the simplicity of supporting C unprototyped functio= ns, - # and vararg C/C++ functions." - # - cmp $0x20, %r8 - jae skip_expansion - mov $0x20, %r8 -skip_expansion: - =20 - sub %r8, %rsp=20 - =20 - # - # Fix X64 native function call 16-byte alignment. - # - # From MSDN x64 Software Conventions, Stack Usage: - # "The stack will always be maintained 16-byte aligned, except wit= hin=20 - # the prolog (for example, after the return address is pushed)." - # - and $0xFFFFFFFFFFFFFFF0, %rsp - =20 - mov %rsp, %rcx - sub $0x20, %rsp=20 - call ASM_PFX(CopyMem) - add $0x20, %rsp - - # Considering the worst case, load 4 potiential arguments - # into registers. - mov (%rsp), %rcx - mov 0x8(%rsp), %rdx - mov 0x10(%rsp), %r8 - mov 0x18(%rsp), %r9 - - # Now call the external routine - call *%rbx - - # Function epilog - mov %rbp, %rsp - pop %rbx - pop %rbp - ret - -ASM_GLOBAL ASM_PFX(EbcLLEbcInterpret); -ASM_PFX(EbcLLEbcInterpret): - # save old parameter to stack - mov %rcx, 0x8(%rsp) - mov %rdx, 0x10(%rsp) - mov %r8, 0x18(%rsp) - mov %r9, 0x20(%rsp) - - # Construct new stack - push %rbp - mov %rsp, %rbp - push %rsi - push %rdi - push %rbx - sub $0x80, %rsp - push %r10 - mov %rbp, %rsi - add $0x10, %rsi - mov %rsp, %rdi - add $0x8, %rdi - mov $0x10, %rcx - rep movsq - =20 - # build new paramater calling convention - mov 0x18(%rsp), %r9 - mov 0x10(%rsp), %r8 - mov 0x8(%rsp), %rdx - mov %r10, %rcx - - # call C-code - call ASM_PFX(EbcInterpret) - add $0x88, %esp - pop %rbx - pop %rdi - pop %rsi - pop %rbp - ret - -ASM_GLOBAL ASM_PFX(EbcLLExecuteEbcImageEntryPoint); -ASM_PFX(EbcLLExecuteEbcImageEntryPoint): - # build new paramater calling convention - mov %rdx, %r8 - mov %rcx, %rdx - mov %r10, %rcx - - # call C-code - sub $0x28, %rsp - call ASM_PFX(ExecuteEbcImageEntryPoint) - add $0x28, %rsp - ret diff --git a/MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.asm b/MdeModuleP= kg/Universal/EbcDxe/X64/EbcLowLevel.asm deleted file mode 100644 index 1fbd165..0000000 --- a/MdeModulePkg/Universal/EbcDxe/X64/EbcLowLevel.asm +++ /dev/null @@ -1,246 +0,0 @@ -;/** @file -; =20 -; This code provides low level routines that support the Virtual Machin= e. -; for option ROMs. -; =20 -; Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-; Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the B= SD License -; which accompanies this distribution. The full text of the license may = be found at -; http://opensource.org/licenses/bsd-license.php -; =20 -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -; =20 -;**/ - - page ,132 - title VM ASSEMBLY LANGUAGE ROUTINES - -;-------------------------------------------------------------------------= -- -; Equate files needed. -;-------------------------------------------------------------------------= -- - -.CODE - -CopyMem PROTO Destination:PTR DWORD, Source:PTR DWORD, Count:DWORD -EbcInterpret PROTO -ExecuteEbcImageEntryPoint PROTO - -;*************************************************************************= *** -; EbcLLCALLEX -; -; This function is called to execute an EBC CALLEX instruction. -; This instruction requires that we thunk out to external native -; code. For x64, we switch stacks, copy the arguments to the stack -; and jump to the specified function. -; On return, we restore the stack pointer to its original location. -; -; Destroys no working registers. -;*************************************************************************= *** -; INT64 EbcLLCALLEXNative(UINTN FuncAddr, UINTN NewStackPointer, VOID *Fra= mePtr) -EbcLLCALLEXNative PROC PUBLIC - push rbp - push rbx - mov rbp, rsp - ; Function prolog - - ; Copy FuncAddr to a preserved register. - mov rbx, rcx - - ; Set stack pointer to new value - sub r8, rdx - - ; - ; Fix X64 native function call prolog. Prepare space for at least 4 = arguments, - ; even if the native function's arguments are less than 4. - ; - ; From MSDN x64 Software Conventions, Overview of x64 Calling Conven= tions: - ; "The caller is responsible for allocating space for parameters t= o the - ; callee, and must always allocate sufficient space for the 4 regi= ster - ; parameters, even if the callee doesn't have that many parameters. - ; This aids in the simplicity of supporting C unprototyped functio= ns, - ; and vararg C/C++ functions." - ; - cmp r8, 20h - jae skip_expansion - mov r8, 20h -skip_expansion: - =20 - sub rsp, r8 - - ; - ; Fix X64 native function call 16-byte alignment. - ; - ; From MSDN x64 Software Conventions, Stack Usage: - ; "The stack will always be maintained 16-byte aligned, except wit= hin=20 - ; the prolog (for example, after the return address is pushed)." - ; - and rsp, NOT 0fh - - mov rcx, rsp - sub rsp, 20h - call CopyMem - add rsp, 20h - - ; Considering the worst case, load 4 potiential arguments - ; into registers. - mov rcx, qword ptr [rsp] - mov rdx, qword ptr [rsp+8h] - mov r8, qword ptr [rsp+10h] - mov r9, qword ptr [rsp+18h] - - ; Now call the external routine - call rbx - - ; Function epilog - mov rsp, rbp - pop rbx - pop rbp - ret -EbcLLCALLEXNative ENDP - -;*************************************************************************= *** -; EbcLLEbcInterpret -; -; Begin executing an EBC image. -;*************************************************************************= *** -; UINT64 EbcLLEbcInterpret(VOID) -EbcLLEbcInterpret PROC PUBLIC - ; - ;; mov rax, ca112ebccall2ebch - ;; mov r10, EbcEntryPoint - ;; mov r11, EbcLLEbcInterpret - ;; jmp r11 - ; - ; Caller uses above instruction to jump here - ; The stack is below: - ; +-----------+ - ; | RetAddr | - ; +-----------+ - ; |EntryPoint | (R10) - ; +-----------+ - ; | Arg1 | <- RDI - ; +-----------+ - ; | Arg2 | - ; +-----------+ - ; | ... | - ; +-----------+ - ; | Arg16 | - ; +-----------+ - ; | Dummy | - ; +-----------+ - ; | RDI | - ; +-----------+ - ; | RSI | - ; +-----------+ - ; | RBP | <- RBP - ; +-----------+ - ; | RetAddr | <- RSP is here - ; +-----------+ - ; | Scratch1 | (RCX) <- RSI - ; +-----------+ - ; | Scratch2 | (RDX) - ; +-----------+ - ; | Scratch3 | (R8) - ; +-----------+ - ; | Scratch4 | (R9) - ; +-----------+ - ; | Arg5 | - ; +-----------+ - ; | Arg6 | - ; +-----------+ - ; | ... | - ; +-----------+ - ; | Arg16 | - ; +-----------+ - ; - - ; save old parameter to stack - mov [rsp + 08h], rcx - mov [rsp + 10h], rdx - mov [rsp + 18h], r8 - mov [rsp + 20h], r9 - - ; Construct new stack - push rbp - mov rbp, rsp - push rsi - push rdi - push rbx - sub rsp, 80h - push r10 - mov rsi, rbp - add rsi, 10h - mov rdi, rsp - add rdi, 8 - mov rcx, 16 - rep movsq - =20 - ; build new paramater calling convention - mov r9, [rsp + 18h] - mov r8, [rsp + 10h] - mov rdx, [rsp + 08h] - mov rcx, r10 - - ; call C-code - call EbcInterpret - add rsp, 88h - pop rbx - pop rdi - pop rsi - pop rbp - ret -EbcLLEbcInterpret ENDP - -;*************************************************************************= *** -; EbcLLExecuteEbcImageEntryPoint -; -; Begin executing an EBC image. -;*************************************************************************= *** -; UINT64 EbcLLExecuteEbcImageEntryPoint(VOID) -EbcLLExecuteEbcImageEntryPoint PROC PUBLIC - ; - ;; mov rax, ca112ebccall2ebch - ;; mov r10, EbcEntryPoint - ;; mov r11, EbcLLExecuteEbcImageEntryPoint - ;; jmp r11 - ; - ; Caller uses above instruction to jump here - ; The stack is below: - ; +-----------+ - ; | RetAddr | - ; +-----------+ - ; |EntryPoint | (R10) - ; +-----------+ - ; |ImageHandle| - ; +-----------+ - ; |SystemTable| - ; +-----------+ - ; | Dummy | - ; +-----------+ - ; | Dummy | - ; +-----------+ - ; | RetAddr | <- RSP is here - ; +-----------+ - ; |ImageHandle| (RCX) - ; +-----------+ - ; |SystemTable| (RDX) - ; +-----------+ - ;=20 - - ; build new paramater calling convention - mov r8, rdx - mov rdx, rcx - mov rcx, r10 - - ; call C-code - sub rsp, 28h - call ExecuteEbcImageEntryPoint - add rsp, 28h - ret -EbcLLExecuteEbcImageEntryPoint ENDP - -END - --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 05:27:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152622192784266.84366315892248; Sun, 13 May 2018 07:32:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 81B9A210D6CE6; Sun, 13 May 2018 07:32:07 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8E22020D7B25E for ; Sun, 13 May 2018 07:32:04 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2018 07:32:03 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.158.42]) by fmsmga004.fm.intel.com with ESMTP; 13 May 2018 07:32:02 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,396,1520924400"; d="scan'208";a="53911623" From: Liming Gao To: edk2-devel@lists.01.org Date: Sun, 13 May 2018 22:31:40 +0800 Message-Id: <1526221902-9060-5-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1526221902-9060-1-git-send-email-liming.gao@intel.com> References: <1526221902-9060-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [Patch 3/5] MdePkg: Remove X86 ASM and S files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" NASM has replaced ASM and S files. Rmove ASM from all modules. Remove S files from the drivers only. After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 4 - MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.asm | 40 --- MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.asm | 39 --- MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.asm | 38 --- MdePkg/Library/BaseCpuLib/X64/CpuSleep.asm | 37 --- .../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 2 - MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.asm | 141 --------- MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.asm | 127 --------- MdePkg/Library/BaseLib/BaseLib.inf | 246 ---------------- MdePkg/Library/BaseLib/Ia32/ARShiftU64.asm | 48 ---- MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.asm | 40 --- MdePkg/Library/BaseLib/Ia32/CpuId.asm | 66 ----- MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm | 68 ----- MdePkg/Library/BaseLib/Ia32/CpuPause.asm | 40 --- MdePkg/Library/BaseLib/Ia32/DisableCache.asm | 45 --- MdePkg/Library/BaseLib/Ia32/DisableInterrupts.asm | 40 --- MdePkg/Library/BaseLib/Ia32/DisablePaging32.asm | 57 ---- MdePkg/Library/BaseLib/Ia32/DivU64x32.asm | 46 --- MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm | 51 ---- MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.asm | 92 ------ MdePkg/Library/BaseLib/Ia32/EnableCache.asm | 45 --- .../BaseLib/Ia32/EnableDisableInterrupts.asm | 41 --- MdePkg/Library/BaseLib/Ia32/EnableInterrupts.asm | 40 --- MdePkg/Library/BaseLib/Ia32/EnablePaging32.asm | 57 ---- MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm | 68 ----- MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm | 55 ---- MdePkg/Library/BaseLib/Ia32/FxRestore.asm | 42 --- MdePkg/Library/BaseLib/Ia32/FxSave.asm | 42 --- MdePkg/Library/BaseLib/Ia32/Invd.asm | 40 --- MdePkg/Library/BaseLib/Ia32/LRotU64.asm | 51 ---- MdePkg/Library/BaseLib/Ia32/LShiftU64.asm | 48 ---- MdePkg/Library/BaseLib/Ia32/LongJump.asm | 46 --- MdePkg/Library/BaseLib/Ia32/ModU64x32.asm | 45 --- MdePkg/Library/BaseLib/Ia32/Monitor.asm | 45 --- MdePkg/Library/BaseLib/Ia32/MultU64x32.asm | 43 --- MdePkg/Library/BaseLib/Ia32/MultU64x64.asm | 47 --- MdePkg/Library/BaseLib/Ia32/Mwait.asm | 43 --- MdePkg/Library/BaseLib/Ia32/RRotU64.asm | 51 ---- MdePkg/Library/BaseLib/Ia32/RShiftU64.asm | 48 ---- MdePkg/Library/BaseLib/Ia32/RdRand.asm | 94 ------ MdePkg/Library/BaseLib/Ia32/ReadCr0.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadCr2.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadCr3.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadCr4.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadCs.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadDr0.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadDr1.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadDr2.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadDr3.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadDr4.asm | 47 --- MdePkg/Library/BaseLib/Ia32/ReadDr5.asm | 47 --- MdePkg/Library/BaseLib/Ia32/ReadDr6.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadDr7.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadDs.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadEflags.asm | 41 --- MdePkg/Library/BaseLib/Ia32/ReadEs.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadFs.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadGdtr.asm | 41 --- MdePkg/Library/BaseLib/Ia32/ReadGs.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadIdtr.asm | 41 --- MdePkg/Library/BaseLib/Ia32/ReadLdtr.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadMm0.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMm1.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMm2.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMm3.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMm4.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMm5.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMm6.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMm7.asm | 45 --- MdePkg/Library/BaseLib/Ia32/ReadMsr64.asm | 41 --- MdePkg/Library/BaseLib/Ia32/ReadPmc.asm | 41 --- MdePkg/Library/BaseLib/Ia32/ReadSs.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadTr.asm | 40 --- MdePkg/Library/BaseLib/Ia32/ReadTsc.asm | 40 --- MdePkg/Library/BaseLib/Ia32/SetJump.asm | 51 ---- MdePkg/Library/BaseLib/Ia32/SwapBytes64.asm | 43 --- MdePkg/Library/BaseLib/Ia32/Thunk16.asm | 260 ----------------- MdePkg/Library/BaseLib/Ia32/Wbinvd.asm | 40 --- MdePkg/Library/BaseLib/Ia32/WriteCr0.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteCr2.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteCr3.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteCr4.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteDr0.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteDr1.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteDr2.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteDr3.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteDr4.asm | 48 ---- MdePkg/Library/BaseLib/Ia32/WriteDr5.asm | 48 ---- MdePkg/Library/BaseLib/Ia32/WriteDr6.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteDr7.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteGdtr.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteIdtr.asm | 44 --- MdePkg/Library/BaseLib/Ia32/WriteLdtr.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm0.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm1.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm2.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm3.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm4.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm5.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm6.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMm7.asm | 41 --- MdePkg/Library/BaseLib/Ia32/WriteMsr64.asm | 44 --- MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm | 37 --- MdePkg/Library/BaseLib/X64/CpuId.asm | 62 ---- MdePkg/Library/BaseLib/X64/CpuIdEx.asm | 64 ----- MdePkg/Library/BaseLib/X64/CpuPause.asm | 37 --- MdePkg/Library/BaseLib/X64/DisableCache.asm | 43 --- MdePkg/Library/BaseLib/X64/DisableInterrupts.asm | 38 --- MdePkg/Library/BaseLib/X64/DisablePaging64.asm | 84 ------ MdePkg/Library/BaseLib/X64/EnableCache.asm | 43 --- .../BaseLib/X64/EnableDisableInterrupts.asm | 39 --- MdePkg/Library/BaseLib/X64/EnableInterrupts.asm | 38 --- MdePkg/Library/BaseLib/X64/FlushCacheLine.asm | 39 --- MdePkg/Library/BaseLib/X64/FxRestore.asm | 38 --- MdePkg/Library/BaseLib/X64/FxSave.asm | 38 --- MdePkg/Library/BaseLib/X64/Invd.asm | 38 --- MdePkg/Library/BaseLib/X64/LongJump.asm | 58 ---- MdePkg/Library/BaseLib/X64/Monitor.asm | 43 --- MdePkg/Library/BaseLib/X64/Mwait.asm | 41 --- MdePkg/Library/BaseLib/X64/RdRand.asm | 83 ------ MdePkg/Library/BaseLib/X64/ReadCr0.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadCr2.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadCr3.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadCr4.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadCs.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadDr0.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadDr1.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadDr2.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadDr3.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadDr4.asm | 42 --- MdePkg/Library/BaseLib/X64/ReadDr5.asm | 42 --- MdePkg/Library/BaseLib/X64/ReadDr6.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadDr7.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadDs.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadEflags.asm | 39 --- MdePkg/Library/BaseLib/X64/ReadEs.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadFs.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadGdtr.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadGs.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadIdtr.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadLdtr.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadMm0.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMm1.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMm2.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMm3.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMm4.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMm5.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMm6.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMm7.asm | 41 --- MdePkg/Library/BaseLib/X64/ReadMsr64.asm | 40 --- MdePkg/Library/BaseLib/X64/ReadPmc.asm | 40 --- MdePkg/Library/BaseLib/X64/ReadSs.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadTr.asm | 38 --- MdePkg/Library/BaseLib/X64/ReadTsc.asm | 40 --- MdePkg/Library/BaseLib/X64/SetJump.asm | 66 ----- MdePkg/Library/BaseLib/X64/SwitchStack.asm | 51 ---- MdePkg/Library/BaseLib/X64/Thunk16.asm | 315 -----------------= ---- MdePkg/Library/BaseLib/X64/Wbinvd.asm | 38 --- MdePkg/Library/BaseLib/X64/WriteCr0.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteCr2.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteCr3.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteCr4.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteDr0.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteDr1.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteDr2.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteDr3.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteDr4.asm | 43 --- MdePkg/Library/BaseLib/X64/WriteDr5.asm | 43 --- MdePkg/Library/BaseLib/X64/WriteDr6.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteDr7.asm | 39 --- MdePkg/Library/BaseLib/X64/WriteGdtr.asm | 38 --- MdePkg/Library/BaseLib/X64/WriteIdtr.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteLdtr.asm | 38 --- MdePkg/Library/BaseLib/X64/WriteMm0.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMm1.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMm2.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMm3.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMm4.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMm5.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMm6.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMm7.asm | 41 --- MdePkg/Library/BaseLib/X64/WriteMsr64.asm | 41 --- .../Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf | 22 -- .../Library/BaseMemoryLibMmx/Ia32/CompareMem.asm | 56 ---- MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.asm | 77 ----- MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.asm | 55 ---- MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.asm | 55 ---- MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.asm | 64 ----- MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.asm | 55 ---- MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.asm | 70 ----- MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.asm | 63 ----- MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.asm | 59 ---- MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.asm | 50 ---- MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.asm | 56 ---- MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.asm | 54 ---- MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.asm | 70 ----- MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.asm | 53 ---- MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.asm | 53 ---- MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.asm | 53 ---- MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.asm | 53 ---- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.asm | 58 ---- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.asm | 57 ---- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.asm | 53 ---- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.asm | 46 --- MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.asm | 54 ---- .../BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf | 22 -- .../BaseMemoryLibOptDxe/Ia32/CompareMem.asm | 56 ---- .../Library/BaseMemoryLibOptDxe/Ia32/CopyMem.asm | 84 ------ .../Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.asm | 55 ---- .../Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.asm | 55 ---- .../Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.asm | 64 ----- .../Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.asm | 55 ---- MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.asm | 53 ---- .../Library/BaseMemoryLibOptDxe/Ia32/SetMem16.asm | 45 --- .../Library/BaseMemoryLibOptDxe/Ia32/SetMem32.asm | 45 --- .../Library/BaseMemoryLibOptDxe/Ia32/SetMem64.asm | 49 ---- .../Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.asm | 50 ---- .../Library/BaseMemoryLibOptDxe/X64/CompareMem.asm | 54 ---- MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.asm | 79 ------ .../Library/BaseMemoryLibOptDxe/X64/ScanMem16.asm | 53 ---- .../Library/BaseMemoryLibOptDxe/X64/ScanMem32.asm | 53 ---- .../Library/BaseMemoryLibOptDxe/X64/ScanMem64.asm | 53 ---- .../Library/BaseMemoryLibOptDxe/X64/ScanMem8.asm | 53 ---- MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.asm | 58 ---- .../Library/BaseMemoryLibOptDxe/X64/SetMem16.asm | 45 --- .../Library/BaseMemoryLibOptDxe/X64/SetMem32.asm | 45 --- .../Library/BaseMemoryLibOptDxe/X64/SetMem64.asm | 44 --- MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.asm | 48 ---- .../BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf | 22 -- .../BaseMemoryLibOptPei/Ia32/CompareMem.asm | 56 ---- .../Library/BaseMemoryLibOptPei/Ia32/CopyMem.asm | 61 ---- .../Library/BaseMemoryLibOptPei/Ia32/ScanMem16.asm | 55 ---- .../Library/BaseMemoryLibOptPei/Ia32/ScanMem32.asm | 55 ---- .../Library/BaseMemoryLibOptPei/Ia32/ScanMem64.asm | 64 ----- .../Library/BaseMemoryLibOptPei/Ia32/ScanMem8.asm | 55 ---- MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.asm | 53 ---- .../Library/BaseMemoryLibOptPei/Ia32/SetMem16.asm | 45 --- .../Library/BaseMemoryLibOptPei/Ia32/SetMem32.asm | 45 --- .../Library/BaseMemoryLibOptPei/Ia32/SetMem64.asm | 49 ---- .../Library/BaseMemoryLibOptPei/Ia32/ZeroMem.asm | 50 ---- .../Library/BaseMemoryLibOptPei/X64/CompareMem.asm | 54 ---- MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.asm | 61 ---- .../Library/BaseMemoryLibOptPei/X64/ScanMem16.asm | 53 ---- .../Library/BaseMemoryLibOptPei/X64/ScanMem32.asm | 53 ---- .../Library/BaseMemoryLibOptPei/X64/ScanMem64.asm | 53 ---- .../Library/BaseMemoryLibOptPei/X64/ScanMem8.asm | 53 ---- MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.asm | 45 --- .../Library/BaseMemoryLibOptPei/X64/SetMem16.asm | 44 --- .../Library/BaseMemoryLibOptPei/X64/SetMem32.asm | 44 --- .../Library/BaseMemoryLibOptPei/X64/SetMem64.asm | 43 --- MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.asm | 47 --- .../BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf | 22 -- .../BaseMemoryLibRepStr/Ia32/CompareMem.asm | 56 ---- .../Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm | 63 ----- .../Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm | 57 ---- .../Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm | 57 ---- .../Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm | 66 ----- .../Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm | 57 ---- MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.asm | 45 --- .../Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm | 45 --- .../Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm | 45 --- .../Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm | 49 ---- .../Library/BaseMemoryLibRepStr/Ia32/ZeroMem.asm | 50 ---- .../Library/BaseMemoryLibRepStr/X64/CompareMem.asm | 54 ---- MdePkg/Library/BaseMemoryLibRepStr/X64/CopyMem.asm | 61 ---- .../Library/BaseMemoryLibRepStr/X64/ScanMem16.asm | 53 ---- .../Library/BaseMemoryLibRepStr/X64/ScanMem32.asm | 53 ---- .../Library/BaseMemoryLibRepStr/X64/ScanMem64.asm | 53 ---- .../Library/BaseMemoryLibRepStr/X64/ScanMem8.asm | 53 ---- MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem.asm | 44 --- .../Library/BaseMemoryLibRepStr/X64/SetMem16.asm | 44 --- .../Library/BaseMemoryLibRepStr/X64/SetMem32.asm | 44 --- .../Library/BaseMemoryLibRepStr/X64/SetMem64.asm | 43 --- MdePkg/Library/BaseMemoryLibRepStr/X64/ZeroMem.asm | 47 --- .../BaseMemoryLibSse2/BaseMemoryLibSse2.inf | 22 -- .../Library/BaseMemoryLibSse2/Ia32/CompareMem.asm | 56 ---- MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm | 84 ------ .../Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm | 55 ---- .../Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm | 55 ---- .../Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm | 64 ----- MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm | 55 ---- MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm | 75 ----- MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm | 71 ----- MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm | 70 ----- MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm | 64 ----- MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm | 67 ----- .../Library/BaseMemoryLibSse2/X64/CompareMem.asm | 54 ---- MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.asm | 79 ------ MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.asm | 53 ---- MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.asm | 53 ---- MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.asm | 53 ---- MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.asm | 53 ---- MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.asm | 69 ----- MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.asm | 67 ----- MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.asm | 66 ----- MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.asm | 59 ---- MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.asm | 63 ----- .../BaseSynchronizationLib.inf | 10 - .../Ia32/InterlockedCompareExchange16.asm | 46 --- .../Ia32/InterlockedCompareExchange32.asm | 45 --- .../Ia32/InterlockedCompareExchange64.asm | 47 --- .../Ia32/InterlockedDecrement.asm | 42 --- .../Ia32/InterlockedIncrement.asm | 42 --- .../X64/InterlockedCompareExchange16.asm | 42 --- .../X64/InterlockedCompareExchange32.asm | 41 --- .../X64/InterlockedCompareExchange64.asm | 41 --- .../X64/InterlockedDecrement.asm | 39 --- .../X64/InterlockedIncrement.asm | 39 --- 308 files changed, 15367 deletions(-) delete mode 100644 MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.asm delete mode 100644 MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.asm delete mode 100644 MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.asm delete mode 100644 MdePkg/Library/BaseCpuLib/X64/CpuSleep.asm delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.asm delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ARShiftU64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/CpuId.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/CpuPause.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/DisableCache.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/DisableInterrupts.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/DisablePaging32.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/DivU64x32.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/EnableCache.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/EnableInterrupts.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/EnablePaging32.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/FxRestore.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/FxSave.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/Invd.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/LRotU64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/LShiftU64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/LongJump.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ModU64x32.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/Monitor.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/MultU64x32.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/MultU64x64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/Mwait.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/RRotU64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/RShiftU64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/RdRand.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadCr0.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadCr2.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadCr3.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadCr4.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadCs.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr0.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr1.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr2.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr3.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr4.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr5.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr6.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDr7.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadDs.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadEflags.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadEs.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadFs.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadGdtr.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadGs.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadIdtr.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadLdtr.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm0.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm1.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm2.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm3.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm4.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm5.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm6.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMm7.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadMsr64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadPmc.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadSs.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadTr.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/ReadTsc.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/SetJump.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/SwapBytes64.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/Thunk16.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/Wbinvd.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteCr0.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteCr2.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteCr3.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteCr4.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr0.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr1.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr2.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr3.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr4.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr5.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr6.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteDr7.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteGdtr.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteIdtr.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteLdtr.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm0.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm1.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm2.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm3.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm4.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm5.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm6.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMm7.asm delete mode 100644 MdePkg/Library/BaseLib/Ia32/WriteMsr64.asm delete mode 100644 MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm delete mode 100644 MdePkg/Library/BaseLib/X64/CpuId.asm delete mode 100644 MdePkg/Library/BaseLib/X64/CpuIdEx.asm delete mode 100644 MdePkg/Library/BaseLib/X64/CpuPause.asm delete mode 100644 MdePkg/Library/BaseLib/X64/DisableCache.asm delete mode 100644 MdePkg/Library/BaseLib/X64/DisableInterrupts.asm delete mode 100644 MdePkg/Library/BaseLib/X64/DisablePaging64.asm delete mode 100644 MdePkg/Library/BaseLib/X64/EnableCache.asm delete mode 100644 MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm delete mode 100644 MdePkg/Library/BaseLib/X64/EnableInterrupts.asm delete mode 100644 MdePkg/Library/BaseLib/X64/FlushCacheLine.asm delete mode 100644 MdePkg/Library/BaseLib/X64/FxRestore.asm delete mode 100644 MdePkg/Library/BaseLib/X64/FxSave.asm delete mode 100644 MdePkg/Library/BaseLib/X64/Invd.asm delete mode 100644 MdePkg/Library/BaseLib/X64/LongJump.asm delete mode 100644 MdePkg/Library/BaseLib/X64/Monitor.asm delete mode 100644 MdePkg/Library/BaseLib/X64/Mwait.asm delete mode 100644 MdePkg/Library/BaseLib/X64/RdRand.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadCr0.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadCr2.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadCr3.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadCr4.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadCs.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr0.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr1.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr2.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr3.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr4.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr5.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr6.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDr7.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadDs.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadEflags.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadEs.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadFs.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadGdtr.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadGs.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadIdtr.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadLdtr.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm0.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm1.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm2.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm3.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm4.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm5.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm6.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMm7.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadMsr64.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadPmc.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadSs.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadTr.asm delete mode 100644 MdePkg/Library/BaseLib/X64/ReadTsc.asm delete mode 100644 MdePkg/Library/BaseLib/X64/SetJump.asm delete mode 100644 MdePkg/Library/BaseLib/X64/SwitchStack.asm delete mode 100644 MdePkg/Library/BaseLib/X64/Thunk16.asm delete mode 100644 MdePkg/Library/BaseLib/X64/Wbinvd.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteCr0.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteCr2.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteCr3.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteCr4.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr0.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr1.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr2.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr3.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr4.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr5.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr6.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteDr7.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteGdtr.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteIdtr.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteLdtr.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm0.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm1.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm2.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm3.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm4.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm5.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm6.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMm7.asm delete mode 100644 MdePkg/Library/BaseLib/X64/WriteMsr64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibRepStr/X64/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.asm delete mode 100644 MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedC= ompareExchange16.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedC= ompareExchange32.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedC= ompareExchange64.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedD= ecrement.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedI= ncrement.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCo= mpareExchange16.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCo= mpareExchange32.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCo= mpareExchange64.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDe= crement.asm delete mode 100644 MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIn= crement.asm diff --git a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf b/MdePkg/Library/Base= CpuLib/BaseCpuLib.inf index dad08df..84564e0 100644 --- a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf +++ b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf @@ -37,18 +37,14 @@ Ia32/CpuFlushTlb.c | MSFT=20 =20 Ia32/CpuSleep.nasm| INTEL - Ia32/CpuSleep.asm | INTEL=20 Ia32/CpuFlushTlb.nasm| INTEL - Ia32/CpuFlushTlb.asm | INTEL=20 =20 Ia32/CpuSleepGcc.c | GCC=20 Ia32/CpuFlushTlbGcc.c | GCC=20 =20 [Sources.X64] X64/CpuFlushTlb.nasm - X64/CpuFlushTlb.asm=20 X64/CpuSleep.nasm - X64/CpuSleep.asm =20 X64/CpuSleep.nasm| GCC X64/CpuSleep.S | GCC=20 diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.asm b/MdePkg/Librar= y/BaseCpuLib/Ia32/CpuFlushTlb.asm deleted file mode 100644 index 271690d..0000000 --- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuFlushTlb.Asm -; -; Abstract: -; -; CpuFlushTlb function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuFlushTlb ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuFlushTlb PROC - mov eax, cr3 - mov cr3, eax ; moving to CR3 flushes TLB - ret -CpuFlushTlb ENDP - - END diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.asm b/MdePkg/Library/B= aseCpuLib/Ia32/CpuSleep.asm deleted file mode 100644 index 5bfd7b2..0000000 --- a/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuSleep.Asm -; -; Abstract: -; -; CpuSleep function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuSleep ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuSleep PROC - hlt - ret -CpuSleep ENDP - - END diff --git a/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.asm b/MdePkg/Library= /BaseCpuLib/X64/CpuFlushTlb.asm deleted file mode 100644 index 6a75287..0000000 --- a/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuFlushTlb.Asm -; -; Abstract: -; -; CpuFlushTlb function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuFlushTlb ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuFlushTlb PROC - mov rax, cr3 - mov cr3, rax - ret -CpuFlushTlb ENDP - - END diff --git a/MdePkg/Library/BaseCpuLib/X64/CpuSleep.asm b/MdePkg/Library/Ba= seCpuLib/X64/CpuSleep.asm deleted file mode 100644 index 196438f..0000000 --- a/MdePkg/Library/BaseCpuLib/X64/CpuSleep.asm +++ /dev/null @@ -1,37 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuSleep.Asm -; -; Abstract: -; -; CpuSleep function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuSleep ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuSleep PROC - hlt - ret -CpuSleep ENDP - - END diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf b/Mde= Pkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf index 8844b1c..958a51a 100644 --- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf +++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf @@ -44,7 +44,6 @@ IoLibIcc.c | INTEL IoLib.c Ia32/IoFifo.nasm - Ia32/IoFifo.asm =20 [Sources.X64] IoLibGcc.c | GCC @@ -52,7 +51,6 @@ IoLibIcc.c | INTEL IoLib.c X64/IoFifo.nasm - X64/IoFifo.asm =20 [Sources.EBC] IoLibEbc.c diff --git a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.asm b/MdePkg/Lib= rary/BaseIoLibIntrinsic/Ia32/IoFifo.asm deleted file mode 100644 index da767d1..0000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.asm +++ /dev/null @@ -1,141 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-; -; This program and the accompanying materials are licensed and made availa= ble -; under the terms and conditions of the BSD License which accompanies this -; distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -;-------------------------------------------------------------------------= ----- - - .586P - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo8 PROC - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insb - pop edi - ret -IoReadFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo16 PROC - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insw - pop edi - ret -IoReadFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo32 PROC - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insd - pop edi - ret -IoReadFifo32 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo8 PROC - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsb - pop esi - ret -IoWriteFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo16 PROC - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsw - pop esi - ret -IoWriteFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo32 PROC - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsd - pop esi - ret -IoWriteFifo32 ENDP - - END - diff --git a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.asm b/MdePkg/Libr= ary/BaseIoLibIntrinsic/X64/IoFifo.asm deleted file mode 100644 index 87c6107..0000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.asm +++ /dev/null @@ -1,127 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-; -; This program and the accompanying materials are licensed and made availa= ble -; under the terms and conditions of the BSD License which accompanies this -; distribution. The full text of the license may be found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo8 PROC - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insb - mov rdi, r8 ; restore rdi - ret -IoReadFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo16 PROC - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insw - mov rdi, r8 ; restore rdi - ret -IoReadFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo32 PROC - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insd - mov rdi, r8 ; restore rdi - ret -IoReadFifo32 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo8 PROC - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsb - mov rsi, r8 ; restore rsi - ret -IoWriteFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo16 PROC - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsw - mov rsi, r8 ; restore rsi - ret -IoWriteFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo32 PROC - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsd - mov rsi, r8 ; restore rsi - ret -IoWriteFifo32 ENDP - - END - diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/Ba= seLib.inf index 5fbbd02..50283fa 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -148,7 +148,6 @@ Ia32/EnableInterrupts.c | MSFT=20 Ia32/EnableDisableInterrupts.c | MSFT=20 Ia32/DivU64x64Remainder.nasm| MSFT - Ia32/DivU64x64Remainder.asm | MSFT=20 Ia32/DivU64x32Remainder.c | MSFT=20 Ia32/DivU64x32.c | MSFT=20 Ia32/DisablePaging32.c | MSFT=20 @@ -159,200 +158,104 @@ Ia32/CpuBreakpoint.c | MSFT=20 Ia32/ARShiftU64.c | MSFT=20 Ia32/Thunk16.nasm | MSFT - Ia32/Thunk16.asm | MSFT Ia32/EnablePaging64.nasm| MSFT - Ia32/EnablePaging64.asm | MSFT Ia32/EnableCache.c | MSFT Ia32/DisableCache.c | MSFT Ia32/RdRand.nasm| MSFT - Ia32/RdRand.asm | MSFT =20 Ia32/Wbinvd.nasm| INTEL - Ia32/Wbinvd.asm | INTEL=20 Ia32/WriteMm7.nasm| INTEL - Ia32/WriteMm7.asm | INTEL=20 Ia32/WriteMm6.nasm| INTEL - Ia32/WriteMm6.asm | INTEL=20 Ia32/WriteMm5.nasm| INTEL - Ia32/WriteMm5.asm | INTEL=20 Ia32/WriteMm4.nasm| INTEL - Ia32/WriteMm4.asm | INTEL=20 Ia32/WriteMm3.nasm| INTEL - Ia32/WriteMm3.asm | INTEL=20 Ia32/WriteMm2.nasm| INTEL - Ia32/WriteMm2.asm | INTEL=20 Ia32/WriteMm1.nasm| INTEL - Ia32/WriteMm1.asm | INTEL=20 Ia32/WriteMm0.nasm| INTEL - Ia32/WriteMm0.asm | INTEL=20 Ia32/WriteLdtr.nasm| INTEL - Ia32/WriteLdtr.asm | INTEL=20 Ia32/WriteIdtr.nasm| INTEL - Ia32/WriteIdtr.asm | INTEL=20 Ia32/WriteGdtr.nasm| INTEL - Ia32/WriteGdtr.asm | INTEL=20 Ia32/WriteDr7.nasm| INTEL - Ia32/WriteDr7.asm | INTEL=20 Ia32/WriteDr6.nasm| INTEL - Ia32/WriteDr6.asm | INTEL=20 Ia32/WriteDr5.nasm| INTEL - Ia32/WriteDr5.asm | INTEL=20 Ia32/WriteDr4.nasm| INTEL - Ia32/WriteDr4.asm | INTEL=20 Ia32/WriteDr3.nasm| INTEL - Ia32/WriteDr3.asm | INTEL=20 Ia32/WriteDr2.nasm| INTEL - Ia32/WriteDr2.asm | INTEL=20 Ia32/WriteDr1.nasm| INTEL - Ia32/WriteDr1.asm | INTEL=20 Ia32/WriteDr0.nasm| INTEL - Ia32/WriteDr0.asm | INTEL=20 Ia32/WriteCr4.nasm| INTEL - Ia32/WriteCr4.asm | INTEL=20 Ia32/WriteCr3.nasm| INTEL - Ia32/WriteCr3.asm | INTEL=20 Ia32/WriteCr2.nasm| INTEL - Ia32/WriteCr2.asm | INTEL=20 Ia32/WriteCr0.nasm| INTEL - Ia32/WriteCr0.asm | INTEL=20 Ia32/WriteMsr64.nasm| INTEL - Ia32/WriteMsr64.asm | INTEL=20 Ia32/SwapBytes64.nasm| INTEL - Ia32/SwapBytes64.asm | INTEL=20 Ia32/SetJump.nasm| INTEL - Ia32/SetJump.asm | INTEL=20 Ia32/RRotU64.nasm| INTEL - Ia32/RRotU64.asm | INTEL=20 Ia32/RShiftU64.nasm| INTEL - Ia32/RShiftU64.asm | INTEL=20 Ia32/ReadPmc.nasm| INTEL - Ia32/ReadPmc.asm | INTEL=20 Ia32/ReadTsc.nasm| INTEL - Ia32/ReadTsc.asm | INTEL=20 Ia32/ReadLdtr.nasm| INTEL - Ia32/ReadLdtr.asm | INTEL=20 Ia32/ReadIdtr.nasm| INTEL - Ia32/ReadIdtr.asm | INTEL=20 Ia32/ReadGdtr.nasm| INTEL - Ia32/ReadGdtr.asm | INTEL=20 Ia32/ReadTr.nasm| INTEL - Ia32/ReadTr.asm | INTEL=20 Ia32/ReadSs.nasm| INTEL - Ia32/ReadSs.asm | INTEL=20 Ia32/ReadGs.nasm| INTEL - Ia32/ReadGs.asm | INTEL=20 Ia32/ReadFs.nasm| INTEL - Ia32/ReadFs.asm | INTEL=20 Ia32/ReadEs.nasm| INTEL - Ia32/ReadEs.asm | INTEL=20 Ia32/ReadDs.nasm| INTEL - Ia32/ReadDs.asm | INTEL=20 Ia32/ReadCs.nasm| INTEL - Ia32/ReadCs.asm | INTEL=20 Ia32/ReadMsr64.nasm| INTEL - Ia32/ReadMsr64.asm | INTEL=20 Ia32/ReadMm7.nasm| INTEL - Ia32/ReadMm7.asm | INTEL=20 Ia32/ReadMm6.nasm| INTEL - Ia32/ReadMm6.asm | INTEL=20 Ia32/ReadMm5.nasm| INTEL - Ia32/ReadMm5.asm | INTEL=20 Ia32/ReadMm4.nasm| INTEL - Ia32/ReadMm4.asm | INTEL=20 Ia32/ReadMm3.nasm| INTEL - Ia32/ReadMm3.asm | INTEL=20 Ia32/ReadMm2.nasm| INTEL - Ia32/ReadMm2.asm | INTEL=20 Ia32/ReadMm1.nasm| INTEL - Ia32/ReadMm1.asm | INTEL=20 Ia32/ReadMm0.nasm| INTEL - Ia32/ReadMm0.asm | INTEL=20 Ia32/ReadEflags.nasm| INTEL - Ia32/ReadEflags.asm | INTEL=20 Ia32/ReadDr7.nasm| INTEL - Ia32/ReadDr7.asm | INTEL=20 Ia32/ReadDr6.nasm| INTEL - Ia32/ReadDr6.asm | INTEL=20 Ia32/ReadDr5.nasm| INTEL - Ia32/ReadDr5.asm | INTEL=20 Ia32/ReadDr4.nasm| INTEL - Ia32/ReadDr4.asm | INTEL=20 Ia32/ReadDr3.nasm| INTEL - Ia32/ReadDr3.asm | INTEL=20 Ia32/ReadDr2.nasm| INTEL - Ia32/ReadDr2.asm | INTEL=20 Ia32/ReadDr1.nasm| INTEL - Ia32/ReadDr1.asm | INTEL=20 Ia32/ReadDr0.nasm| INTEL - Ia32/ReadDr0.asm | INTEL=20 Ia32/ReadCr4.nasm| INTEL - Ia32/ReadCr4.asm | INTEL=20 Ia32/ReadCr3.nasm| INTEL - Ia32/ReadCr3.asm | INTEL=20 Ia32/ReadCr2.nasm| INTEL - Ia32/ReadCr2.asm | INTEL=20 Ia32/ReadCr0.nasm| INTEL - Ia32/ReadCr0.asm | INTEL=20 Ia32/Mwait.nasm| INTEL - Ia32/Mwait.asm | INTEL=20 Ia32/Monitor.nasm| INTEL - Ia32/Monitor.asm | INTEL=20 Ia32/ModU64x32.nasm| INTEL - Ia32/ModU64x32.asm | INTEL=20 Ia32/MultU64x64.nasm| INTEL - Ia32/MultU64x64.asm | INTEL=20 Ia32/MultU64x32.nasm| INTEL - Ia32/MultU64x32.asm | INTEL=20 Ia32/LShiftU64.nasm| INTEL - Ia32/LShiftU64.asm | INTEL=20 Ia32/LRotU64.nasm| INTEL - Ia32/LRotU64.asm | INTEL=20 Ia32/LongJump.nasm| INTEL - Ia32/LongJump.asm | INTEL=20 Ia32/Invd.nasm| INTEL - Ia32/Invd.asm | INTEL=20 Ia32/FxRestore.nasm| INTEL - Ia32/FxRestore.asm | INTEL=20 Ia32/FxSave.nasm| INTEL - Ia32/FxSave.asm | INTEL=20 Ia32/FlushCacheLine.nasm| INTEL - Ia32/FlushCacheLine.asm | INTEL=20 Ia32/EnablePaging32.nasm| INTEL - Ia32/EnablePaging32.asm | INTEL=20 Ia32/EnableInterrupts.nasm| INTEL - Ia32/EnableInterrupts.asm | INTEL=20 Ia32/EnableDisableInterrupts.nasm| INTEL - Ia32/EnableDisableInterrupts.asm | INTEL=20 Ia32/DivU64x64Remainder.nasm| INTEL - Ia32/DivU64x64Remainder.asm | INTEL=20 Ia32/DivU64x32Remainder.nasm| INTEL - Ia32/DivU64x32Remainder.asm | INTEL=20 Ia32/DivU64x32.nasm| INTEL - Ia32/DivU64x32.asm | INTEL=20 Ia32/DisablePaging32.nasm| INTEL - Ia32/DisablePaging32.asm | INTEL Ia32/DisableInterrupts.nasm| INTEL - Ia32/DisableInterrupts.asm | INTEL=20 Ia32/CpuPause.nasm| INTEL - Ia32/CpuPause.asm | INTEL=20 Ia32/CpuIdEx.nasm| INTEL - Ia32/CpuIdEx.asm | INTEL=20 Ia32/CpuId.nasm| INTEL - Ia32/CpuId.asm | INTEL=20 Ia32/CpuBreakpoint.nasm| INTEL - Ia32/CpuBreakpoint.asm | INTEL=20 Ia32/ARShiftU64.nasm| INTEL - Ia32/ARShiftU64.asm | INTEL=20 Ia32/Thunk16.nasm | INTEL - Ia32/Thunk16.asm | INTEL Ia32/EnablePaging64.nasm| INTEL - Ia32/EnablePaging64.asm | INTEL Ia32/EnableCache.nasm| INTEL - Ia32/EnableCache.asm | INTEL Ia32/DisableCache.nasm| INTEL - Ia32/DisableCache.asm | INTEL Ia32/RdRand.nasm| INTEL - Ia32/RdRand.asm | INTEL =20 Ia32/GccInline.c | GCC Ia32/Thunk16.nasm | GCC=20 @@ -435,309 +338,160 @@ =20 [Sources.X64] X64/Thunk16.nasm - X64/Thunk16.asm X64/CpuIdEx.nasm - X64/CpuIdEx.asm X64/CpuId.nasm - X64/CpuId.asm X64/LongJump.nasm - X64/LongJump.asm X64/SetJump.nasm - X64/SetJump.asm X64/SwitchStack.nasm - X64/SwitchStack.asm X64/EnableCache.nasm - X64/EnableCache.asm X64/DisableCache.nasm - X64/DisableCache.asm X64/WriteTr.nasm =20 X64/CpuBreakpoint.c | MSFT=20 X64/WriteMsr64.c | MSFT=20 X64/ReadMsr64.c | MSFT=20 X64/RdRand.nasm| MSFT - X64/RdRand.asm | MSFT X64/CpuPause.nasm| MSFT - X64/CpuPause.asm | MSFT X64/EnableDisableInterrupts.nasm| MSFT - X64/EnableDisableInterrupts.asm | MSFT X64/DisableInterrupts.nasm| MSFT - X64/DisableInterrupts.asm | MSFT X64/EnableInterrupts.nasm| MSFT - X64/EnableInterrupts.asm | MSFT X64/FlushCacheLine.nasm| MSFT - X64/FlushCacheLine.asm | MSFT X64/Invd.nasm| MSFT - X64/Invd.asm | MSFT X64/Wbinvd.nasm| MSFT - X64/Wbinvd.asm | MSFT X64/DisablePaging64.nasm| MSFT - X64/DisablePaging64.asm | MSFT X64/Mwait.nasm| MSFT - X64/Mwait.asm | MSFT X64/Monitor.nasm| MSFT - X64/Monitor.asm | MSFT X64/ReadPmc.nasm| MSFT - X64/ReadPmc.asm | MSFT X64/ReadTsc.nasm| MSFT - X64/ReadTsc.asm | MSFT X64/WriteMm7.nasm| MSFT - X64/WriteMm7.asm | MSFT X64/WriteMm6.nasm| MSFT - X64/WriteMm6.asm | MSFT X64/WriteMm5.nasm| MSFT - X64/WriteMm5.asm | MSFT X64/WriteMm4.nasm| MSFT - X64/WriteMm4.asm | MSFT X64/WriteMm3.nasm| MSFT - X64/WriteMm3.asm | MSFT X64/WriteMm2.nasm| MSFT - X64/WriteMm2.asm | MSFT X64/WriteMm1.nasm| MSFT - X64/WriteMm1.asm | MSFT X64/WriteMm0.nasm| MSFT - X64/WriteMm0.asm | MSFT X64/ReadMm7.nasm| MSFT - X64/ReadMm7.asm | MSFT X64/ReadMm6.nasm| MSFT - X64/ReadMm6.asm | MSFT X64/ReadMm5.nasm| MSFT - X64/ReadMm5.asm | MSFT X64/ReadMm4.nasm| MSFT - X64/ReadMm4.asm | MSFT X64/ReadMm3.nasm| MSFT - X64/ReadMm3.asm | MSFT X64/ReadMm2.nasm| MSFT - X64/ReadMm2.asm | MSFT X64/ReadMm1.nasm| MSFT - X64/ReadMm1.asm | MSFT X64/ReadMm0.nasm| MSFT - X64/ReadMm0.asm | MSFT X64/FxRestore.nasm| MSFT - X64/FxRestore.asm | MSFT X64/FxSave.nasm| MSFT - X64/FxSave.asm | MSFT X64/WriteLdtr.nasm| MSFT - X64/WriteLdtr.asm | MSFT X64/ReadLdtr.nasm| MSFT - X64/ReadLdtr.asm | MSFT X64/WriteIdtr.nasm| MSFT - X64/WriteIdtr.asm | MSFT X64/ReadIdtr.nasm| MSFT - X64/ReadIdtr.asm | MSFT X64/WriteGdtr.nasm| MSFT - X64/WriteGdtr.asm | MSFT X64/ReadGdtr.nasm| MSFT - X64/ReadGdtr.asm | MSFT X64/ReadTr.nasm| MSFT - X64/ReadTr.asm | MSFT X64/ReadSs.nasm| MSFT - X64/ReadSs.asm | MSFT X64/ReadGs.nasm| MSFT - X64/ReadGs.asm | MSFT X64/ReadFs.nasm| MSFT - X64/ReadFs.asm | MSFT X64/ReadEs.nasm| MSFT - X64/ReadEs.asm | MSFT X64/ReadDs.nasm| MSFT - X64/ReadDs.asm | MSFT X64/ReadCs.nasm| MSFT - X64/ReadCs.asm | MSFT X64/WriteDr7.nasm| MSFT - X64/WriteDr7.asm | MSFT X64/WriteDr6.nasm| MSFT - X64/WriteDr6.asm | MSFT X64/WriteDr5.nasm| MSFT - X64/WriteDr5.asm | MSFT X64/WriteDr4.nasm| MSFT - X64/WriteDr4.asm | MSFT X64/WriteDr3.nasm| MSFT - X64/WriteDr3.asm | MSFT X64/WriteDr2.nasm| MSFT - X64/WriteDr2.asm | MSFT X64/WriteDr1.nasm| MSFT - X64/WriteDr1.asm | MSFT X64/WriteDr0.nasm| MSFT - X64/WriteDr0.asm | MSFT X64/ReadDr7.nasm| MSFT - X64/ReadDr7.asm | MSFT X64/ReadDr6.nasm| MSFT - X64/ReadDr6.asm | MSFT X64/ReadDr5.nasm| MSFT - X64/ReadDr5.asm | MSFT X64/ReadDr4.nasm| MSFT - X64/ReadDr4.asm | MSFT X64/ReadDr3.nasm| MSFT - X64/ReadDr3.asm | MSFT X64/ReadDr2.nasm| MSFT - X64/ReadDr2.asm | MSFT X64/ReadDr1.nasm| MSFT - X64/ReadDr1.asm | MSFT X64/ReadDr0.nasm| MSFT - X64/ReadDr0.asm | MSFT X64/WriteCr4.nasm| MSFT - X64/WriteCr4.asm | MSFT X64/WriteCr3.nasm| MSFT - X64/WriteCr3.asm | MSFT X64/WriteCr2.nasm| MSFT - X64/WriteCr2.asm | MSFT X64/WriteCr0.nasm| MSFT - X64/WriteCr0.asm | MSFT X64/ReadCr4.nasm| MSFT - X64/ReadCr4.asm | MSFT X64/ReadCr3.nasm| MSFT - X64/ReadCr3.asm | MSFT X64/ReadCr2.nasm| MSFT - X64/ReadCr2.asm | MSFT X64/ReadCr0.nasm| MSFT - X64/ReadCr0.asm | MSFT X64/ReadEflags.nasm| MSFT - X64/ReadEflags.asm | MSFT =20 X64/CpuBreakpoint.nasm| INTEL - X64/CpuBreakpoint.asm | INTEL=20 X64/WriteMsr64.nasm| INTEL - X64/WriteMsr64.asm | INTEL=20 X64/ReadMsr64.nasm| INTEL - X64/ReadMsr64.asm | INTEL=20 X64/RdRand.nasm| INTEL - X64/RdRand.asm | INTEL X64/CpuPause.nasm| INTEL - X64/CpuPause.asm | INTEL X64/EnableDisableInterrupts.nasm| INTEL - X64/EnableDisableInterrupts.asm | INTEL X64/DisableInterrupts.nasm| INTEL - X64/DisableInterrupts.asm | INTEL X64/EnableInterrupts.nasm| INTEL - X64/EnableInterrupts.asm | INTEL X64/FlushCacheLine.nasm| INTEL - X64/FlushCacheLine.asm | INTEL X64/Invd.nasm| INTEL - X64/Invd.asm | INTEL X64/Wbinvd.nasm| INTEL - X64/Wbinvd.asm | INTEL X64/DisablePaging64.nasm| INTEL - X64/DisablePaging64.asm | INTEL X64/Mwait.nasm| INTEL - X64/Mwait.asm | INTEL X64/Monitor.nasm| INTEL - X64/Monitor.asm | INTEL X64/ReadPmc.nasm| INTEL - X64/ReadPmc.asm | INTEL X64/ReadTsc.nasm| INTEL - X64/ReadTsc.asm | INTEL X64/WriteMm7.nasm| INTEL - X64/WriteMm7.asm | INTEL X64/WriteMm6.nasm| INTEL - X64/WriteMm6.asm | INTEL X64/WriteMm5.nasm| INTEL - X64/WriteMm5.asm | INTEL X64/WriteMm4.nasm| INTEL - X64/WriteMm4.asm | INTEL X64/WriteMm3.nasm| INTEL - X64/WriteMm3.asm | INTEL X64/WriteMm2.nasm| INTEL - X64/WriteMm2.asm | INTEL X64/WriteMm1.nasm| INTEL - X64/WriteMm1.asm | INTEL X64/WriteMm0.nasm| INTEL - X64/WriteMm0.asm | INTEL X64/ReadMm7.nasm| INTEL - X64/ReadMm7.asm | INTEL X64/ReadMm6.nasm| INTEL - X64/ReadMm6.asm | INTEL X64/ReadMm5.nasm| INTEL - X64/ReadMm5.asm | INTEL X64/ReadMm4.nasm| INTEL - X64/ReadMm4.asm | INTEL X64/ReadMm3.nasm| INTEL - X64/ReadMm3.asm | INTEL X64/ReadMm2.nasm| INTEL - X64/ReadMm2.asm | INTEL X64/ReadMm1.nasm| INTEL - X64/ReadMm1.asm | INTEL X64/ReadMm0.nasm| INTEL - X64/ReadMm0.asm | INTEL X64/FxRestore.nasm| INTEL - X64/FxRestore.asm | INTEL X64/FxSave.nasm| INTEL - X64/FxSave.asm | INTEL X64/WriteLdtr.nasm| INTEL - X64/WriteLdtr.asm | INTEL X64/ReadLdtr.nasm| INTEL - X64/ReadLdtr.asm | INTEL X64/WriteIdtr.nasm| INTEL - X64/WriteIdtr.asm | INTEL X64/ReadIdtr.nasm| INTEL - X64/ReadIdtr.asm | INTEL X64/WriteGdtr.nasm| INTEL - X64/WriteGdtr.asm | INTEL X64/ReadGdtr.nasm| INTEL - X64/ReadGdtr.asm | INTEL X64/ReadTr.nasm| INTEL - X64/ReadTr.asm | INTEL X64/ReadSs.nasm| INTEL - X64/ReadSs.asm | INTEL X64/ReadGs.nasm| INTEL - X64/ReadGs.asm | INTEL X64/ReadFs.nasm| INTEL - X64/ReadFs.asm | INTEL X64/ReadEs.nasm| INTEL - X64/ReadEs.asm | INTEL X64/ReadDs.nasm| INTEL - X64/ReadDs.asm | INTEL X64/ReadCs.nasm| INTEL - X64/ReadCs.asm | INTEL X64/WriteDr7.nasm| INTEL - X64/WriteDr7.asm | INTEL X64/WriteDr6.nasm| INTEL - X64/WriteDr6.asm | INTEL X64/WriteDr5.nasm| INTEL - X64/WriteDr5.asm | INTEL X64/WriteDr4.nasm| INTEL - X64/WriteDr4.asm | INTEL X64/WriteDr3.nasm| INTEL - X64/WriteDr3.asm | INTEL X64/WriteDr2.nasm| INTEL - X64/WriteDr2.asm | INTEL X64/WriteDr1.nasm| INTEL - X64/WriteDr1.asm | INTEL X64/WriteDr0.nasm| INTEL - X64/WriteDr0.asm | INTEL X64/ReadDr7.nasm| INTEL - X64/ReadDr7.asm | INTEL X64/ReadDr6.nasm| INTEL - X64/ReadDr6.asm | INTEL X64/ReadDr5.nasm| INTEL - X64/ReadDr5.asm | INTEL X64/ReadDr4.nasm| INTEL - X64/ReadDr4.asm | INTEL X64/ReadDr3.nasm| INTEL - X64/ReadDr3.asm | INTEL X64/ReadDr2.nasm| INTEL - X64/ReadDr2.asm | INTEL X64/ReadDr1.nasm| INTEL - X64/ReadDr1.asm | INTEL X64/ReadDr0.nasm| INTEL - X64/ReadDr0.asm | INTEL X64/WriteCr4.nasm| INTEL - X64/WriteCr4.asm | INTEL X64/WriteCr3.nasm| INTEL - X64/WriteCr3.asm | INTEL X64/WriteCr2.nasm| INTEL - X64/WriteCr2.asm | INTEL X64/WriteCr0.nasm| INTEL - X64/WriteCr0.asm | INTEL X64/ReadCr4.nasm| INTEL - X64/ReadCr4.asm | INTEL X64/ReadCr3.nasm| INTEL - X64/ReadCr3.asm | INTEL X64/ReadCr2.nasm| INTEL - X64/ReadCr2.asm | INTEL X64/ReadCr0.nasm| INTEL - X64/ReadCr0.asm | INTEL X64/ReadEflags.nasm| INTEL - X64/ReadEflags.asm | INTEL =20 X64/Non-existing.c Math64.c diff --git a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.asm b/MdePkg/Library/Ba= seLib/Ia32/ARShiftU64.asm deleted file mode 100644 index 10f04c3..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.asm +++ /dev/null @@ -1,48 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ARShiftU64.asm -; -; Abstract: -; -; 64-bit arithmetic right shift function for IA-32 -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathARShiftU64 ( -; IN UINT64 Operand, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMathARShiftU64 PROC - mov cl, [esp + 12] - mov eax, [esp + 8] - cdq - test cl, 32 - jnz @F - mov edx, eax - mov eax, [esp + 4] -@@: =20 - shrd eax, edx, cl - sar edx, cl - ret -InternalMathARShiftU64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.asm b/MdePkg/Library= /BaseLib/Ia32/CpuBreakpoint.asm deleted file mode 100644 index ab7c2cf..0000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuBreakpoint.Asm -; -; Abstract: -; -; CpuBreakpoint function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuBreakpoint ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuBreakpoint PROC - int 3 - ret -CpuBreakpoint ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/CpuId.asm b/MdePkg/Library/BaseLib= /Ia32/CpuId.asm deleted file mode 100644 index a1a01c0..0000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuId.asm +++ /dev/null @@ -1,66 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuId.Asm -; -; Abstract: -; -; AsmCpuid function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586P - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmCpuid ( -; IN UINT32 RegisterInEax, -; OUT UINT32 *RegisterOutEax OPTIONAL, -; OUT UINT32 *RegisterOutEbx OPTIONAL, -; OUT UINT32 *RegisterOutEcx OPTIONAL, -; OUT UINT32 *RegisterOutEdx OPTIONAL -; ); -;-------------------------------------------------------------------------= ----- -AsmCpuid PROC USES ebx - push ebp - mov ebp, esp - mov eax, [ebp + 12] - cpuid - push ecx - mov ecx, [ebp + 16] - jecxz @F - mov [ecx], eax -@@: - mov ecx, [ebp + 20] - jecxz @F - mov [ecx], ebx -@@: - mov ecx, [ebp + 24] - jecxz @F - pop DWORD [ecx] -@@: - mov ecx, [ebp + 28] - jecxz @F - mov [ecx], edx -@@: - mov eax, [ebp + 12] - leave - ret -AsmCpuid ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm b/MdePkg/Library/BaseL= ib/Ia32/CpuIdEx.asm deleted file mode 100644 index 9cca11b..0000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm +++ /dev/null @@ -1,68 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuIdEx.Asm -; -; Abstract: -; -; AsmCpuidEx function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; AsmCpuidEx ( -; IN UINT32 RegisterInEax, -; IN UINT32 RegisterInEcx, -; OUT UINT32 *RegisterOutEax OPTIONAL, -; OUT UINT32 *RegisterOutEbx OPTIONAL, -; OUT UINT32 *RegisterOutEcx OPTIONAL, -; OUT UINT32 *RegisterOutEdx OPTIONAL -; ) -;-------------------------------------------------------------------------= ----- -AsmCpuidEx PROC USES ebx - push ebp - mov ebp, esp - mov eax, [ebp + 12] - mov ecx, [ebp + 16] - cpuid - push ecx - mov ecx, [ebp + 20] - jecxz @F - mov [ecx], eax -@@: - mov ecx, [ebp + 24] - jecxz @F - mov [ecx], ebx -@@: - mov ecx, [ebp + 32] - jecxz @F - mov [ecx], edx -@@: - mov ecx, [ebp + 28] - jecxz @F - pop DWORD [ecx] -@@: - mov eax, [ebp + 12] - leave - ret -AsmCpuidEx ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/CpuPause.asm b/MdePkg/Library/Base= Lib/Ia32/CpuPause.asm deleted file mode 100644 index 7a5aef5..0000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuPause.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuPause.Asm -; -; Abstract: -; -; CpuPause function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuPause ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuPause PROC - pause - ret -CpuPause ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/DisableCache.asm b/MdePkg/Library/= BaseLib/Ia32/DisableCache.asm deleted file mode 100644 index 1d1c9e0..0000000 --- a/MdePkg/Library/BaseLib/Ia32/DisableCache.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DisableCache.Asm -; -; Abstract: -; -; Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush al= l caches with a -; WBINVD instruction. -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .486p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmDisableCache ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmDisableCache PROC - mov eax, cr0 - bts eax, 30 - btr eax, 29 - mov cr0, eax - wbinvd - ret -AsmDisableCache ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.asm b/MdePkg/Lib= rary/BaseLib/Ia32/DisableInterrupts.asm deleted file mode 100644 index 823d0dd..0000000 --- a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DisableInterrupts.Asm -; -; Abstract: -; -; DisableInterrupts function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; DisableInterrupts ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -DisableInterrupts PROC - cli - ret -DisableInterrupts ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.asm b/MdePkg/Libra= ry/BaseLib/Ia32/DisablePaging32.asm deleted file mode 100644 index 5a3887e..0000000 --- a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.asm +++ /dev/null @@ -1,57 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DisablePaging32.Asm -; -; Abstract: -; -; AsmDisablePaging32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86DisablePaging32 ( -; IN SWITCH_STACK_ENTRY_POINT EntryPoint, -; IN VOID *Context1, OPTIONAL -; IN VOID *Context2, OPTIONAL -; IN VOID *NewStack -; ); -;-------------------------------------------------------------------------= ----- -InternalX86DisablePaging32 PROC - mov ebx, [esp + 4] - mov ecx, [esp + 8] - mov edx, [esp + 12] - pushfd - pop edi ; save EFLAGS to edi - cli - mov eax, cr0 - btr eax, 31 - mov esp, [esp + 16] - mov cr0, eax - push edi - popfd ; restore EFLAGS from edi - push edx - push ecx - call ebx - jmp $ ; EntryPoint() should not return -InternalX86DisablePaging32 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32.asm b/MdePkg/Library/Bas= eLib/Ia32/DivU64x32.asm deleted file mode 100644 index b479383..0000000 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x32.asm +++ /dev/null @@ -1,46 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DivU64x32.asm -; -; Abstract: -; -; Calculate the quotient of a 64-bit integer by a 32-bit integer -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathDivU64x32 ( -; IN UINT64 Dividend, -; IN UINT32 Divisor -; ); -;-------------------------------------------------------------------------= ----- -InternalMathDivU64x32 PROC - mov eax, [esp + 8] - mov ecx, [esp + 12] - xor edx, edx - div ecx - push eax ; save quotient on stack - mov eax, [esp + 8] - div ecx - pop edx ; restore high-order dword of the quot= ient - ret -InternalMathDivU64x32 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm b/MdePkg/Li= brary/BaseLib/Ia32/DivU64x32Remainder.asm deleted file mode 100644 index 30b0417..0000000 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm +++ /dev/null @@ -1,51 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DivError.asm -; -; Abstract: -; -; Set error flag for all division functions -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathDivRemU64x32 ( -; IN UINT64 Dividend, -; IN UINT32 Divisor, -; OUT UINT32 *Remainder -; ); -;-------------------------------------------------------------------------= ----- -InternalMathDivRemU64x32 PROC - mov ecx, [esp + 12] ; ecx <- divisor - mov eax, [esp + 8] ; eax <- dividend[32..63] - xor edx, edx - div ecx ; eax <- quotient[32..63], edx <- rema= inder - push eax - mov eax, [esp + 8] ; eax <- dividend[0..31] - div ecx ; eax <- quotient[0..31] - mov ecx, [esp + 20] ; ecx <- Remainder - jecxz @F ; abandon remainder if Remainder =3D= =3D NULL - mov [ecx], edx -@@: - pop edx ; edx <- quotient[32..63] - ret -InternalMathDivRemU64x32 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.asm b/MdePkg/Li= brary/BaseLib/Ia32/DivU64x64Remainder.asm deleted file mode 100644 index 44e2271..0000000 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.asm +++ /dev/null @@ -1,92 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DivU64x64Remainder.asm -; -; Abstract: -; -; Calculate the quotient of a 64-bit integer by a 64-bit integer and ret= urns -; both the quotient and the remainder -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -EXTERN InternalMathDivRemU64x32:PROC - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathDivRemU64x64 ( -; IN UINT64 Dividend, -; IN UINT64 Divisor, -; OUT UINT64 *Remainder OPTIONAL -; ); -;-------------------------------------------------------------------------= ----- -InternalMathDivRemU64x64 PROC - mov ecx, [esp + 16] ; ecx <- divisor[32..63] - test ecx, ecx - jnz _@DivRemU64x64 ; call _@DivRemU64x64 if Divisor >= 2^32 - mov ecx, [esp + 20] - jecxz @F - and dword ptr [ecx + 4], 0 ; zero high dword of remainder - mov [esp + 16], ecx ; set up stack frame to match DivR= emU64x32 -@@: - jmp InternalMathDivRemU64x32 -InternalMathDivRemU64x64 ENDP - -_@DivRemU64x64 PROC PRIVATE USES ebx esi edi - mov edx, dword ptr [esp + 20] - mov eax, dword ptr [esp + 16] ; edx:eax <- dividend - mov edi, edx - mov esi, eax ; edi:esi <- dividend - mov ebx, dword ptr [esp + 24] ; ecx:ebx <- divisor -@@: - shr edx, 1 - rcr eax, 1 - shrd ebx, ecx, 1 - shr ecx, 1 - jnz @B - div ebx - mov ebx, eax ; ebx <- quotient - mov ecx, [esp + 28] ; ecx <- high dword of divisor - mul dword ptr [esp + 24] ; edx:eax <- quotient * divisor[0.= .31] - imul ecx, ebx ; ecx <- quotient * divisor[32..63] - add edx, ecx ; edx <- (quotient * divisor)[32..= 63] - mov ecx, dword ptr [esp + 32] ; ecx <- addr for Remainder - jc @TooLarge ; product > 2^64 - cmp edi, edx ; compare high 32 bits - ja @Correct - jb @TooLarge ; product > dividend - cmp esi, eax - jae @Correct ; product <=3D dividend -@TooLarge: - dec ebx ; adjust quotient by -1 - jecxz @Return ; return if Remainder =3D=3D NULL - sub eax, dword ptr [esp + 24] - sbb edx, dword ptr [esp + 28] ; edx:eax <- (quotient - 1) * divi= sor -@Correct: - jecxz @Return - sub esi, eax - sbb edi, edx ; edi:esi <- remainder - mov [ecx], esi - mov [ecx + 4], edi -@Return: - mov eax, ebx ; eax <- quotient - xor edx, edx ; quotient is 32 bits long - ret -_@DivRemU64x64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/EnableCache.asm b/MdePkg/Library/B= aseLib/Ia32/EnableCache.asm deleted file mode 100644 index 238431c..0000000 --- a/MdePkg/Library/BaseLib/Ia32/EnableCache.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnableCache.Asm -; -; Abstract: -; -; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to = 0, and clear=20 -; the NW bit of CR0 to 0 -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .486p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmEnableCache ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmEnableCache PROC - wbinvd - mov eax, cr0 - btr eax, 29 - btr eax, 30 - mov cr0, eax - ret -AsmEnableCache ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.asm b/MdeP= kg/Library/BaseLib/Ia32/EnableDisableInterrupts.asm deleted file mode 100644 index f108864..0000000 --- a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnableDisableInterrupts.Asm -; -; Abstract: -; -; EnableDisableInterrupts function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; EnableDisableInterrupts ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -EnableDisableInterrupts PROC - sti - cli - ret -EnableDisableInterrupts ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.asm b/MdePkg/Libr= ary/BaseLib/Ia32/EnableInterrupts.asm deleted file mode 100644 index b43d451..0000000 --- a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnableInterrupts.Asm -; -; Abstract: -; -; EnableInterrupts function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; EnableInterrupts ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -EnableInterrupts PROC - sti - ret -EnableInterrupts ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.asm b/MdePkg/Librar= y/BaseLib/Ia32/EnablePaging32.asm deleted file mode 100644 index e8db4b2..0000000 --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.asm +++ /dev/null @@ -1,57 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnablePaging32.Asm -; -; Abstract: -; -; AsmEnablePaging32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86EnablePaging32 ( -; IN SWITCH_STACK_ENTRY_POINT EntryPoint, -; IN VOID *Context1, OPTIONAL -; IN VOID *Context2, OPTIONAL -; IN VOID *NewStack -; ); -;-------------------------------------------------------------------------= ----- -InternalX86EnablePaging32 PROC - mov ebx, [esp + 4] - mov ecx, [esp + 8] - mov edx, [esp + 12] - pushfd - pop edi ; save flags in edi - cli - mov eax, cr0 - bts eax, 31 - mov esp, [esp + 16] - mov cr0, eax - push edi - popfd ; restore flags - push edx - push ecx - call ebx - jmp $ -InternalX86EnablePaging32 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm b/MdePkg/Librar= y/BaseLib/Ia32/EnablePaging64.asm deleted file mode 100644 index 9ad3404..0000000 --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm +++ /dev/null @@ -1,68 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnablePaging64.Asm -; -; Abstract: -; -; AsmEnablePaging64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86EnablePaging64 ( -; IN UINT16 Cs, -; IN UINT64 EntryPoint, -; IN UINT64 Context1, OPTIONAL -; IN UINT64 Context2, OPTIONAL -; IN UINT64 NewStack -; ); -;-------------------------------------------------------------------------= ----- -InternalX86EnablePaging64 PROC - cli - mov DWORD PTR [esp], @F ; offset for far retf, seg is the = 1st arg - mov eax, cr4 - or al, (1 SHL 5) - mov cr4, eax ; enable PAE - mov ecx, 0c0000080h - rdmsr - or ah, 1 ; set LME - wrmsr - mov eax, cr0 - bts eax, 31 ; set PG - mov cr0, eax ; enable paging - retf ; topmost 2 dwords hold the address -@@: ; long mode starts here - DB 67h, 48h ; 32-bit address size, 64-bit oper= and size - mov ebx, [esp] ; mov rbx, [esp] - DB 67h, 48h - mov ecx, [esp + 8] ; mov rcx, [esp + 8] - DB 67h, 48h - mov edx, [esp + 10h] ; mov rdx, [esp + 10h] - DB 67h, 48h - mov esp, [esp + 18h] ; mov rsp, [esp + 18h] - DB 48h - add esp, -20h ; add rsp, -20h - call ebx ; call rbx - hlt ; no one should get here -InternalX86EnablePaging64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm b/MdePkg/Librar= y/BaseLib/Ia32/FlushCacheLine.asm deleted file mode 100644 index 1979f6d..0000000 --- a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; FlushCacheLine.Asm -; -; Abstract: -; -; AsmFlushCacheLine function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586P - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; AsmFlushCacheLine ( -; IN VOID *LinearAddress -; ); -;-------------------------------------------------------------------------= ----- -AsmFlushCacheLine PROC - ; - ; If the CPU does not support CLFLUSH instruction,=20 - ; then promote flush range to flush entire cache. - ; - mov eax, 1 - push ebx - cpuid - pop ebx - mov eax, [esp + 4] - test edx, BIT19 - jz @F - clflush [eax] - ret -@@: - wbinvd - ret -AsmFlushCacheLine ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/FxRestore.asm b/MdePkg/Library/Bas= eLib/Ia32/FxRestore.asm deleted file mode 100644 index 5b773d6..0000000 --- a/MdePkg/Library/BaseLib/Ia32/FxRestore.asm +++ /dev/null @@ -1,42 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; FxRestore.Asm -; -; Abstract: -; -; AsmFxRestore function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86FxRestore ( -; IN CONST IA32_FX_BUFFER *Buffer -; ); -;-------------------------------------------------------------------------= ----- -InternalX86FxRestore PROC - mov eax, [esp + 4] ; Buffer must be 16-byte aligned - fxrstor [eax] - ret -InternalX86FxRestore ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/FxSave.asm b/MdePkg/Library/BaseLi= b/Ia32/FxSave.asm deleted file mode 100644 index 417106a..0000000 --- a/MdePkg/Library/BaseLib/Ia32/FxSave.asm +++ /dev/null @@ -1,42 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; FxSave.Asm -; -; Abstract: -; -; AsmFxSave function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86FxSave ( -; OUT IA32_FX_BUFFER *Buffer -; ); -;-------------------------------------------------------------------------= ----- -InternalX86FxSave PROC - mov eax, [esp + 4] ; Buffer must be 16-byte aligned - fxsave [eax] - ret -InternalX86FxSave ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/Invd.asm b/MdePkg/Library/BaseLib/= Ia32/Invd.asm deleted file mode 100644 index a34e217..0000000 --- a/MdePkg/Library/BaseLib/Ia32/Invd.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Invd.Asm -; -; Abstract: -; -; AsmInvd function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .486p - .model flat - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmInvd ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmInvd PROC - invd - ret -AsmInvd ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/LRotU64.asm b/MdePkg/Library/BaseL= ib/Ia32/LRotU64.asm deleted file mode 100644 index 9e6a94e..0000000 --- a/MdePkg/Library/BaseLib/Ia32/LRotU64.asm +++ /dev/null @@ -1,51 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; LRotU64.asm -; -; Abstract: -; -; 64-bit left rotation for Ia32 -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathLRotU64 ( -; IN UINT64 Operand, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMathLRotU64 PROC USES ebx - mov cl, [esp + 16] - mov edx, [esp + 12] - mov eax, [esp + 8] - shld ebx, edx, cl - shld edx, eax, cl - ror ebx, cl - shld eax, ebx, cl - test cl, 32 ; Count >=3D 32? - jz @F - mov ecx, eax - mov eax, edx - mov edx, ecx -@@: =20 - ret -InternalMathLRotU64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/LShiftU64.asm b/MdePkg/Library/Bas= eLib/Ia32/LShiftU64.asm deleted file mode 100644 index 15b7242..0000000 --- a/MdePkg/Library/BaseLib/Ia32/LShiftU64.asm +++ /dev/null @@ -1,48 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; LShiftU64.asm -; -; Abstract: -; -; 64-bit left shift function for IA-32 -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathLShiftU64 ( -; IN UINT64 Operand, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMathLShiftU64 PROC - mov cl, [esp + 12] - xor eax, eax - mov edx, [esp + 4] - test cl, 32 ; Count >=3D 32? - jnz @F - mov eax, edx - mov edx, [esp + 8] -@@: =20 - shld edx, eax, cl - shl eax, cl - ret -InternalMathLShiftU64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.asm b/MdePkg/Library/Base= Lib/Ia32/LongJump.asm deleted file mode 100644 index d1f1d77..0000000 --- a/MdePkg/Library/BaseLib/Ia32/LongJump.asm +++ /dev/null @@ -1,46 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; LongJump.Asm -; -; Abstract: -; -; Implementation of _LongJump() on IA-32. -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalLongJump ( -; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -InternalLongJump PROC - pop eax ; skip return address - pop edx ; edx <- JumpBuffer - pop eax ; eax <- Value - mov ebx, [edx] - mov esi, [edx + 4] - mov edi, [edx + 8] - mov ebp, [edx + 12] - mov esp, [edx + 16] - jmp dword ptr [edx + 20] ; restore "eip" -InternalLongJump ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ModU64x32.asm b/MdePkg/Library/Bas= eLib/Ia32/ModU64x32.asm deleted file mode 100644 index a910fd3..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ModU64x32.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DivU64x32.asm -; -; Abstract: -; -; Calculate the remainder of a 64-bit integer by a 32-bit integer -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; InternalMathModU64x32 ( -; IN UINT64 Dividend, -; IN UINT32 Divisor -; ); -;-------------------------------------------------------------------------= ----- -InternalMathModU64x32 PROC - mov eax, [esp + 8] - mov ecx, [esp + 12] - xor edx, edx - div ecx - mov eax, [esp + 4] - div ecx - mov eax, edx - ret -InternalMathModU64x32 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/Monitor.asm b/MdePkg/Library/BaseL= ib/Ia32/Monitor.asm deleted file mode 100644 index a8f8612..0000000 --- a/MdePkg/Library/BaseLib/Ia32/Monitor.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Monitor.Asm -; -; Abstract: -; -; AsmMonitor function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmMonitor ( -; IN UINTN Eax, -; IN UINTN Ecx, -; IN UINTN Edx -; ); -;-------------------------------------------------------------------------= ----- -AsmMonitor PROC - mov eax, [esp + 4] - mov ecx, [esp + 8] - mov edx, [esp + 12] - DB 0fh, 1, 0c8h ; monitor - ret -AsmMonitor ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x32.asm b/MdePkg/Library/Ba= seLib/Ia32/MultU64x32.asm deleted file mode 100644 index 9648d65..0000000 --- a/MdePkg/Library/BaseLib/Ia32/MultU64x32.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; MultU64x32.asm -; -; Abstract: -; -; Calculate the product of a 64-bit integer and a 32-bit integer -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathMultU64x32 ( -; IN UINT64 Multiplicand, -; IN UINT32 Multiplier -; ); -;-------------------------------------------------------------------------= ----- -InternalMathMultU64x32 PROC - mov ecx, [esp + 12] - mov eax, ecx - imul ecx, [esp + 8] ; overflow not detectable - mul dword ptr [esp + 4] - add edx, ecx - ret -InternalMathMultU64x32 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x64.asm b/MdePkg/Library/Ba= seLib/Ia32/MultU64x64.asm deleted file mode 100644 index 061301f..0000000 --- a/MdePkg/Library/BaseLib/Ia32/MultU64x64.asm +++ /dev/null @@ -1,47 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; MultU64x64.asm -; -; Abstract: -; -; Calculate the product of a 64-bit integer and another 64-bit integer -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathMultU64x64 ( -; IN UINT64 Multiplicand, -; IN UINT64 Multiplier -; ); -;-------------------------------------------------------------------------= ----- -InternalMathMultU64x64 PROC USES ebx - mov ebx, [esp + 8] ; ebx <- M1[0..31] - mov edx, [esp + 16] ; edx <- M2[0..31] - mov ecx, ebx - mov eax, edx - imul ebx, [esp + 20] ; ebx <- M1[0..31] * M2[32..63] - imul edx, [esp + 12] ; edx <- M1[32..63] * M2[0..31] - add ebx, edx ; carries are abandoned - mul ecx ; edx:eax <- M1[0..31] * M2[0..31] - add edx, ebx ; carries are abandoned - ret -InternalMathMultU64x64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/Mwait.asm b/MdePkg/Library/BaseLib= /Ia32/Mwait.asm deleted file mode 100644 index 3ae3085..0000000 --- a/MdePkg/Library/BaseLib/Ia32/Mwait.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Mwait.Asm -; -; Abstract: -; -; AsmMwait function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmMwait ( -; IN UINTN Eax, -; IN UINTN Ecx -; ); -;-------------------------------------------------------------------------= ----- -AsmMwait PROC - mov eax, [esp + 4] - mov ecx, [esp + 8] - DB 0fh, 1, 0c9h ; mwait - ret -AsmMwait ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/RRotU64.asm b/MdePkg/Library/BaseL= ib/Ia32/RRotU64.asm deleted file mode 100644 index 6afb0cc..0000000 --- a/MdePkg/Library/BaseLib/Ia32/RRotU64.asm +++ /dev/null @@ -1,51 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; RRotU64.asm -; -; Abstract: -; -; 64-bit right rotation for Ia32 -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathRRotU64 ( -; IN UINT64 Operand, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMathRRotU64 PROC USES ebx - mov cl, [esp + 16] - mov eax, [esp + 8] - mov edx, [esp + 12] - shrd ebx, eax, cl - shrd eax, edx, cl - rol ebx, cl - shrd edx, ebx, cl - test cl, 32 ; Count >=3D 32? - jz @F - mov ecx, eax ; switch eax & edx if Count >=3D 32 - mov eax, edx - mov edx, ecx -@@: =20 - ret -InternalMathRRotU64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/RShiftU64.asm b/MdePkg/Library/Bas= eLib/Ia32/RShiftU64.asm deleted file mode 100644 index 94f7046..0000000 --- a/MdePkg/Library/BaseLib/Ia32/RShiftU64.asm +++ /dev/null @@ -1,48 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; RShiftU64.asm -; -; Abstract: -; -; 64-bit logical right shift function for IA-32 -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathRShiftU64 ( -; IN UINT64 Operand, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMathRShiftU64 PROC - mov cl, [esp + 12] ; cl <- Count - xor edx, edx - mov eax, [esp + 8] - test cl, 32 ; Count >=3D 32? - jnz @F - mov edx, eax - mov eax, [esp + 4] -@@: =20 - shrd eax, edx, cl - shr edx, cl - ret -InternalMathRShiftU64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/RdRand.asm b/MdePkg/Library/BaseLi= b/Ia32/RdRand.asm deleted file mode 100644 index cb4e811..0000000 --- a/MdePkg/Library/BaseLib/Ia32/RdRand.asm +++ /dev/null @@ -1,94 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; RdRand.asm -; -; Abstract: -; -; Generates random number through CPU RdRand instruction under 32-bit pl= atform. -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - -.686P -.model flat, C - -.code - -;-------------------------------------------------------------------------= ----- -; Generates a 16 bit random number through RDRAND instruction. -; Return TRUE if Rand generated successfully, or FALSE if not. -; -; BOOLEAN EFIAPI InternalX86RdRand16 (UINT16 *Rand); -;-------------------------------------------------------------------------= ----- -InternalX86RdRand16 PROC - ; rdrand ax ; generate a 16 bit RN into ax - ; CF=3D1 if RN generated ok, otherwise = CF=3D0 - db 0fh, 0c7h, 0f0h ; rdrand r16: "0f c7 /6 ModRM:r/m(w)" - jc rn16_ok ; jmp if CF=3D1 - xor eax, eax ; reg=3D0 if CF=3D0 - ret ; return with failure status -rn16_ok: - mov edx, dword ptr [esp + 4] - mov [edx], ax - mov eax, 1 - ret -InternalX86RdRand16 ENDP - -;-------------------------------------------------------------------------= ----- -; Generates a 32 bit random number through RDRAND instruction. -; Return TRUE if Rand generated successfully, or FALSE if not. -; -; BOOLEAN EFIAPI InternalX86RdRand32 (UINT32 *Rand); -;-------------------------------------------------------------------------= ----- -InternalX86RdRand32 PROC - ; rdrand eax ; generate a 32 bit RN into eax - ; CF=3D1 if RN generated ok, otherwise = CF=3D0 - db 0fh, 0c7h, 0f0h ; rdrand r32: "0f c7 /6 ModRM:r/m(w)" - jc rn32_ok ; jmp if CF=3D1 - xor eax, eax ; reg=3D0 if CF=3D0 - ret ; return with failure status -rn32_ok: - mov edx, dword ptr [esp + 4] - mov [edx], eax - mov eax, 1 - ret -InternalX86RdRand32 ENDP - -;-------------------------------------------------------------------------= ----- -; Generates a 64 bit random number through RDRAND instruction. -; Return TRUE if Rand generated successfully, or FALSE if not. -; -; BOOLEAN EFIAPI InternalX86RdRand64 (UINT64 *Rand); -;-------------------------------------------------------------------------= ----- -InternalX86RdRand64 PROC - ; rdrand eax ; generate a 32 bit RN into eax - ; CF=3D1 if RN generated ok, otherwise = CF=3D0 - db 0fh, 0c7h, 0f0h ; rdrand r32: "0f c7 /6 ModRM:r/m(w)" - jnc rn64_ret ; jmp if CF=3D0 - mov edx, dword ptr [esp + 4] - mov [edx], eax - - db 0fh, 0c7h, 0f0h ; generate another 32 bit RN - jnc rn64_ret ; jmp if CF=3D0 - mov [edx + 4], eax - - mov eax, 1 - ret -rn64_ret: - xor eax, eax - ret ; return with failure status -InternalX86RdRand64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr0.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadCr0.asm deleted file mode 100644 index 13d0920..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr0.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr0.Asm -; -; Abstract: -; -; AsmReadCr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr0 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr0 PROC - mov eax, cr0 - ret -AsmReadCr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr2.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadCr2.asm deleted file mode 100644 index 7a267d4..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr2.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr2.Asm -; -; Abstract: -; -; AsmReadCr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr2 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr2 PROC - mov eax, cr2 - ret -AsmReadCr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr3.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadCr3.asm deleted file mode 100644 index d4ba412..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr3.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr3.Asm -; -; Abstract: -; -; AsmReadCr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr3 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr3 PROC - mov eax, cr3 - ret -AsmReadCr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr4.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadCr4.asm deleted file mode 100644 index 02f9072..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr4.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr4.Asm -; -; Abstract: -; -; AsmReadCr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr4 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr4 PROC - mov eax, cr4 - ret -AsmReadCr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCs.asm b/MdePkg/Library/BaseLi= b/Ia32/ReadCs.asm deleted file mode 100644 index f9f1eef..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCs.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCs.Asm -; -; Abstract: -; -; AsmReadCs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadCs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCs PROC - mov eax, cs - ret -AsmReadCs ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr0.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr0.asm deleted file mode 100644 index 8a8c4d2..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr0.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr0.Asm -; -; Abstract: -; -; AsmReadDr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr0 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr0 PROC - mov eax, dr0 - ret -AsmReadDr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr1.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr1.asm deleted file mode 100644 index cb9808b..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr1.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr1.Asm -; -; Abstract: -; -; AsmReadDr1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr1 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr1 PROC - mov eax, dr1 - ret -AsmReadDr1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr2.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr2.asm deleted file mode 100644 index bbc77b6..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr2.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr2.Asm -; -; Abstract: -; -; AsmReadDr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr2 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr2 PROC - mov eax, dr2 - ret -AsmReadDr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr3.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr3.asm deleted file mode 100644 index a6dc443..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr3.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr3.Asm -; -; Abstract: -; -; AsmReadDr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr3 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr3 PROC - mov eax, dr3 - ret -AsmReadDr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr4.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr4.asm deleted file mode 100644 index 2d0c7a6..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr4.asm +++ /dev/null @@ -1,47 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr4.Asm -; -; Abstract: -; -; AsmReadDr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr4 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr4 PROC - ; - ; DR4 is alias to DR6 only if DE (in CR4) is cleared. Otherwise, readi= ng - ; this register will cause a #UD exception. - ; - ; MS assembler doesn't support this instruction since no one would use= it - ; under normal circustances. Here opcode is used. - ; - DB 0fh, 21h, 0e0h - ret -AsmReadDr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr5.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr5.asm deleted file mode 100644 index 58b4ac2..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr5.asm +++ /dev/null @@ -1,47 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr5.Asm -; -; Abstract: -; -; AsmReadDr5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr5 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr5 PROC - ; - ; DR5 is alias to DR7 only if DE (in CR4) is cleared. Otherwise, readi= ng - ; this register will cause a #UD exception. - ; - ; MS assembler doesn't support this instruction since no one would use= it - ; under normal circustances. Here opcode is used. - ; - DB 0fh, 21h, 0e8h - ret -AsmReadDr5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr6.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr6.asm deleted file mode 100644 index 6ecac10..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr6.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr6.Asm -; -; Abstract: -; -; AsmReadDr6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr6 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr6 PROC - mov eax, dr6 - ret -AsmReadDr6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr7.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadDr7.asm deleted file mode 100644 index 3869bb1..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr7.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr7.Asm -; -; Abstract: -; -; AsmReadDr7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr7 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr7 PROC - mov eax, dr7 - ret -AsmReadDr7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDs.asm b/MdePkg/Library/BaseLi= b/Ia32/ReadDs.asm deleted file mode 100644 index d134926..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDs.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDs.Asm -; -; Abstract: -; -; AsmReadDs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadDs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDs PROC - mov eax, ds - ret -AsmReadDs ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEflags.asm b/MdePkg/Library/Ba= seLib/Ia32/ReadEflags.asm deleted file mode 100644 index 4b210d1..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadEflags.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadEflags.Asm -; -; Abstract: -; -; AsmReadEflags function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadEflags ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadEflags PROC - pushfd - pop eax - ret -AsmReadEflags ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEs.asm b/MdePkg/Library/BaseLi= b/Ia32/ReadEs.asm deleted file mode 100644 index 4c5d0cc..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadEs.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadEs.Asm -; -; Abstract: -; -; AsmReadEs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadEs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadEs PROC - mov eax, es - ret -AsmReadEs ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadFs.asm b/MdePkg/Library/BaseLi= b/Ia32/ReadFs.asm deleted file mode 100644 index bdcb97f..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadFs.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadFs.Asm -; -; Abstract: -; -; AsmReadFs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadFs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadFs PROC - mov eax, fs - ret -AsmReadFs ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.asm b/MdePkg/Library/Base= Lib/Ia32/ReadGdtr.asm deleted file mode 100644 index 68c125a..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadGdtr.Asm -; -; Abstract: -; -; AsmReadGdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86ReadGdtr ( -; OUT IA32_DESCRIPTOR *Gdtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86ReadGdtr PROC - mov eax, [esp + 4] - sgdt fword ptr [eax] - ret -InternalX86ReadGdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGs.asm b/MdePkg/Library/BaseLi= b/Ia32/ReadGs.asm deleted file mode 100644 index db505de..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadGs.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadGs.Asm -; -; Abstract: -; -; AsmReadGs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadGs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadGs PROC - mov eax, gs - ret -AsmReadGs ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.asm b/MdePkg/Library/Base= Lib/Ia32/ReadIdtr.asm deleted file mode 100644 index 40b8bf8..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadIdtr.Asm -; -; Abstract: -; -; AsmReadIdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86ReadIdtr ( -; OUT IA32_DESCRIPTOR *Idtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86ReadIdtr PROC - mov eax, [esp + 4] - sidt fword ptr [eax] - ret -InternalX86ReadIdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.asm b/MdePkg/Library/Base= Lib/Ia32/ReadLdtr.asm deleted file mode 100644 index f38ebbf..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadLdtr.Asm -; -; Abstract: -; -; AsmReadLdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadLdtr ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadLdtr PROC - sldt ax - ret -AsmReadLdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm0.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm0.asm deleted file mode 100644 index 990b647..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm0.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm0.Asm -; -; Abstract: -; -; AsmReadMm0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm0 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm0 PROC - push eax - push eax - movq [esp], mm0 - pop eax - pop edx - ret -AsmReadMm0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm1.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm1.asm deleted file mode 100644 index d241fac..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm1.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm1.Asm -; -; Abstract: -; -; AsmReadMm1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm1 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm1 PROC - push eax - push eax - movq [esp], mm1 - pop eax - pop edx - ret -AsmReadMm1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm2.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm2.asm deleted file mode 100644 index 07bf0ea..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm2.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm2.Asm -; -; Abstract: -; -; AsmReadMm2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm2 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm2 PROC - push eax - push eax - movq [esp], mm2 - pop eax - pop edx - ret -AsmReadMm2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm3.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm3.asm deleted file mode 100644 index d323188..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm3.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm3.Asm -; -; Abstract: -; -; AsmReadMm3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm3 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm3 PROC - push eax - push eax - movq [esp], mm3 - pop eax - pop edx - ret -AsmReadMm3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm4.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm4.asm deleted file mode 100644 index 3d63eae..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm4.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm4.Asm -; -; Abstract: -; -; AsmReadMm4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm4 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm4 PROC - push eax - push eax - movq [esp], mm4 - pop eax - pop edx - ret -AsmReadMm4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm5.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm5.asm deleted file mode 100644 index 39d0c7e..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm5.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm5.Asm -; -; Abstract: -; -; AsmReadMm5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm5 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm5 PROC - push eax - push eax - movq [esp], mm5 - pop eax - pop edx - ret -AsmReadMm5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm6.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm6.asm deleted file mode 100644 index 2673710..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm6.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm6.Asm -; -; Abstract: -; -; AsmReadMm6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm6 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm6 PROC - push eax - push eax - movq [esp], mm6 - pop eax - pop edx - ret -AsmReadMm6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm7.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadMm7.asm deleted file mode 100644 index eadb1ac..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm7.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm7.Asm -; -; Abstract: -; -; AsmReadMm7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm7 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm7 PROC - push eax - push eax - movq [esp], mm7 - pop eax - pop edx - ret -AsmReadMm7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.asm b/MdePkg/Library/Bas= eLib/Ia32/ReadMsr64.asm deleted file mode 100644 index da6f45f..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMsr64.Asm -; -; Abstract: -; -; AsmReadMsr64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMsr64 ( -; IN UINT64 Index -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMsr64 PROC - mov ecx, [esp + 4] - rdmsr - ret -AsmReadMsr64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadPmc.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadPmc.asm deleted file mode 100644 index 59ea36b..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadPmc.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadPmc.Asm -; -; Abstract: -; -; AsmReadPmc function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadPmc ( -; IN UINT32 PmcIndex -; ); -;-------------------------------------------------------------------------= ----- -AsmReadPmc PROC - mov ecx, [esp + 4] - rdpmc - ret -AsmReadPmc ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadSs.asm b/MdePkg/Library/BaseLi= b/Ia32/ReadSs.asm deleted file mode 100644 index bfba7c0..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadSs.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadSs.Asm -; -; Abstract: -; -; AsmReadSs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadSs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadSs PROC - mov eax, ss - ret -AsmReadSs ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTr.asm b/MdePkg/Library/BaseLi= b/Ia32/ReadTr.asm deleted file mode 100644 index 7fca070..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadTr.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadTr.Asm -; -; Abstract: -; -; AsmReadTr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadTr ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadTr PROC - str ax - ret -AsmReadTr ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTsc.asm b/MdePkg/Library/BaseL= ib/Ia32/ReadTsc.asm deleted file mode 100644 index ad02adb..0000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadTsc.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadTsc.Asm -; -; Abstract: -; -; AsmReadTsc function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadTsc ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadTsc PROC - rdtsc - ret -AsmReadTsc ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.asm b/MdePkg/Library/BaseL= ib/Ia32/SetJump.asm deleted file mode 100644 index 0bfa404..0000000 --- a/MdePkg/Library/BaseLib/Ia32/SetJump.asm +++ /dev/null @@ -1,51 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetJump.Asm -; -; Abstract: -; -; Implementation of SetJump() on IA-32. -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -InternalAssertJumpBuffer PROTO C - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; SetJump ( -; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer -; ); -;-------------------------------------------------------------------------= ----- -SetJump PROC - push DWORD [esp + 4] - call InternalAssertJumpBuffer ; To validate JumpBuffer - pop ecx - pop ecx ; ecx <- return address - mov edx, [esp] - mov [edx], ebx - mov [edx + 4], esi - mov [edx + 8], edi - mov [edx + 12], ebp - mov [edx + 16], esp - mov [edx + 20], ecx ; eip value to restore in LongJump - xor eax, eax - jmp ecx -SetJump ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.asm b/MdePkg/Library/B= aseLib/Ia32/SwapBytes64.asm deleted file mode 100644 index 7020753..0000000 --- a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuId.Asm -; -; Abstract: -; -; AsmCpuid function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalMathSwapBytes64 ( -; IN UINT64 Operand -; ); -;-------------------------------------------------------------------------= ----- -InternalMathSwapBytes64 PROC - mov eax, [esp + 8] ; eax <- upper 32 bits - mov edx, [esp + 4] ; edx <- lower 32 bits - bswap eax - bswap edx - ret -InternalMathSwapBytes64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm b/MdePkg/Library/BaseL= ib/Ia32/Thunk16.asm deleted file mode 100644 index 08955d4..0000000 --- a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm +++ /dev/null @@ -1,260 +0,0 @@ - -#include "BaseLibInternals.h" - -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Thunk.asm -; -; Abstract: -; -; Real mode thunk -; -;-------------------------------------------------------------------------= ----- - - .686p - .model flat,C - -EXTERNDEF C m16Start:BYTE -EXTERNDEF C m16Size:WORD -EXTERNDEF C mThunk16Attr:WORD -EXTERNDEF C m16Gdt:WORD -EXTERNDEF C m16GdtrBase:WORD -EXTERNDEF C mTransition:WORD - -; -; Here is the layout of the real mode stack. _ToUserCode() is responsible = for -; loading all these registers from real mode stack. -; -IA32_REGS STRUC 4t -_EDI DD ? -_ESI DD ? -_EBP DD ? -_ESP DD ? -_EBX DD ? -_EDX DD ? -_ECX DD ? -_EAX DD ? -_DS DW ? -_ES DW ? -_FS DW ? -_GS DW ? -_EFLAGS DD ? -_EIP DD ? -_CS DW ? -_SS DW ? -IA32_REGS ENDS - - .const - -; -; These are global constant to convey information to C code. -; -m16Size DW InternalAsmThunk16 - m16Start -mThunk16Attr DW _ThunkAttr - m16Start -m16Gdt DW _NullSegDesc - m16Start -m16GdtrBase DW _16GdtrBase - m16Start -mTransition DW _EntryPoint - m16Start - - .code - -m16Start LABEL BYTE - -SavedGdt LABEL FWORD - DW ? - DD ? -;-------------------------------------------------------------------------= ----- -; _BackFromUserCode() takes control in real mode after 'retf' has been exe= cuted -; by user code. It will be shadowed to somewhere in memory below 1MB. -;-------------------------------------------------------------------------= ----- -_BackFromUserCode PROC - ; - ; The order of saved registers on the stack matches the order they app= ears - ; in IA32_REGS structure. This facilitates wrapper function to extract= them - ; into that structure. - ; - push ss - push cs - DB 66h - call @Base ; push eip -@Base: - pushf ; pushfd actually - cli ; disable interrupts - push gs - push fs - push es - push ds - pushaw ; pushad actually - DB 66h, 0bah ; mov edx, imm32 -_ThunkAttr DD ? - test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 - jz @1 - mov eax, 15cd2401h ; mov ax, 2401h & int 15h - cli ; disable interrupts - jnc @2 -@1: - test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL - jz @2 - in al, 92h - or al, 2 - out 92h, al ; deactivate A20M# -@2: - xor ax, ax ; xor eax, eax - mov eax, ss ; mov ax, ss - DB 67h - lea bp, [esp + sizeof (IA32_REGS)] - ; - ; esi's in the following 2 instructions are indeed bp in 16-bit code. = Fact - ; is "esi" in 32-bit addressing mode has the same encoding of "bp" in = 16- - ; bit addressing mode. - ; - mov word ptr (IA32_REGS ptr [esi - sizeof (IA32_REGS)])._ESP, bp - mov ebx, (IA32_REGS ptr [esi - sizeof (IA32_REGS)])._EIP - shl ax, 4 ; shl eax, 4 - add bp, ax ; add ebp, eax - DB 66h, 0b8h ; mov eax, imm32 -SavedCr4 DD ? - mov cr4, eax - DB 66h - lgdt fword ptr cs:[edi + (SavedGdt - @Base)] - DB 66h, 0b8h ; mov eax, imm32 -SavedCr0 DD ? - mov cr0, eax - DB 0b8h ; mov ax, imm16 -SavedSs DW ? - mov ss, eax - DB 66h, 0bch ; mov esp, imm32 -SavedEsp DD ? - DB 66h - retf ; return to protected mode -_BackFromUserCode ENDP - -_EntryPoint DD _ToUserCode - m16Start - DW 8h -_16Idtr FWORD (1 SHL 10) - 1 -_16Gdtr LABEL FWORD - DW GdtEnd - _NullSegDesc - 1 -_16GdtrBase DD _NullSegDesc - -;-------------------------------------------------------------------------= ----- -; _ToUserCode() takes control in real mode before passing control to user = code. -; It will be shadowed to somewhere in memory below 1MB. -;-------------------------------------------------------------------------= ----- -_ToUserCode PROC - mov edx, ss - mov ss, ecx ; set new segment selectors - mov ds, ecx - mov es, ecx - mov fs, ecx - mov gs, ecx - mov cr0, eax ; real mode starts at next instruc= tion - ; which (per SDM) *must* be a far= JMP. - DB 0eah -_RealAddr DW 0,0 ; filled in by InternalAsmThunk16 - - mov cr4, ebp - mov ss, esi ; set up 16-bit stack segment - xchg sp, bx ; set up 16-bit stack pointer - -; mov bp, [esp + sizeof(IA32_REGS) - DB 67h - mov ebp, [esp + sizeof(IA32_REGS)] ; BackFromUserCode address from= stack - -; mov cs:[bp + (SavedSs - _BackFromUserCode)], dx - mov cs:[esi + (SavedSs - _BackFromUserCode)], edx - -; mov cs:[bp + (SavedEsp - _BackFromUserCode)], ebx - DB 2eh, 66h, 89h, 9eh - DW SavedEsp - _BackFromUserCode - -; lidt cs:[bp + (_16Idtr - _BackFromUserCode)] - DB 2eh, 66h, 0fh, 01h, 9eh - DW _16Idtr - _BackFromUserCode - - popaw ; popad actually - pop ds - pop es - pop fs - pop gs - popf ; popfd - DB 66h ; Use 32-bit addressing for "retf"= below - retf ; transfer control to user code -_ToUserCode ENDP - -_NullSegDesc DQ 0 -_16CsDesc LABEL QWORD - DW -1 - DW 0 - DB 0 - DB 9bh - DB 8fh ; 16-bit segment, 4GB limit - DB 0 -_16DsDesc LABEL QWORD - DW -1 - DW 0 - DB 0 - DB 93h - DB 8fh ; 16-bit segment, 4GB limit - DB 0 -GdtEnd LABEL QWORD - -;-------------------------------------------------------------------------= ----- -; IA32_REGISTER_SET * -; EFIAPI -; InternalAsmThunk16 ( -; IN IA32_REGISTER_SET *RegisterSet, -; IN OUT VOID *Transition -; ); -;-------------------------------------------------------------------------= ----- -InternalAsmThunk16 PROC USES ebp ebx esi edi ds es fs gs - mov esi, [esp + 36] ; esi <- RegSet, the 1st parameter - movzx edx, (IA32_REGS ptr [esi])._SS - mov edi, (IA32_REGS ptr [esi])._ESP - add edi, - (sizeof (IA32_REGS) + 4) ; reserve stack space - mov ebx, edi ; ebx <- stack offset - imul eax, edx, 16 ; eax <- edx * 16 - push sizeof (IA32_REGS) / 4 - add edi, eax ; edi <- linear address of 16-bit = stack - pop ecx - rep movsd ; copy RegSet - mov eax, [esp + 40] ; eax <- address of transition code - mov esi, edx ; esi <- 16-bit stack segment - lea edx, [eax + (SavedCr0 - m16Start)] - mov ecx, eax - and ecx, 0fh - shl eax, 12 - lea ecx, [ecx + (_BackFromUserCode - m16Start)] - mov ax, cx - stosd ; [edi] <- return address of user = code - add eax, _RealAddr + 4 - _BackFromUserCode - mov dword ptr [edx + (_RealAddr - SavedCr0)], eax - sgdt fword ptr [edx + (SavedGdt - SavedCr0)] - sidt fword ptr [esp + 36] ; save IDT stack in argument space - mov eax, cr0 - mov [edx], eax ; save CR0 in SavedCr0 - and eax, 7ffffffeh ; clear PE, PG bits - mov ebp, cr4 - mov [edx + (SavedCr4 - SavedCr0)], ebp - and ebp, NOT 30h ; clear PAE, PSE bits - push 10h - pop ecx ; ecx <- selector for data segments - lgdt fword ptr [edx + (_16Gdtr - SavedCr0)] - pushfd ; Save df/if indeed - call fword ptr [edx + (_EntryPoint - SavedCr0)] - popfd - lidt fword ptr [esp + 36] ; restore protected mode IDTR - lea eax, [ebp - sizeof (IA32_REGS)] ; eax <- the address of IA32_R= EGS - ret -InternalAsmThunk16 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/Wbinvd.asm b/MdePkg/Library/BaseLi= b/Ia32/Wbinvd.asm deleted file mode 100644 index 06db1c8..0000000 --- a/MdePkg/Library/BaseLib/Ia32/Wbinvd.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Wbinvd.Asm -; -; Abstract: -; -; AsmWbinvd function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .486p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWbinvd ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmWbinvd PROC - wbinvd - ret -AsmWbinvd ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr0.asm b/MdePkg/Library/Base= Lib/Ia32/WriteCr0.asm deleted file mode 100644 index edcf710..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr0.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr0.Asm -; -; Abstract: -; -; AsmWriteCr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr0 ( -; UINTN Cr0 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr0 PROC - mov eax, [esp + 4] - mov cr0, eax - ret -AsmWriteCr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr2.asm b/MdePkg/Library/Base= Lib/Ia32/WriteCr2.asm deleted file mode 100644 index 06c54b0..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr2.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr2.Asm -; -; Abstract: -; -; AsmWriteCr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr2 ( -; UINTN Cr2 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr2 PROC - mov eax, [esp + 4] - mov cr2, eax - ret -AsmWriteCr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr3.asm b/MdePkg/Library/Base= Lib/Ia32/WriteCr3.asm deleted file mode 100644 index 69e87ba..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr3.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr3.Asm -; -; Abstract: -; -; AsmWriteCr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr3 ( -; UINTN Cr3 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr3 PROC - mov eax, [esp + 4] - mov cr3, eax - ret -AsmWriteCr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr4.asm b/MdePkg/Library/Base= Lib/Ia32/WriteCr4.asm deleted file mode 100644 index ad45348..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr4.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr4.Asm -; -; Abstract: -; -; AsmWriteCr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr4 ( -; UINTN Cr4 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr4 PROC - mov eax, [esp + 4] - mov cr4, eax - ret -AsmWriteCr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr0.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr0.asm deleted file mode 100644 index 5528134..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr0.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr0.Asm -; -; Abstract: -; -; AsmWriteDr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr0 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr0 PROC - mov eax, [esp + 4] - mov dr0, eax - ret -AsmWriteDr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr1.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr1.asm deleted file mode 100644 index ad9f885..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr1.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr1.Asm -; -; Abstract: -; -; AsmWriteDr1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr1 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr1 PROC - mov eax, [esp + 4] - mov dr1, eax - ret -AsmWriteDr1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr2.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr2.asm deleted file mode 100644 index 266ff7d..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr2.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr2.Asm -; -; Abstract: -; -; AsmWriteDr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr2 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr2 PROC - mov eax, [esp + 4] - mov dr2, eax - ret -AsmWriteDr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr3.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr3.asm deleted file mode 100644 index b24d105..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr3.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr3.Asm -; -; Abstract: -; -; AsmWriteDr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr3 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr3 PROC - mov eax, [esp + 4] - mov dr3, eax - ret -AsmWriteDr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr4.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr4.asm deleted file mode 100644 index bc8eef1..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr4.asm +++ /dev/null @@ -1,48 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr4.Asm -; -; Abstract: -; -; AsmWriteDr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr4 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr4 PROC - mov eax, [esp + 4] - ; - ; DR4 is alias to DR6 only if DE (in CR4) is cleared. Otherwise, writi= ng to - ; this register will cause a #UD exception. - ; - ; MS assembler doesn't support this instruction since no one would use= it - ; under normal circustances. Here opcode is used. - ; - DB 0fh, 23h, 0e0h - ret -AsmWriteDr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr5.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr5.asm deleted file mode 100644 index 0df8175..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr5.asm +++ /dev/null @@ -1,48 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr5.Asm -; -; Abstract: -; -; AsmWriteDr5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr5 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr5 PROC - mov eax, [esp + 4] - ; - ; DR5 is alias to DR7 only if DE (in CR4) is cleared. Otherwise, writi= ng to - ; this register will cause a #UD exception. - ; - ; MS assembler doesn't support this instruction since no one would use= it - ; under normal circustances. Here opcode is used. - ; - DB 0fh, 23h, 0e8h - ret -AsmWriteDr5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr6.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr6.asm deleted file mode 100644 index dc399ea..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr6.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr6.Asm -; -; Abstract: -; -; AsmWriteDr6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr6 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr6 PROC - mov eax, [esp + 4] - mov dr6, eax - ret -AsmWriteDr6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr7.asm b/MdePkg/Library/Base= Lib/Ia32/WriteDr7.asm deleted file mode 100644 index ace8822..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr7.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr7.Asm -; -; Abstract: -; -; AsmWriteDr7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr7 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr7 PROC - mov eax, [esp + 4] - mov dr7, eax - ret -AsmWriteDr7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.asm b/MdePkg/Library/Bas= eLib/Ia32/WriteGdtr.asm deleted file mode 100644 index d95ef31..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteGdtr.Asm -; -; Abstract: -; -; AsmWriteGdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86WriteGdtr ( -; IN CONST IA32_DESCRIPTOR *Idtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86WriteGdtr PROC - mov eax, [esp + 4] - lgdt fword ptr [eax] - ret -InternalX86WriteGdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.asm b/MdePkg/Library/Bas= eLib/Ia32/WriteIdtr.asm deleted file mode 100644 index da15433..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteIdtr.Asm -; -; Abstract: -; -; AsmWriteIdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86WriteIdtr ( -; IN CONST IA32_DESCRIPTOR *Idtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86WriteIdtr PROC - mov eax, [esp + 4] - pushfd - cli - lidt fword ptr [eax] - popfd - ret -InternalX86WriteIdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.asm b/MdePkg/Library/Bas= eLib/Ia32/WriteLdtr.asm deleted file mode 100644 index adec67d..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteLdtr.Asm -; -; Abstract: -; -; AsmWriteLdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386p - .model flat - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteLdtr ( -; IN UINT16 Ldtr -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteLdtr PROC - mov eax, [esp + 4] - lldt ax - ret -AsmWriteLdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm0.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm0.asm deleted file mode 100644 index de89a86..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm0.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm0.Asm -; -; Abstract: -; -; AsmWriteMm0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm0 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm0 PROC - movq mm0, [esp + 4] - ret -AsmWriteMm0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm1.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm1.asm deleted file mode 100644 index 2bb255f..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm1.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm1.Asm -; -; Abstract: -; -; AsmWriteMm1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm1 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm1 PROC - movq mm1, [esp + 4] - ret -AsmWriteMm1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm2.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm2.asm deleted file mode 100644 index 99a9fc8..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm2.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm2.Asm -; -; Abstract: -; -; AsmWriteMm2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm2 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm2 PROC - movq mm2, [esp + 4] - ret -AsmWriteMm2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm3.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm3.asm deleted file mode 100644 index 7ae32ed..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm3.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm3.Asm -; -; Abstract: -; -; AsmWriteMm3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm3 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm3 PROC - movq mm3, [esp + 4] - ret -AsmWriteMm3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm4.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm4.asm deleted file mode 100644 index 0ede40e..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm4.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm4.Asm -; -; Abstract: -; -; AsmWriteMm4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm4 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm4 PROC - movq mm4, [esp + 4] - ret -AsmWriteMm4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm5.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm5.asm deleted file mode 100644 index 1438a88..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm5.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm5.Asm -; -; Abstract: -; -; AsmWriteMm5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm5 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm5 PROC - movq mm5, [esp + 4] - ret -AsmWriteMm5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm6.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm6.asm deleted file mode 100644 index d7bce97..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm6.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm6.Asm -; -; Abstract: -; -; AsmWriteMm6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm6 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm6 PROC - movq mm6, [esp + 4] - ret -AsmWriteMm6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm7.asm b/MdePkg/Library/Base= Lib/Ia32/WriteMm7.asm deleted file mode 100644 index c6920b4..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm7.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm7.Asm -; -; Abstract: -; -; AsmWriteMm7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm7 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm7 PROC - movq mm7, [esp + 4] - ret -AsmWriteMm7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.asm b/MdePkg/Library/Ba= seLib/Ia32/WriteMsr64.asm deleted file mode 100644 index 109adc8..0000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMsr64.Asm -; -; Abstract: -; -; AsmWriteMsr64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmWriteMsr64 ( -; IN UINT32 Index, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMsr64 PROC - mov edx, [esp + 12] - mov eax, [esp + 8] - mov ecx, [esp + 4] - wrmsr - ret -AsmWriteMsr64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm b/MdePkg/Library/= BaseLib/X64/CpuBreakpoint.asm deleted file mode 100644 index 25dd9b4..0000000 --- a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm +++ /dev/null @@ -1,37 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuBreakpoint.Asm -; -; Abstract: -; -; CpuBreakpoint function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuBreakpoint ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuBreakpoint PROC - int 3 - ret -CpuBreakpoint ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/CpuId.asm b/MdePkg/Library/BaseLib/= X64/CpuId.asm deleted file mode 100644 index c6182c1..0000000 --- a/MdePkg/Library/BaseLib/X64/CpuId.asm +++ /dev/null @@ -1,62 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuId.Asm -; -; Abstract: -; -; AsmCpuid function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmCpuid ( -; IN UINT32 RegisterInEax, -; OUT UINT32 *RegisterOutEax OPTIONAL, -; OUT UINT32 *RegisterOutEbx OPTIONAL, -; OUT UINT32 *RegisterOutEcx OPTIONAL, -; OUT UINT32 *RegisterOutEdx OPTIONAL -; ) -;-------------------------------------------------------------------------= ----- -AsmCpuid PROC USES rbx - mov eax, ecx - push rax ; save Index on stack - push rdx - cpuid - test r9, r9 - jz @F - mov [r9], ecx -@@: - pop rcx - jrcxz @F - mov [rcx], eax -@@: - mov rcx, r8 - jrcxz @F - mov [rcx], ebx -@@: - mov rcx, [rsp + 38h] - jrcxz @F - mov [rcx], edx -@@: - pop rax ; restore Index to rax as return v= alue - ret -AsmCpuid ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/CpuIdEx.asm b/MdePkg/Library/BaseLi= b/X64/CpuIdEx.asm deleted file mode 100644 index b41ba8e..0000000 --- a/MdePkg/Library/BaseLib/X64/CpuIdEx.asm +++ /dev/null @@ -1,64 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuIdEx.Asm -; -; Abstract: -; -; AsmCpuidEx function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; AsmCpuidEx ( -; IN UINT32 RegisterInEax, -; IN UINT32 RegisterInEcx, -; OUT UINT32 *RegisterOutEax OPTIONAL, -; OUT UINT32 *RegisterOutEbx OPTIONAL, -; OUT UINT32 *RegisterOutEcx OPTIONAL, -; OUT UINT32 *RegisterOutEdx OPTIONAL -; ) -;-------------------------------------------------------------------------= ----- -AsmCpuidEx PROC USES rbx - mov eax, ecx - mov ecx, edx - push rax ; save Index on stack - cpuid - mov r10, [rsp + 38h] - test r10, r10 - jz @F - mov [r10], ecx -@@: - mov rcx, r8 - jrcxz @F - mov [rcx], eax -@@: - mov rcx, r9 - jrcxz @F - mov [rcx], ebx -@@: - mov rcx, [rsp + 40h] - jrcxz @F - mov [rcx], edx -@@: - pop rax ; restore Index to rax as return v= alue - ret -AsmCpuidEx ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/CpuPause.asm b/MdePkg/Library/BaseL= ib/X64/CpuPause.asm deleted file mode 100644 index a84465f..0000000 --- a/MdePkg/Library/BaseLib/X64/CpuPause.asm +++ /dev/null @@ -1,37 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CpuPause.Asm -; -; Abstract: -; -; CpuPause function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuPause ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -CpuPause PROC - pause - ret -CpuPause ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/DisableCache.asm b/MdePkg/Library/B= aseLib/X64/DisableCache.asm deleted file mode 100644 index 9fd5bd7..0000000 --- a/MdePkg/Library/BaseLib/X64/DisableCache.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DisableCache.Asm -; -; Abstract: -; -; Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush al= l caches with a -; WBINVD instruction. -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmDisableCache ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmDisableCache PROC - mov rax, cr0 - bts rax, 30 - btr rax, 29 - mov cr0, rax - wbinvd - ret -AsmDisableCache ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/DisableInterrupts.asm b/MdePkg/Libr= ary/BaseLib/X64/DisableInterrupts.asm deleted file mode 100644 index 4e54e0d..0000000 --- a/MdePkg/Library/BaseLib/X64/DisableInterrupts.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DisableInterrupts.Asm -; -; Abstract: -; -; DisableInterrupts function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; DisableInterrupts ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -DisableInterrupts PROC - cli - ret -DisableInterrupts ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.asm b/MdePkg/Librar= y/BaseLib/X64/DisablePaging64.asm deleted file mode 100644 index 32dcd5a..0000000 --- a/MdePkg/Library/BaseLib/X64/DisablePaging64.asm +++ /dev/null @@ -1,84 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; DisablePaging64.Asm -; -; Abstract: -; -; AsmDisablePaging64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86DisablePaging64 ( -; IN UINT16 Cs, -; IN UINT32 EntryPoint, -; IN UINT32 Context1, OPTIONAL -; IN UINT32 Context2, OPTIONAL -; IN UINT32 NewStack -; ); -;-------------------------------------------------------------------------= ----- -InternalX86DisablePaging64 PROC - cli - lea rsi, @F ; rsi <- The start address of tran= sition code - mov edi, [rsp + 28h] ; rdi <- New stack - lea rax, mTransitionEnd ; rax <- end of transition code - sub rax, rsi ; rax <- The size of transition pi= ece code=20 - add rax, 4 ; Round RAX up to the next 4 byte = boundary - and al, 0fch - sub rdi, rax ; rdi <- Use stack to hold transit= ion code - mov r10d, edi ; r10 <- The start address of tran= sicition code below 4G - push rcx ; save rcx to stack - mov rcx, rax ; rcx <- The size of transition pi= ece code - rep movsb ; copy transition code to top of n= ew stack which must be below 4GB - pop rcx ; restore rcx - =20 - mov esi, r8d - mov edi, r9d - mov eax, r10d ; eax <- start of the transition c= ode on the stack - sub eax, 4 ; eax <- One slot below transition= code on the stack - push rcx ; push Cs to stack - push r10 ; push address of tansition code o= n stack - DB 48h ; prefix to composite "retq" with = next "retf" - retf ; Use far return to load CS regist= er from stack - -; Start of transition code -@@: - mov esp, eax ; set up new stack - mov rax, cr0 - btr eax, 31 ; Clear CR0.PG - mov cr0, rax ; disable paging and caches - =20 - mov ebx, edx ; save EntryPoint to rbx, for rdms= r will overwrite rdx - mov ecx, 0c0000080h - rdmsr - and ah, NOT 1 ; clear LME - wrmsr - mov rax, cr4 - and al, NOT (1 SHL 5) ; clear PAE - mov cr4, rax - push rdi ; push Context2 - push rsi ; push Context1 - call rbx ; transfer control to EntryPoint - hlt ; no one should get here -InternalX86DisablePaging64 ENDP - -mTransitionEnd LABEL BYTE - - END diff --git a/MdePkg/Library/BaseLib/X64/EnableCache.asm b/MdePkg/Library/Ba= seLib/X64/EnableCache.asm deleted file mode 100644 index 88b71d7..0000000 --- a/MdePkg/Library/BaseLib/X64/EnableCache.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnableCache.Asm -; -; Abstract: -; -; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to = 0, and clear=20 -; the NW bit of CR0 to 0 -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmEnableCache ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmEnableCache PROC - wbinvd - mov rax, cr0 - btr rax, 29 - btr rax, 30 - mov cr0, rax - ret -AsmEnableCache ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm b/MdePk= g/Library/BaseLib/X64/EnableDisableInterrupts.asm deleted file mode 100644 index f6b2d9c..0000000 --- a/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnableDisableInterrupts.Asm -; -; Abstract: -; -; EnableDisableInterrupts function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; EnableDisableInterrupts ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -EnableDisableInterrupts PROC - sti - cli - ret -EnableDisableInterrupts ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/EnableInterrupts.asm b/MdePkg/Libra= ry/BaseLib/X64/EnableInterrupts.asm deleted file mode 100644 index e776c27..0000000 --- a/MdePkg/Library/BaseLib/X64/EnableInterrupts.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; EnableInterrupts.Asm -; -; Abstract: -; -; EnableInterrupts function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; EnableInterrupts ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -EnableInterrupts PROC - sti - ret -EnableInterrupts ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/FlushCacheLine.asm b/MdePkg/Library= /BaseLib/X64/FlushCacheLine.asm deleted file mode 100644 index e30f9a9..0000000 --- a/MdePkg/Library/BaseLib/X64/FlushCacheLine.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; FlushCacheLine.Asm -; -; Abstract: -; -; AsmFlushCacheLine function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI=20 -; AsmFlushCacheLine ( -; IN VOID *LinearAddress -; ); -;-------------------------------------------------------------------------= ----- -AsmFlushCacheLine PROC - clflush [rcx] - mov rax, rcx - ret -AsmFlushCacheLine ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/FxRestore.asm b/MdePkg/Library/Base= Lib/X64/FxRestore.asm deleted file mode 100644 index 8496331..0000000 --- a/MdePkg/Library/BaseLib/X64/FxRestore.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; FxRestore.Asm -; -; Abstract: -; -; AsmFxRestore function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86FxRestore ( -; IN CONST IA32_FX_BUFFER *Buffer -; ); -;-------------------------------------------------------------------------= ----- -InternalX86FxRestore PROC - fxrstor [rcx] - ret -InternalX86FxRestore ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/FxSave.asm b/MdePkg/Library/BaseLib= /X64/FxSave.asm deleted file mode 100644 index d41e935..0000000 --- a/MdePkg/Library/BaseLib/X64/FxSave.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; FxSave.Asm -; -; Abstract: -; -; AsmFxSave function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86FxSave ( -; OUT IA32_FX_BUFFER *Buffer -; ); -;-------------------------------------------------------------------------= ----- -InternalX86FxSave PROC - fxsave [rcx] - ret -InternalX86FxSave ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/Invd.asm b/MdePkg/Library/BaseLib/X= 64/Invd.asm deleted file mode 100644 index ed6f95d..0000000 --- a/MdePkg/Library/BaseLib/X64/Invd.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Invd.Asm -; -; Abstract: -; -; AsmInvd function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmInvd ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmInvd PROC - invd - ret -AsmInvd ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/LongJump.asm b/MdePkg/Library/BaseL= ib/X64/LongJump.asm deleted file mode 100644 index eaf32ea..0000000 --- a/MdePkg/Library/BaseLib/X64/LongJump.asm +++ /dev/null @@ -1,58 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; LongJump.Asm -; -; Abstract: -; -; Implementation of _LongJump() on x64. -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalLongJump ( -; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -InternalLongJump PROC - mov rbx, [rcx] - mov rsp, [rcx + 8] - mov rbp, [rcx + 10h] - mov rdi, [rcx + 18h] - mov rsi, [rcx + 20h] - mov r12, [rcx + 28h] - mov r13, [rcx + 30h] - mov r14, [rcx + 38h] - mov r15, [rcx + 40h] - ; load non-volatile fp registers - ldmxcsr [rcx + 50h] - movdqu xmm6, [rcx + 58h] - movdqu xmm7, [rcx + 68h] - movdqu xmm8, [rcx + 78h] - movdqu xmm9, [rcx + 88h] - movdqu xmm10, [rcx + 98h] - movdqu xmm11, [rcx + 0A8h] - movdqu xmm12, [rcx + 0B8h] - movdqu xmm13, [rcx + 0C8h] - movdqu xmm14, [rcx + 0D8h] - movdqu xmm15, [rcx + 0E8h] - mov rax, rdx ; set return value - jmp qword ptr [rcx + 48h] -InternalLongJump ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/Monitor.asm b/MdePkg/Library/BaseLi= b/X64/Monitor.asm deleted file mode 100644 index 8ae6e73..0000000 --- a/MdePkg/Library/BaseLib/X64/Monitor.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Monitor.Asm -; -; Abstract: -; -; AsmMonitor function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmMonitor ( -; IN UINTN Eax, -; IN UINTN Ecx, -; IN UINTN Edx -; ); -;-------------------------------------------------------------------------= ----- -AsmMonitor PROC - mov eax, ecx - mov ecx, edx - mov edx, r8d - DB 0fh, 1, 0c8h ; monitor - ret -AsmMonitor ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/Mwait.asm b/MdePkg/Library/BaseLib/= X64/Mwait.asm deleted file mode 100644 index 02ec863..0000000 --- a/MdePkg/Library/BaseLib/X64/Mwait.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Mwait.Asm -; -; Abstract: -; -; AsmMwait function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmMwait ( -; IN UINTN Eax, -; IN UINTN Ecx -; ); -;-------------------------------------------------------------------------= ----- -AsmMwait PROC - mov eax, ecx - mov ecx, edx - DB 0fh, 1, 0c9h ; mwait - ret -AsmMwait ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/RdRand.asm b/MdePkg/Library/BaseLib= /X64/RdRand.asm deleted file mode 100644 index 8e2074e..0000000 --- a/MdePkg/Library/BaseLib/X64/RdRand.asm +++ /dev/null @@ -1,83 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; RdRand.asm -; -; Abstract: -; -; Generates random number through CPU RdRand instruction under 64-bit pl= atform. -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; Generates a 16 bit random number through RDRAND instruction. -; Return TRUE if Rand generated successfully, or FALSE if not. -; -; BOOLEAN EFIAPI InternalX86RdRand16 (UINT16 *Rand); -;-------------------------------------------------------------------------= ----- -InternalX86RdRand16 PROC - ; rdrand ax ; generate a 16 bit RN into eax, - ; CF=3D1 if RN generated ok, otherwise = CF=3D0 - db 0fh, 0c7h, 0f0h ; rdrand r16: "0f c7 /6 ModRM:r/m(w)" - jc rn16_ok ; jmp if CF=3D1 - xor rax, rax ; reg=3D0 if CF=3D0 - ret ; return with failure status -rn16_ok: - mov [rcx], ax - mov rax, 1 - ret -InternalX86RdRand16 ENDP - -;-------------------------------------------------------------------------= ----- -; Generates a 32 bit random number through RDRAND instruction. -; Return TRUE if Rand generated successfully, or FALSE if not. -; -; BOOLEAN EFIAPI InternalX86RdRand32 (UINT32 *Rand); -;-------------------------------------------------------------------------= ----- -InternalX86RdRand32 PROC - ; rdrand eax ; generate a 32 bit RN into eax, - ; CF=3D1 if RN generated ok, otherwise = CF=3D0 - db 0fh, 0c7h, 0f0h ; rdrand r32: "0f c7 /6 ModRM:r/m(w)" - jc rn32_ok ; jmp if CF=3D1 - xor rax, rax ; reg=3D0 if CF=3D0 - ret ; return with failure status -rn32_ok: - mov [rcx], eax - mov rax, 1 - ret -InternalX86RdRand32 ENDP - -;-------------------------------------------------------------------------= ----- -; Generates a 64 bit random number through one RDRAND instruction. -; Return TRUE if Rand generated successfully, or FALSE if not. -; -; BOOLEAN EFIAPI InternalX86RdRand64 (UINT64 *Random); -;-------------------------------------------------------------------------= ----- -InternalX86RdRand64 PROC - ; rdrand rax ; generate a 64 bit RN into rax, - ; CF=3D1 if RN generated ok, otherwise = CF=3D0 - db 048h, 0fh, 0c7h, 0f0h ; rdrand r64: "REX.W + 0f c7 /6 ModRM:r= /m(w)" - jc rn64_ok ; jmp if CF=3D1 - xor rax, rax ; reg=3D0 if CF=3D0 - ret ; return with failure status -rn64_ok: - mov [rcx], rax - mov rax, 1 - ret -InternalX86RdRand64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadCr0.asm b/MdePkg/Library/BaseLi= b/X64/ReadCr0.asm deleted file mode 100644 index c3ff5b0..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadCr0.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr0.Asm -; -; Abstract: -; -; AsmReadCr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr0 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr0 PROC - mov rax, cr0 - ret -AsmReadCr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadCr2.asm b/MdePkg/Library/BaseLi= b/X64/ReadCr2.asm deleted file mode 100644 index f1473b9..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadCr2.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr2.Asm -; -; Abstract: -; -; AsmReadCr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr2 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr2 PROC - mov rax, cr2 - ret -AsmReadCr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadCr3.asm b/MdePkg/Library/BaseLi= b/X64/ReadCr3.asm deleted file mode 100644 index 432468e..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadCr3.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr3.Asm -; -; Abstract: -; -; AsmReadCr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr3 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr3 PROC - mov rax, cr3 - ret -AsmReadCr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadCr4.asm b/MdePkg/Library/BaseLi= b/X64/ReadCr4.asm deleted file mode 100644 index 17d4499..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadCr4.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCr4.Asm -; -; Abstract: -; -; AsmReadCr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadCr4 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCr4 PROC - mov rax, cr4 - ret -AsmReadCr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadCs.asm b/MdePkg/Library/BaseLib= /X64/ReadCs.asm deleted file mode 100644 index ac3040c..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadCs.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadCs.Asm -; -; Abstract: -; -; AsmReadCs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadCs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadCs PROC - mov eax, cs - ret -AsmReadCs ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr0.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr0.asm deleted file mode 100644 index 8ac85ad..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr0.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr0.Asm -; -; Abstract: -; -; AsmReadDr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr0 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr0 PROC - mov rax, dr0 - ret -AsmReadDr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr1.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr1.asm deleted file mode 100644 index 8b042e2..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr1.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr1.Asm -; -; Abstract: -; -; AsmReadDr1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr1 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr1 PROC - mov rax, dr1 - ret -AsmReadDr1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr2.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr2.asm deleted file mode 100644 index 9361756..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr2.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr2.Asm -; -; Abstract: -; -; AsmReadDr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr2 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr2 PROC - mov rax, dr2 - ret -AsmReadDr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr3.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr3.asm deleted file mode 100644 index a25fc9d..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr3.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr3.Asm -; -; Abstract: -; -; AsmReadDr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr3 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr3 PROC - mov rax, dr3 - ret -AsmReadDr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr4.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr4.asm deleted file mode 100644 index dc6c5e9..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr4.asm +++ /dev/null @@ -1,42 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr4.Asm -; -; Abstract: -; -; AsmReadDr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr4 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr4 PROC - ; - ; There's no obvious reason to access this register, since it's aliase= d to - ; DR7 when DE=3D0 or an exception generated when DE=3D1 - ; - DB 0fh, 21h, 0e0h - ret -AsmReadDr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr5.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr5.asm deleted file mode 100644 index 7e31352..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr5.asm +++ /dev/null @@ -1,42 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr5.Asm -; -; Abstract: -; -; AsmReadDr5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr5 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr5 PROC - ; - ; There's no obvious reason to access this register, since it's aliase= d to - ; DR7 when DE=3D0 or an exception generated when DE=3D1 - ; - DB 0fh, 21h, 0e8h - ret -AsmReadDr5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr6.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr6.asm deleted file mode 100644 index ee6b9ec..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr6.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr6.Asm -; -; Abstract: -; -; AsmReadDr6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr6 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr6 PROC - mov rax, dr6 - ret -AsmReadDr6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDr7.asm b/MdePkg/Library/BaseLi= b/X64/ReadDr7.asm deleted file mode 100644 index 7173057..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDr7.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDr7.Asm -; -; Abstract: -; -; AsmReadDr7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadDr7 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDr7 PROC - mov rax, dr7 - ret -AsmReadDr7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadDs.asm b/MdePkg/Library/BaseLib= /X64/ReadDs.asm deleted file mode 100644 index d67512c..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadDs.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadDs.Asm -; -; Abstract: -; -; AsmReadDs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadDs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadDs PROC - mov eax, ds - ret -AsmReadDs ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadEflags.asm b/MdePkg/Library/Bas= eLib/X64/ReadEflags.asm deleted file mode 100644 index b3ecc7c..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadEflags.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadEflags.Asm -; -; Abstract: -; -; AsmReadEflags function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmReadEflags ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadEflags PROC - pushfq - pop rax - ret -AsmReadEflags ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadEs.asm b/MdePkg/Library/BaseLib= /X64/ReadEs.asm deleted file mode 100644 index 76cffdc..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadEs.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadEs.Asm -; -; Abstract: -; -; AsmReadEs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadEs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadEs PROC - mov eax, es - ret -AsmReadEs ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadFs.asm b/MdePkg/Library/BaseLib= /X64/ReadFs.asm deleted file mode 100644 index e91aa14..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadFs.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadFs.Asm -; -; Abstract: -; -; AsmReadFs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadFs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadFs PROC - mov eax, fs - ret -AsmReadFs ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadGdtr.asm b/MdePkg/Library/BaseL= ib/X64/ReadGdtr.asm deleted file mode 100644 index ebc60bd..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadGdtr.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadGdtr.Asm -; -; Abstract: -; -; AsmReadGdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86ReadGdtr ( -; OUT IA32_DESCRIPTOR *Gdtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86ReadGdtr PROC - sgdt fword ptr [rcx] - ret -InternalX86ReadGdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadGs.asm b/MdePkg/Library/BaseLib= /X64/ReadGs.asm deleted file mode 100644 index f185c38..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadGs.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadGs.Asm -; -; Abstract: -; -; AsmReadGs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadGs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadGs PROC - mov eax, gs - ret -AsmReadGs ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadIdtr.asm b/MdePkg/Library/BaseL= ib/X64/ReadIdtr.asm deleted file mode 100644 index 4d53feb..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadIdtr.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadIdtr.Asm -; -; Abstract: -; -; AsmReadIdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86ReadIdtr ( -; OUT IA32_DESCRIPTOR *Idtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86ReadIdtr PROC - sidt fword ptr [rcx] - ret -InternalX86ReadIdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadLdtr.asm b/MdePkg/Library/BaseL= ib/X64/ReadLdtr.asm deleted file mode 100644 index dbe517e..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadLdtr.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadLdtr.Asm -; -; Abstract: -; -; AsmReadLdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadLdtr ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadLdtr PROC - sldt eax - ret -AsmReadLdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm0.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm0.asm deleted file mode 100644 index 99212c7..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm0.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm0.Asm -; -; Abstract: -; -; AsmReadMm0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm0 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm0 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0c0h - ret -AsmReadMm0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm1.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm1.asm deleted file mode 100644 index 7a9ae7c..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm1.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm1.Asm -; -; Abstract: -; -; AsmReadMm1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm1 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm1 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0c8h - ret -AsmReadMm1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm2.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm2.asm deleted file mode 100644 index 337ac73..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm2.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm2.Asm -; -; Abstract: -; -; AsmReadMm2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm2 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm2 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0d0h - ret -AsmReadMm2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm3.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm3.asm deleted file mode 100644 index 266e29a..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm3.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm3.Asm -; -; Abstract: -; -; AsmReadMm3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm3 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm3 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0d8h - ret -AsmReadMm3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm4.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm4.asm deleted file mode 100644 index 9cc7435..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm4.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm4.Asm -; -; Abstract: -; -; AsmReadMm4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm4 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm4 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0e0h - ret -AsmReadMm4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm5.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm5.asm deleted file mode 100644 index b665225..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm5.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm5.Asm -; -; Abstract: -; -; AsmReadMm5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm5 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm5 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0e8h - ret -AsmReadMm5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm6.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm6.asm deleted file mode 100644 index 1e3ebc5..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm6.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm6.Asm -; -; Abstract: -; -; AsmReadMm6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm6 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm6 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0f0h - ret -AsmReadMm6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMm7.asm b/MdePkg/Library/BaseLi= b/X64/ReadMm7.asm deleted file mode 100644 index 8228672..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMm7.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMm7.Asm -; -; Abstract: -; -; AsmReadMm7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMm7 ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMm7 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 7eh, 0f8h - ret -AsmReadMm7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadMsr64.asm b/MdePkg/Library/Base= Lib/X64/ReadMsr64.asm deleted file mode 100644 index 878ed18..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadMsr64.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadMsr64.Asm -; -; Abstract: -; -; AsmReadMsr64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadMsr64 ( -; IN UINT32 Index -; ); -;-------------------------------------------------------------------------= ----- -AsmReadMsr64 PROC - rdmsr ; edx & eax are zero extended - shl rdx, 20h - or rax, rdx - ret -AsmReadMsr64 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadPmc.asm b/MdePkg/Library/BaseLi= b/X64/ReadPmc.asm deleted file mode 100644 index 1b74f67..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadPmc.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadPmc.Asm -; -; Abstract: -; -; AsmReadPmc function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadPmc ( -; IN UINT32 PmcIndex -; ); -;-------------------------------------------------------------------------= ----- -AsmReadPmc PROC - rdpmc - shl rdx, 20h - or rax, rdx - ret -AsmReadPmc ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadSs.asm b/MdePkg/Library/BaseLib= /X64/ReadSs.asm deleted file mode 100644 index 8f308c4..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadSs.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadSs.Asm -; -; Abstract: -; -; AsmReadSs function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadSs ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadSs PROC - mov eax, ss - ret -AsmReadSs ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadTr.asm b/MdePkg/Library/BaseLib= /X64/ReadTr.asm deleted file mode 100644 index a114f53..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadTr.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadTr.Asm -; -; Abstract: -; -; AsmReadTr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; AsmReadTr ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadTr PROC - str eax - ret -AsmReadTr ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/ReadTsc.asm b/MdePkg/Library/BaseLi= b/X64/ReadTsc.asm deleted file mode 100644 index d792bfb..0000000 --- a/MdePkg/Library/BaseLib/X64/ReadTsc.asm +++ /dev/null @@ -1,40 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ReadTsc.Asm -; -; Abstract: -; -; AsmReadTsc function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmReadTsc ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmReadTsc PROC - rdtsc - shl rdx, 20h - or rax, rdx - ret -AsmReadTsc ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/SetJump.asm b/MdePkg/Library/BaseLi= b/X64/SetJump.asm deleted file mode 100644 index 13cb323..0000000 --- a/MdePkg/Library/BaseLib/X64/SetJump.asm +++ /dev/null @@ -1,66 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetJump.Asm -; -; Abstract: -; -; Implementation of SetJump() on x64. -; -;-------------------------------------------------------------------------= ----- - - .code - -EXTERN InternalAssertJumpBuffer:PROC - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; SetJump ( -; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer -; ); -;-------------------------------------------------------------------------= ----- -SetJump PROC - push rcx - add rsp, -20h - call InternalAssertJumpBuffer - add rsp, 20h - pop rcx - pop rdx - mov [rcx], rbx - mov [rcx + 8], rsp - mov [rcx + 10h], rbp - mov [rcx + 18h], rdi - mov [rcx + 20h], rsi - mov [rcx + 28h], r12 - mov [rcx + 30h], r13 - mov [rcx + 38h], r14 - mov [rcx + 40h], r15 - mov [rcx + 48h], rdx - ; save non-volatile fp registers - stmxcsr [rcx + 50h] - movdqu [rcx + 58h], xmm6 - movdqu [rcx + 68h], xmm7 - movdqu [rcx + 78h], xmm8 - movdqu [rcx + 88h], xmm9 - movdqu [rcx + 98h], xmm10 - movdqu [rcx + 0A8h], xmm11 - movdqu [rcx + 0B8h], xmm12 - movdqu [rcx + 0C8h], xmm13 - movdqu [rcx + 0D8h], xmm14 - movdqu [rcx + 0E8h], xmm15 - xor rax, rax - jmp rdx -SetJump ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/SwitchStack.asm b/MdePkg/Library/Ba= seLib/X64/SwitchStack.asm deleted file mode 100644 index 0f802b0..0000000 --- a/MdePkg/Library/BaseLib/X64/SwitchStack.asm +++ /dev/null @@ -1,51 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SwitchStack.Asm -; -; Abstract: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; Routine Description: -; -; Routine for switching stacks with 2 parameters -; -; Arguments: -; -; (rcx) EntryPoint - Entry point with new stack. -; (rdx) Context1 - Parameter1 for entry point. -; (r8) Context2 - Parameter2 for entry point. -; (r9) NewStack - The pointer to new stack. -; -; Returns: -; -; None -; -;-------------------------------------------------------------------------= ----- -InternalSwitchStack PROC - mov rax, rcx - mov rcx, rdx - mov rdx, r8 - ; - ; Reserve space for register parameters (rcx, rdx, r8 & r9) on the sta= ck, - ; in case the callee wishes to spill them. - ; - lea rsp, [r9 - 20h] - call rax -InternalSwitchStack ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.asm b/MdePkg/Library/BaseLi= b/X64/Thunk16.asm deleted file mode 100644 index e01de27..0000000 --- a/MdePkg/Library/BaseLib/X64/Thunk16.asm +++ /dev/null @@ -1,315 +0,0 @@ - -#include "BaseLibInternals.h" - -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Thunk.asm -; -; Abstract: -; -; Real mode thunk -; -;-------------------------------------------------------------------------= ----- - -EXTERNDEF m16Start:BYTE -EXTERNDEF m16Size:WORD -EXTERNDEF mThunk16Attr:WORD -EXTERNDEF m16Gdt:WORD -EXTERNDEF m16GdtrBase:WORD -EXTERNDEF mTransition:WORD - -IA32_REGS STRUC 4t -_EDI DD ? -_ESI DD ? -_EBP DD ? -_ESP DD ? -_EBX DD ? -_EDX DD ? -_ECX DD ? -_EAX DD ? -_DS DW ? -_ES DW ? -_FS DW ? -_GS DW ? -_EFLAGS DQ ? -_EIP DD ? -_CS DW ? -_SS DW ? -IA32_REGS ENDS - - .const - -m16Size DW InternalAsmThunk16 - m16Start -mThunk16Attr DW _ThunkAttr - m16Start -m16Gdt DW _NullSeg - m16Start -m16GdtrBase DW _16GdtrBase - m16Start -mTransition DW _EntryPoint - m16Start - - .code - -m16Start LABEL BYTE - -SavedGdt LABEL FWORD - DW ? - DQ ? - -;-------------------------------------------------------------------------= ----- -; _BackFromUserCode() takes control in real mode after 'retf' has been exe= cuted -; by user code. It will be shadowed to somewhere in memory below 1MB. -;-------------------------------------------------------------------------= ----- -_BackFromUserCode PROC - ; - ; The order of saved registers on the stack matches the order they app= ears - ; in IA32_REGS structure. This facilitates wrapper function to extract= them - ; into that structure. - ; - ; Some instructions for manipulation of segment registers have to be w= ritten - ; in opcode since 64-bit MASM prevents accesses to those registers. - ; - DB 16h ; push ss - DB 0eh ; push cs - DB 66h - call @Base ; push eip -@Base: - DB 66h - push 0 ; reserved high order 32 bits of E= Flags - pushf ; pushfd actually - cli ; disable interrupts - push gs - push fs - DB 6 ; push es - DB 1eh ; push ds - DB 66h, 60h ; pushad - DB 66h, 0bah ; mov edx, imm32 -_ThunkAttr DD ? - test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 - jz @1 - mov eax, 15cd2401h ; mov ax, 2401h & int 15h - cli ; disable interrupts - jnc @2 -@1: - test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL - jz @2 - in al, 92h - or al, 2 - out 92h, al ; deactivate A20M# -@2: - xor ax, ax ; xor eax, eax - mov eax, ss ; mov ax, ss - lea bp, [esp + sizeof (IA32_REGS)] - ; - ; rsi in the following 2 instructions is indeed bp in 16-bit code - ; - mov word ptr (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._ESP, bp - DB 66h - mov ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP - shl ax, 4 ; shl eax, 4 - add bp, ax ; add ebp, eax - mov ax, cs - shl ax, 4 - lea ax, [eax + ebx + (@64BitCode - @Base)] - DB 66h, 2eh, 89h, 87h ; mov cs:[bx + (@64Eip - @Base)], = eax - DW @64Eip - @Base - DB 66h, 0b8h ; mov eax, imm32 -SavedCr4 DD ? - mov cr4, rax - ; - ; rdi in the instruction below is indeed bx in 16-bit code - ; - DB 66h, 2eh ; 2eh is "cs:" segment override - lgdt fword ptr [rdi + (SavedGdt - @Base)] - DB 66h - mov ecx, 0c0000080h - rdmsr - or ah, 1 - wrmsr - DB 66h, 0b8h ; mov eax, imm32 -SavedCr0 DD ? - mov cr0, rax - DB 66h, 0eah ; jmp far cs:@64Bit -@64Eip DD ? -SavedCs DW ? -@64BitCode: - db 090h=20 - db 048h, 0bch ; mov rsp, imm64 -SavedSp DQ ? ; restore stack - nop - ret -_BackFromUserCode ENDP - -_EntryPoint DD _ToUserCode - m16Start - DW CODE16 -_16Gdtr LABEL FWORD - DW GDT_SIZE - 1 -_16GdtrBase DQ _NullSeg -_16Idtr FWORD (1 SHL 10) - 1 - -;-------------------------------------------------------------------------= ----- -; _ToUserCode() takes control in real mode before passing control to user = code. -; It will be shadowed to somewhere in memory below 1MB. -;-------------------------------------------------------------------------= ----- -_ToUserCode PROC - mov ss, edx ; set new segment selectors - mov ds, edx - mov es, edx - mov fs, edx - mov gs, edx - DB 66h - mov ecx, 0c0000080h - mov cr0, rax ; real mode starts at next instruc= tion - rdmsr - and ah, NOT 1 - wrmsr - mov cr4, rbp - mov ss, esi ; set up 16-bit stack segment - mov sp, bx ; set up 16-bit stack pointer - DB 66h ; make the following call 32-bit - call @Base ; push eip -@Base: - pop bp ; ebp <- address of @Base - push [esp + sizeof (IA32_REGS) + 2] - lea eax, [rsi + (@RealMode - @Base)] ; rsi is "bp" in 16-bit co= de - push rax - retf ; execution begins at next instruc= tion -@RealMode: - DB 66h, 2eh ; CS and operand size override - lidt fword ptr [rsi + (_16Idtr - @Base)] - DB 66h, 61h ; popad - DB 1fh ; pop ds - DB 07h ; pop es - pop fs - pop gs - popf ; popfd - lea sp, [esp + 4] ; skip high order 32 bits of EFlags - DB 66h ; make the following retf 32-bit - retf ; transfer control to user code -_ToUserCode ENDP - -CODE16 =3D _16Code - $ -DATA16 =3D _16Data - $ -DATA32 =3D _32Data - $ - -_NullSeg DQ 0 -_16Code LABEL QWORD - DW -1 - DW 0 - DB 0 - DB 9bh - DB 8fh ; 16-bit segment, 4GB limit - DB 0 -_16Data LABEL QWORD - DW -1 - DW 0 - DB 0 - DB 93h - DB 8fh ; 16-bit segment, 4GB limit - DB 0 -_32Data LABEL QWORD - DW -1 - DW 0 - DB 0 - DB 93h - DB 0cfh ; 16-bit segment, 4GB limit - DB 0 - -GDT_SIZE =3D $ - _NullSeg - -;-------------------------------------------------------------------------= ----- -; IA32_REGISTER_SET * -; EFIAPI -; InternalAsmThunk16 ( -; IN IA32_REGISTER_SET *RegisterSet, -; IN OUT VOID *Transition -; ); -;-------------------------------------------------------------------------= ----- -InternalAsmThunk16 PROC USES rbp rbx rsi rdi - mov rbx, ds - push rbx ; Save ds segment register on the stack - mov rbx, es - push rbx ; Save es segment register on the stack - mov rbx, ss - push rbx ; Save ss segment register on the stack - =20 - push fs - push gs - mov rsi, rcx - movzx r8d, (IA32_REGS ptr [rsi])._SS - mov edi, (IA32_REGS ptr [rsi])._ESP - lea rdi, [edi - (sizeof (IA32_REGS) + 4)] - imul eax, r8d, 16 ; eax <- r8d(stack segment) * 16 - mov ebx, edi ; ebx <- stack for 16-bit code - push sizeof (IA32_REGS) / 4 - add edi, eax ; edi <- linear address of 16-bit = stack - pop rcx - rep movsd ; copy RegSet - lea ecx, [rdx + (SavedCr4 - m16Start)] - mov eax, edx ; eax <- transition code address - and edx, 0fh - shl eax, 12 ; segment address in high order 16= bits - lea ax, [rdx + (_BackFromUserCode - m16Start)] ; offset address - stosd ; [edi] <- return address of user = code - =20 - sgdt fword ptr [rsp + 60h] ; save GDT stack in argument space - movzx r10, word ptr [rsp + 60h] ; r10 <- GDT limit=20 - lea r11, [rcx + (InternalAsmThunk16 - SavedCr4) + 0xf] - and r11, 0xfffffff0 ; r11 <- 16-byte aligned shadowed = GDT table in real mode buffer - =20 - mov word ptr [rcx + (SavedGdt - SavedCr4)], r10w ; save the l= imit of shadowed GDT table - mov qword ptr [rcx + (SavedGdt - SavedCr4) + 2], r11 ; save the b= ase address of shadowed GDT table - =20 - mov rsi, qword ptr [rsp + 62h] ; rsi <- the original GDT base add= ress - xchg rcx, r10 ; save rcx to r10 and initialize r= cx to be the limit of GDT table - inc rcx ; rcx <- the size of memory to copy - xchg rdi, r11 ; save rdi to r11 and initialize r= di to the base address of shadowed GDT table - rep movsb ; perform memory copy to shadow GD= T table - mov rcx, r10 ; restore the orignal rcx before m= emory copy - mov rdi, r11 ; restore the original rdi before = memory copy - =20 - sidt fword ptr [rsp + 50h] ; save IDT stack in argument space - mov rax, cr0 - mov [rcx + (SavedCr0 - SavedCr4)], eax - and eax, 7ffffffeh ; clear PE, PG bits - mov rbp, cr4 - mov [rcx], ebp ; save CR4 in SavedCr4 - and ebp, NOT 30h ; clear PAE, PSE bits - mov esi, r8d ; esi <- 16-bit stack segment - DB 6ah, DATA32 ; push DATA32 - pop rdx ; rdx <- 32-bit data segment selec= tor - lgdt fword ptr [rcx + (_16Gdtr - SavedCr4)] - mov ss, edx - pushfq - lea edx, [rdx + DATA16 - DATA32] - lea r8, @RetFromRealMode - push r8 - mov r8d, cs - mov [rcx + (SavedCs - SavedCr4)], r8w - mov [rcx + (SavedSp - SavedCr4)], rsp - jmp fword ptr [rcx + (_EntryPoint - SavedCr4)] -@RetFromRealMode: - popfq - lgdt fword ptr [rsp + 60h] ; restore protected mode GDTR - lidt fword ptr [rsp + 50h] ; restore protected mode IDTR - lea eax, [rbp - sizeof (IA32_REGS)] - pop gs - pop fs - pop rbx - mov ss, rbx - pop rbx - mov es, rbx - pop rbx - mov ds, rbx - ret -InternalAsmThunk16 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/Wbinvd.asm b/MdePkg/Library/BaseLib= /X64/Wbinvd.asm deleted file mode 100644 index b0807e0..0000000 --- a/MdePkg/Library/BaseLib/X64/Wbinvd.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; Wbinvd.Asm -; -; Abstract: -; -; AsmWbinvd function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWbinvd ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -AsmWbinvd PROC - wbinvd - ret -AsmWbinvd ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteCr0.asm b/MdePkg/Library/BaseL= ib/X64/WriteCr0.asm deleted file mode 100644 index 98fef9c..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteCr0.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr0.Asm -; -; Abstract: -; -; AsmWriteCr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr0 ( -; UINTN Cr0 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr0 PROC - mov cr0, rcx - mov rax, rcx - ret -AsmWriteCr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteCr2.asm b/MdePkg/Library/BaseL= ib/X64/WriteCr2.asm deleted file mode 100644 index 3d77d6a..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteCr2.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr2.Asm -; -; Abstract: -; -; AsmWriteCr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr2 ( -; UINTN Cr2 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr2 PROC - mov cr2, rcx - mov rax, rcx - ret -AsmWriteCr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteCr3.asm b/MdePkg/Library/BaseL= ib/X64/WriteCr3.asm deleted file mode 100644 index 9b39938..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteCr3.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr3.Asm -; -; Abstract: -; -; AsmWriteCr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr3 ( -; UINTN Cr3 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr3 PROC - mov cr3, rcx - mov rax, rcx - ret -AsmWriteCr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteCr4.asm b/MdePkg/Library/BaseL= ib/X64/WriteCr4.asm deleted file mode 100644 index 1455842..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteCr4.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteCr4.Asm -; -; Abstract: -; -; AsmWriteCr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteCr4 ( -; UINTN Cr4 -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteCr4 PROC - mov cr4, rcx - mov rax, rcx - ret -AsmWriteCr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr0.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr0.asm deleted file mode 100644 index dafe9ab..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr0.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr0.Asm -; -; Abstract: -; -; AsmWriteDr0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr0 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr0 PROC - mov dr0, rcx - mov rax, rcx - ret -AsmWriteDr0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr1.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr1.asm deleted file mode 100644 index 7167f5e..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr1.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr1.Asm -; -; Abstract: -; -; AsmWriteDr1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr1 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr1 PROC - mov dr1, rcx - mov rax, rcx - ret -AsmWriteDr1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr2.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr2.asm deleted file mode 100644 index c14ba34..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr2.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr2.Asm -; -; Abstract: -; -; AsmWriteDr2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr2 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr2 PROC - mov dr2, rcx - mov rax, rcx - ret -AsmWriteDr2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr3.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr3.asm deleted file mode 100644 index 8873916c..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr3.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr3.Asm -; -; Abstract: -; -; AsmWriteDr3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr3 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr3 PROC - mov dr3, rcx - mov rax, rcx - ret -AsmWriteDr3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr4.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr4.asm deleted file mode 100644 index 4803525..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr4.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr4.Asm -; -; Abstract: -; -; AsmWriteDr4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr4 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr4 PROC - ; - ; There's no obvious reason to access this register, since it's aliase= d to - ; DR6 when DE=3D0 or an exception generated when DE=3D1 - ; - DB 0fh, 23h, 0e1h - mov rax, rcx - ret -AsmWriteDr4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr5.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr5.asm deleted file mode 100644 index 2cdb328..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr5.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr5.Asm -; -; Abstract: -; -; AsmWriteDr5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr5 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr5 PROC - ; - ; There's no obvious reason to access this register, since it's aliase= d to - ; DR7 when DE=3D0 or an exception generated when DE=3D1 - ; - DB 0fh, 23h, 0e9h - mov rax, rcx - ret -AsmWriteDr5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr6.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr6.asm deleted file mode 100644 index 22c9c87..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr6.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr6.Asm -; -; Abstract: -; -; AsmWriteDr6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr6 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr6 PROC - mov dr6, rcx - mov rax, rcx - ret -AsmWriteDr6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteDr7.asm b/MdePkg/Library/BaseL= ib/X64/WriteDr7.asm deleted file mode 100644 index b55afd3..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteDr7.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteDr7.Asm -; -; Abstract: -; -; AsmWriteDr7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINTN -; EFIAPI -; AsmWriteDr7 ( -; IN UINTN Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteDr7 PROC - mov dr7, rcx - mov rax, rcx - ret -AsmWriteDr7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteGdtr.asm b/MdePkg/Library/Base= Lib/X64/WriteGdtr.asm deleted file mode 100644 index 0cc8b7a..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteGdtr.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteGdtr.Asm -; -; Abstract: -; -; AsmWriteGdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86WriteGdtr ( -; IN CONST IA32_DESCRIPTOR *Idtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86WriteGdtr PROC - lgdt fword ptr [rcx] - ret -InternalX86WriteGdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteIdtr.asm b/MdePkg/Library/Base= Lib/X64/WriteIdtr.asm deleted file mode 100644 index 01ca1c0..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteIdtr.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteIdtr.Asm -; -; Abstract: -; -; AsmWriteIdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; InternalX86WriteIdtr ( -; IN CONST IA32_DESCRIPTOR *Idtr -; ); -;-------------------------------------------------------------------------= ----- -InternalX86WriteIdtr PROC - pushfq - cli - lidt fword ptr [rcx] - popfq - ret -InternalX86WriteIdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteLdtr.asm b/MdePkg/Library/Base= Lib/X64/WriteLdtr.asm deleted file mode 100644 index af67863..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteLdtr.asm +++ /dev/null @@ -1,38 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteLdtr.Asm -; -; Abstract: -; -; AsmWriteLdtr function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteLdtr ( -; IN UINT16 Ldtr -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteLdtr PROC - lldt cx - ret -AsmWriteLdtr ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm0.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm0.asm deleted file mode 100644 index f40db03..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm0.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm0.Asm -; -; Abstract: -; -; AsmWriteMm0 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm0 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm0 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0c1h - ret -AsmWriteMm0 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm1.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm1.asm deleted file mode 100644 index ec17208..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm1.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm1.Asm -; -; Abstract: -; -; AsmWriteMm1 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm1 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm1 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0c9h - ret -AsmWriteMm1 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm2.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm2.asm deleted file mode 100644 index 38c0d5e..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm2.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm2.Asm -; -; Abstract: -; -; AsmWriteMm2 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm2 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm2 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0d1h - ret -AsmWriteMm2 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm3.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm3.asm deleted file mode 100644 index 5f5bbdd..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm3.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm3.Asm -; -; Abstract: -; -; AsmWriteMm3 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm3 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm3 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0d9h - ret -AsmWriteMm3 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm4.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm4.asm deleted file mode 100644 index 7f53313..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm4.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm4.Asm -; -; Abstract: -; -; AsmWriteMm4 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm4 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm4 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0e1h - ret -AsmWriteMm4 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm5.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm5.asm deleted file mode 100644 index ea30bc1..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm5.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm5.Asm -; -; Abstract: -; -; AsmWriteMm5 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm5 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm5 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0e9h - ret -AsmWriteMm5 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm6.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm6.asm deleted file mode 100644 index aa926ae..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm6.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm6.Asm -; -; Abstract: -; -; AsmWriteMm6 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm6 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm6 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0f1h - ret -AsmWriteMm6 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMm7.asm b/MdePkg/Library/BaseL= ib/X64/WriteMm7.asm deleted file mode 100644 index 652e041..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMm7.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMm7.Asm -; -; Abstract: -; -; AsmWriteMm7 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmWriteMm7 ( -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMm7 PROC - ; - ; 64-bit MASM doesn't support MMX instructions, so use opcode here - ; - DB 48h, 0fh, 6eh, 0f9h - ret -AsmWriteMm7 ENDP - - END diff --git a/MdePkg/Library/BaseLib/X64/WriteMsr64.asm b/MdePkg/Library/Bas= eLib/X64/WriteMsr64.asm deleted file mode 100644 index 19ef572..0000000 --- a/MdePkg/Library/BaseLib/X64/WriteMsr64.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; WriteMsr64.Asm -; -; Abstract: -; -; AsmWriteMsr64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; AsmWriteMsr64 ( -; IN UINT32 Index, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -AsmWriteMsr64 PROC - mov rax, rdx ; meanwhile, rax <- return value - shr rdx, 20h ; edx:eax contains the value to wr= ite - wrmsr - ret -AsmWriteMsr64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf b/MdePkg/= Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf index af08b7d..f04ca13 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf +++ b/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf @@ -74,52 +74,30 @@ Ia32/CopyMem.nasm Ia32/CopyMem.S Ia32/ScanMem64.nasm - Ia32/ScanMem64.asm Ia32/ScanMem32.nasm - Ia32/ScanMem32.asm Ia32/ScanMem16.nasm - Ia32/ScanMem16.asm Ia32/ScanMem8.nasm - Ia32/ScanMem8.asm Ia32/CompareMem.nasm - Ia32/CompareMem.asm Ia32/SetMem64.nasm - Ia32/SetMem64.asm Ia32/SetMem32.nasm - Ia32/SetMem32.asm Ia32/SetMem16.nasm - Ia32/SetMem16.asm Ia32/ZeroMem.nasm - Ia32/ZeroMem.asm Ia32/SetMem.nasm - Ia32/SetMem.asm Ia32/CopyMem.nasm - Ia32/CopyMem.asm Ia32/IsZeroBuffer.nasm =20 [Sources.X64] X64/ZeroMem.nasm - X64/ZeroMem.asm X64/ScanMem64.nasm - X64/ScanMem64.asm X64/ScanMem32.nasm - X64/ScanMem32.asm X64/ScanMem16.nasm - X64/ScanMem16.asm X64/ScanMem8.nasm - X64/ScanMem8.asm X64/CompareMem.nasm - X64/CompareMem.asm X64/SetMem64.nasm - X64/SetMem64.asm X64/SetMem32.nasm - X64/SetMem32.asm X64/SetMem16.nasm - X64/SetMem16.asm X64/SetMem.nasm - X64/SetMem.asm X64/CopyMem.nasm - X64/CopyMem.asm X64/ScanMem64.nasm X64/ScanMem64.S X64/ScanMem32.nasm diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.asm b/MdePkg/L= ibrary/BaseMemoryLibMmx/Ia32/CompareMem.asm deleted file mode 100644 index 5a0792d..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.asm +++ /dev/null @@ -1,56 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES esi edi - mov esi, [esp + 12] - mov edi, [esp + 16] - mov ecx, [esp + 20] - repe cmpsb - movzx eax, byte ptr [esi - 1] - movzx edx, byte ptr [edi - 1] - sub eax, edx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.asm b/MdePkg/Libr= ary/BaseMemoryLibMmx/Ia32/CopyMem.asm deleted file mode 100644 index 38e1da7..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.asm +++ /dev/null @@ -1,77 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES esi edi - mov esi, [esp + 16] ; esi <- Source - mov edi, [esp + 12] ; edi <- Destination - mov edx, [esp + 20] ; edx <- Count - lea eax, [esi + edx - 1] ; eax <- End of Source - cmp esi, edi - jae @F - cmp eax, edi ; Overlapped? - jae @CopyBackward ; Copy backward if overlapped -@@: - mov ecx, edx - and edx, 7 - shr ecx, 3 ; ecx <- # of Qwords to copy - jz @CopyBytes - push eax - push eax - movq [esp], mm0 ; save mm0 -@@: - movq mm0, [esi] - movq [edi], mm0 - add esi, 8 - add edi, 8 - loop @B - movq mm0, [esp] ; restore mm0 - pop ecx ; stack cleanup - pop ecx ; stack cleanup - jmp @CopyBytes -@CopyBackward: - mov esi, eax ; esi <- Last byte in Source - lea edi, [edi + edx - 1] ; edi <- Last byte in Destination - std -@CopyBytes: - mov ecx, edx - rep movsb - cld - mov eax, [esp + 12] - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.asm b/MdePkg/Li= brary/BaseMemoryLibMmx/Ia32/ScanMem16.asm deleted file mode 100644 index 0ee190e..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasw - lea eax, [edi - 2] - cmovnz eax, ecx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.asm b/MdePkg/Li= brary/BaseMemoryLibMmx/Ia32/ScanMem32.asm deleted file mode 100644 index adbf295..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasd - lea eax, [edi - 4] - cmovnz eax, ecx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.asm b/MdePkg/Li= brary/BaseMemoryLibMmx/Ia32/ScanMem64.asm deleted file mode 100644 index 0a0f5d0..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.asm +++ /dev/null @@ -1,64 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - cmp eax, [edi] - lea edi, [edi + 8] - loopne @B - jne @F - cmp edx, [edi - 4] - jecxz @F - jne @B -@@: - lea eax, [edi - 8] - cmovne eax, ecx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.asm b/MdePkg/Lib= rary/BaseMemoryLibMmx/Ia32/ScanMem8.asm deleted file mode 100644 index c64d41d..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov al, [esp + 16] - repne scasb - lea eax, [edi - 1] - cmovnz eax, ecx - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.asm b/MdePkg/Libra= ry/BaseMemoryLibMmx/Ia32/SetMem.asm deleted file mode 100644 index e43ea08..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.asm +++ /dev/null @@ -1,70 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES edi - mov al, [esp + 16] - mov ah, al - shrd edx, eax, 16 - shld eax, edx, 16 - mov ecx, [esp + 12] ; ecx <- Count - mov edi, [esp + 8] ; edi <- Buffer - mov edx, ecx - and edx, 7 - shr ecx, 3 ; # of Qwords to set - jz @SetBytes - add esp, -10h - movq [esp], mm0 ; save mm0 - movq [esp + 8], mm1 ; save mm1 - movd mm0, eax - movd mm1, eax - psllq mm0, 32 - por mm0, mm1 ; fill mm0 with 8 Value's -@@: - movq [edi], mm0 - add edi, 8 - loop @B - movq mm0, [esp] ; restore mm0 - movq mm1, [esp + 8] ; restore mm1 - add esp, 10h ; stack cleanup -@SetBytes: - mov ecx, edx - rep stosb - mov eax, [esp + 8] ; eax <- Buffer as return value - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.asm b/MdePkg/Lib= rary/BaseMemoryLibMmx/Ia32/SetMem16.asm deleted file mode 100644 index 8d5bca0..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.asm +++ /dev/null @@ -1,63 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES edi - mov eax, [esp + 16] - shrd edx, eax, 16 - shld eax, edx, 16 - mov edx, [esp + 12] - mov edi, [esp + 8] - mov ecx, edx - and edx, 3 - shr ecx, 2 - jz @SetWords - movd mm0, eax - movd mm1, eax - psllq mm0, 32 - por mm0, mm1 -@@: - movq [edi], mm0 - add edi, 8 - loop @B -@SetWords: - mov ecx, edx - rep stosw - mov eax, [esp + 8] - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.asm b/MdePkg/Lib= rary/BaseMemoryLibMmx/Ia32/SetMem32.asm deleted file mode 100644 index 031c48a..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.asm +++ /dev/null @@ -1,59 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC - mov eax, [esp + 4] ; eax <- Buffer as return value - mov ecx, [esp + 8] ; ecx <- Count - movd mm0, dword ptr [esp + 12] ; mm0 <- Value - shr ecx, 1 ; ecx <- number of qwords to set - mov edx, eax ; edx <- Buffer - jz @SetDwords - movq mm1, mm0 - psllq mm1, 32 - por mm0, mm1 -@@: - movq qword ptr [edx], mm0 - lea edx, [edx + 8] ; use "lea" to avoid change in fla= gs - loop @B -@SetDwords: - jnc @F - movd dword ptr [edx], mm0 -@@: - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.asm b/MdePkg/Lib= rary/BaseMemoryLibMmx/Ia32/SetMem64.asm deleted file mode 100644 index 42870bd..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.asm +++ /dev/null @@ -1,50 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC - mov eax, [esp + 4] - mov ecx, [esp + 8] - movq mm0, [esp + 12] - mov edx, eax -@@: - movq [edx], mm0 - add edx, 8 - loop @B - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.asm b/MdePkg/Libr= ary/BaseMemoryLibMmx/Ia32/ZeroMem.asm deleted file mode 100644 index 1676b35..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.asm +++ /dev/null @@ -1,56 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .mmx - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES edi - mov edi, [esp + 8] - mov ecx, [esp + 12] - mov edx, ecx - shr ecx, 3 - jz @ZeroBytes - pxor mm0, mm0 -@@: - movq [edi], mm0 - add edi, 8 - loop @B -@ZeroBytes: - and edx, 7 - xor eax, eax - mov ecx, edx - rep stosb - mov eax, [esp + 8] - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.asm b/MdePkg/Li= brary/BaseMemoryLibMmx/X64/CompareMem.asm deleted file mode 100644 index 0ef05b2..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.asm +++ /dev/null @@ -1,54 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES rsi rdi - mov rsi, rcx - mov rdi, rdx - mov rcx, r8 - repe cmpsb - movzx rax, byte ptr [rsi - 1] - movzx rdx, byte ptr [rdi - 1] - sub rax, rdx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.asm b/MdePkg/Libra= ry/BaseMemoryLibMmx/X64/CopyMem.asm deleted file mode 100644 index 6e74985..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.asm +++ /dev/null @@ -1,70 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemCopyMem ( -; OUT VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES rsi rdi - mov rsi, rdx ; rsi <- Source - mov rdi, rcx ; rdi <- Destination - lea r9, [rsi + r8 - 1] ; r9 <- End of Source - cmp rsi, rdi - mov rax, rdi ; rax <- Destination as return val= ue - jae @F - cmp r9, rdi - jae @CopyBackward ; Copy backward if overlapped -@@: - mov rcx, r8 - and r8, 7 - shr rcx, 3 ; rcx <- # of Qwords to copy - jz @CopyBytes - DB 49h, 0fh, 7eh, 0c2h ; movd r10, mm0 (Save mm0 in r10) -@@: - DB 0fh, 6fh, 06h ; movd mm0, [rsi] - DB 0fh, 0e7h, 07h ; movntq [rdi], mm0 - add rsi, 8 - add rdi, 8 - loop @B - mfence - DB 49h, 0fh, 6eh, 0c2h ; movd mm0, r10 (Restore mm0) - jmp @CopyBytes -@CopyBackward: - mov rsi, r9 ; rsi <- End of Source - lea rdi, [rdi + r8 - 1] ; rdi <- End of Destination - std ; set direction flag -@CopyBytes: - mov rcx, r8 - rep movsb ; Copy bytes backward - cld - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.asm b/MdePkg/Lib= rary/BaseMemoryLibMmx/X64/ScanMem16.asm deleted file mode 100644 index a6114db..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasw - lea rax, [rdi - 2] - cmovnz rax, rcx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.asm b/MdePkg/Lib= rary/BaseMemoryLibMmx/X64/ScanMem32.asm deleted file mode 100644 index 40ff6c9..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasd - lea rax, [rdi - 4] - cmovnz rax, rcx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.asm b/MdePkg/Lib= rary/BaseMemoryLibMmx/X64/ScanMem64.asm deleted file mode 100644 index e78da7d..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasq - lea rax, [rdi - 8] - cmovnz rax, rcx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.asm b/MdePkg/Libr= ary/BaseMemoryLibMmx/X64/ScanMem8.asm deleted file mode 100644 index fee2397..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES rdi - mov rdi, rcx - mov rcx, rdx - mov rax, r8 - repne scasb - lea rax, [rdi - 1] - cmovnz rax, rcx ; set rax to 0 if not found - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.asm b/MdePkg/Librar= y/BaseMemoryLibMmx/X64/SetMem.asm deleted file mode 100644 index 9ff949c..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.asm +++ /dev/null @@ -1,58 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem ( -; OUT VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES rdi - mov rax, r8 - mov ah, al - DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax - mov r8, rcx - mov rdi, r8 ; rdi <- Buffer - mov rcx, rdx - and edx, 7 - shr rcx, 3 - jz @SetBytes - DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h -@@: - DB 0fh, 0e7h, 07h ; movntq [rdi], mm0 - add rdi, 8 - loop @B - mfence -@SetBytes: - mov ecx, edx - rep stosb - mov rax, r8 - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.asm b/MdePkg/Libr= ary/BaseMemoryLibMmx/X64/SetMem16.asm deleted file mode 100644 index fbd98b0..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.asm +++ /dev/null @@ -1,57 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem16 ( -; OUT VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES rdi - mov rax, r8 - DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax - mov r8, rcx - mov rdi, r8 - mov rcx, rdx - and edx, 3 - shr rcx, 2 - jz @SetWords - DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h -@@: - DB 0fh, 0e7h, 07h ; movntq [rdi], mm0 - add rdi, 8 - loop @B - mfence -@SetWords: - mov ecx, edx - rep stosw - mov rax, r8 - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.asm b/MdePkg/Libr= ary/BaseMemoryLibMmx/X64/SetMem32.asm deleted file mode 100644 index a0bdd89..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC - DB 49h, 0fh, 6eh, 0c0h ; movd mm0, r8 (Value) - mov rax, rcx ; rax <- Buffer - xchg rcx, rdx ; rcx <- Count rdx <- Buffer - shr rcx, 1 ; rcx <- # of qwords to set - jz @SetDwords - DB 0fh, 70h, 0C0h, 44h ; pshufw mm0, mm0, 44h -@@: - DB 0fh, 0e7h, 02h ; movntq [rdx], mm0 - lea rdx, [rdx + 8] ; use "lea" to avoid flag changes - loop @B - mfence -@SetDwords: - jnc @F - DB 0fh, 7eh, 02h ; movd [rdx], mm0 -@@: - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.asm b/MdePkg/Libr= ary/BaseMemoryLibMmx/X64/SetMem64.asm deleted file mode 100644 index f26177f..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.asm +++ /dev/null @@ -1,46 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC - DB 49h, 0fh, 6eh, 0c0h ; movd mm0, r8 (Value) - mov rax, rcx ; rax <- Buffer - xchg rcx, rdx ; rcx <- Count -@@: - DB 0fh, 0e7h, 02h ; movntq [rdx], mm0 - add rdx, 8 - loop @B - mfence - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.asm b/MdePkg/Libra= ry/BaseMemoryLibMmx/X64/ZeroMem.asm deleted file mode 100644 index 0fcf50c..0000000 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.asm +++ /dev/null @@ -1,54 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES rdi - mov rdi, rcx - mov rcx, rdx - mov r8, rdi - and edx, 7 - shr rcx, 3 - jz @ZeroBytes - DB 0fh, 0efh, 0c0h ; pxor mm0, mm0 -@@: - DB 0fh, 0e7h, 7 ; movntq [rdi], mm0 - add rdi, 8 - loop @B - DB 0fh, 0aeh, 0f0h ; mfence -@ZeroBytes: - xor eax, eax - mov ecx, edx - rep stosb - mov rax, r8 - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf b/M= dePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf index bc5ec2f..3be1a24 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf +++ b/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf @@ -57,63 +57,41 @@ Ia32/CopyMem.nasm Ia32/CopyMem.S Ia32/ScanMem64.nasm - Ia32/ScanMem64.asm Ia32/ScanMem32.nasm - Ia32/ScanMem32.asm Ia32/ScanMem16.nasm - Ia32/ScanMem16.asm Ia32/ScanMem8.nasm - Ia32/ScanMem8.asm Ia32/CompareMem.nasm - Ia32/CompareMem.asm Ia32/ZeroMem.nasm - Ia32/ZeroMem.asm Ia32/SetMem64.nasm - Ia32/SetMem64.asm Ia32/SetMem32.nasm - Ia32/SetMem32.asm Ia32/SetMem16.nasm - Ia32/SetMem16.asm Ia32/SetMem.nasm - Ia32/SetMem.asm Ia32/CopyMem.nasm - Ia32/CopyMem.asm Ia32/IsZeroBuffer.nasm MemLibGuid.c =20 [Sources.X64] X64/ScanMem64.nasm - X64/ScanMem64.asm X64/ScanMem64.S X64/ScanMem32.nasm - X64/ScanMem32.asm X64/ScanMem32.S X64/ScanMem16.nasm - X64/ScanMem16.asm X64/ScanMem16.S X64/ScanMem8.nasm - X64/ScanMem8.asm X64/ScanMem8.S X64/CompareMem.nasm - X64/CompareMem.asm X64/CompareMem.S X64/ZeroMem.nasm - X64/ZeroMem.asm X64/ZeroMem.S X64/SetMem64.nasm - X64/SetMem64.asm X64/SetMem64.S X64/SetMem32.nasm - X64/SetMem32.asm X64/SetMem32.S X64/SetMem16.nasm - X64/SetMem16.asm X64/SetMem16.S X64/SetMem.nasm - X64/SetMem.asm X64/SetMem.S X64/CopyMem.nasm - X64/CopyMem.asm X64/CopyMem.S X64/IsZeroBuffer.nasm MemLibGuid.c diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.asm b/MdePk= g/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.asm deleted file mode 100644 index 5a0792d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.asm +++ /dev/null @@ -1,56 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES esi edi - mov esi, [esp + 12] - mov edi, [esp + 16] - mov ecx, [esp + 20] - repe cmpsb - movzx eax, byte ptr [esi - 1] - movzx edx, byte ptr [edi - 1] - sub eax, edx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.asm b/MdePkg/L= ibrary/BaseMemoryLibOptDxe/Ia32/CopyMem.asm deleted file mode 100644 index a57a628..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.asm +++ /dev/null @@ -1,84 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES esi edi - mov esi, [esp + 16] ; esi <- Source - mov edi, [esp + 12] ; edi <- Destination - mov edx, [esp + 20] ; edx <- Count - lea eax, [esi + edx - 1] ; eax <- End of Source - cmp esi, edi - jae @F - cmp eax, edi ; Overlapped? - jae @CopyBackward ; Copy backward if overlapped -@@: - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boun= dary - jz @F - cmp ecx, edx - cmova ecx, edx - sub edx, ecx ; edx <- remaining bytes to copy - rep movsb -@@: - mov ecx, edx - and edx, 15 - shr ecx, 4 ; ecx <- # of DQwords to copy - jz @CopyBytes - add esp, -16 - movdqu [esp], xmm0 ; save xmm0 -@@: - movdqu xmm0, [esi] ; esi may not be 16-bytes aligned - movntdq [edi], xmm0 ; edi should be 16-bytes aligned - add esi, 16 - add edi, 16 - loop @B - mfence - movdqu xmm0, [esp] ; restore xmm0 - add esp, 16 ; stack cleanup - jmp @CopyBytes -@CopyBackward: - mov esi, eax ; esi <- Last byte in Source - lea edi, [edi + edx - 1] ; edi <- Last byte in Destination - std -@CopyBytes: - mov ecx, edx - rep movsb - cld - mov eax, [esp + 12] ; eax <- Destination as return val= ue - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.asm b/MdePkg= /Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.asm deleted file mode 100644 index 0ee190e..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasw - lea eax, [edi - 2] - cmovnz eax, ecx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.asm b/MdePkg= /Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.asm deleted file mode 100644 index adbf295..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasd - lea eax, [edi - 4] - cmovnz eax, ecx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.asm b/MdePkg= /Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.asm deleted file mode 100644 index 0a0f5d0..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.asm +++ /dev/null @@ -1,64 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - cmp eax, [edi] - lea edi, [edi + 8] - loopne @B - jne @F - cmp edx, [edi - 4] - jecxz @F - jne @B -@@: - lea eax, [edi - 8] - cmovne eax, ecx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.asm b/MdePkg/= Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.asm deleted file mode 100644 index c64d41d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov al, [esp + 16] - repne scasb - lea eax, [edi - 1] - cmovnz eax, ecx - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.asm b/MdePkg/Li= brary/BaseMemoryLibOptDxe/Ia32/SetMem.asm deleted file mode 100644 index 663d238..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.Asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES edi - mov ecx, [esp + 12] - mov al, [esp + 16] - mov ah, al - shrd edx, eax, 16 - shld eax, edx, 16 - mov edx, ecx - mov edi, [esp + 8] - shr ecx, 2 - rep stosd - mov ecx, edx - and ecx, 3 - rep stosb - mov eax, [esp + 8] - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.asm b/MdePkg/= Library/BaseMemoryLibOptDxe/Ia32/SetMem16.asm deleted file mode 100644 index 3f3350d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.Asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES edi - mov eax, [esp + 16] - mov edi, [esp + 8] - mov ecx, [esp + 12] - rep stosw - mov eax, [esp + 8] - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.asm b/MdePkg/= Library/BaseMemoryLibOptDxe/Ia32/SetMem32.asm deleted file mode 100644 index b27b85b..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.Asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES edi - mov eax, [esp + 16] - mov edi, [esp + 8] - mov ecx, [esp + 12] - rep stosd - mov eax, [esp + 8] - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.asm b/MdePkg/= Library/BaseMemoryLibOptDxe/Ia32/SetMem64.asm deleted file mode 100644 index 146f3b9..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.asm +++ /dev/null @@ -1,49 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.Asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - mov [edi + ecx*8 - 8], eax - mov [edi + ecx*8 - 4], edx - loop @B - mov eax, edi - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.asm b/MdePkg/L= ibrary/BaseMemoryLibOptDxe/Ia32/ZeroMem.asm deleted file mode 100644 index 722bf67..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.asm +++ /dev/null @@ -1,50 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.Asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES edi - xor eax, eax - mov edi, [esp + 8] - mov ecx, [esp + 12] - mov edx, ecx - shr ecx, 2 - and edx, 3 - push edi - rep stosd - mov ecx, edx - rep stosb - pop eax - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.asm b/MdePkg= /Library/BaseMemoryLibOptDxe/X64/CompareMem.asm deleted file mode 100644 index 0ef05b2..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.asm +++ /dev/null @@ -1,54 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES rsi rdi - mov rsi, rcx - mov rdi, rdx - mov rcx, r8 - repe cmpsb - movzx rax, byte ptr [rsi - 1] - movzx rdx, byte ptr [rdi - 1] - sub rax, rdx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.asm b/MdePkg/Li= brary/BaseMemoryLibOptDxe/X64/CopyMem.asm deleted file mode 100644 index 8bcaca7..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.asm +++ /dev/null @@ -1,79 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES rsi rdi - mov rsi, rdx ; rsi <- Source - mov rdi, rcx ; rdi <- Destination - lea r9, [rsi + r8 - 1] ; r9 <- Last byte of Source - cmp rsi, rdi - mov rax, rdi ; rax <- Destination as return val= ue - jae @F ; Copy forward if Source > Destina= tion - cmp r9, rdi ; Overlapped? - jae @CopyBackward ; Copy backward if overlapped -@@: - xor rcx, rcx - sub rcx, rdi ; rcx <- -rdi - and rcx, 15 ; rcx + rsi should be 16 bytes ali= gned - jz @F ; skip if rcx =3D=3D 0 - cmp rcx, r8 - cmova rcx, r8 - sub r8, rcx - rep movsb -@@: - mov rcx, r8 - and r8, 15 - shr rcx, 4 ; rcx <- # of DQwords to copy - jz @CopyBytes - movdqa [rsp + 18h], xmm0 ; save xmm0 on stack -@@: - movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned - movntdq [rdi], xmm0 ; rdi should be 16-byte aligned - add rsi, 16 - add rdi, 16 - loop @B - mfence - movdqa xmm0, [rsp + 18h] ; restore xmm0 - jmp @CopyBytes ; copy remaining bytes -@CopyBackward: - mov rsi, r9 ; rsi <- Last byte of Source - lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination - std -@CopyBytes: - mov rcx, r8 - rep movsb - cld - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.asm b/MdePkg/= Library/BaseMemoryLibOptDxe/X64/ScanMem16.asm deleted file mode 100644 index a6114db..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasw - lea rax, [rdi - 2] - cmovnz rax, rcx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.asm b/MdePkg/= Library/BaseMemoryLibOptDxe/X64/ScanMem32.asm deleted file mode 100644 index 40ff6c9..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasd - lea rax, [rdi - 4] - cmovnz rax, rcx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.asm b/MdePkg/= Library/BaseMemoryLibOptDxe/X64/ScanMem64.asm deleted file mode 100644 index e78da7d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasq - lea rax, [rdi - 8] - cmovnz rax, rcx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.asm b/MdePkg/L= ibrary/BaseMemoryLibOptDxe/X64/ScanMem8.asm deleted file mode 100644 index fee2397..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES rdi - mov rdi, rcx - mov rcx, rdx - mov rax, r8 - repne scasb - lea rax, [rdi - 1] - cmovnz rax, rcx ; set rax to 0 if not found - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.asm b/MdePkg/Lib= rary/BaseMemoryLibOptDxe/X64/SetMem.asm deleted file mode 100644 index 5ca1571..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.asm +++ /dev/null @@ -1,58 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.Asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES rdi rbx - push rcx ; push Buffer - mov rax, r8 ; rax =3D Value - and rax, 0ffh ; rax =3D lower 8 bits of r8, upper 56 bits are 0 - mov ah, al ; ah =3D al - mov bx, ax ; bx =3D ax - shl rax, 10h ; rax =3D ax << 16 - mov ax, bx ; ax =3D bx - mov rbx, rax ; ebx =3D eax - shl rax, 20h ; rax =3D rax << 32 - or rax, rbx ; eax =3D ebx - mov rdi, rcx ; rdi =3D Buffer - mov rcx, rdx ; rcx =3D Count - shr rcx, 3 ; rcx =3D rcx / 8 - cld - rep stosq=20 - mov rcx, rdx ; rcx =3D rdx - and rcx, 7 ; rcx =3D rcx & 7 - rep stosb=20 - pop rax ; rax =3D Buffer - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.asm b/MdePkg/L= ibrary/BaseMemoryLibOptDxe/X64/SetMem16.asm deleted file mode 100644 index 1ac3b8d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.Asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES rdi - push rcx - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosw - pop rax - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.asm b/MdePkg/L= ibrary/BaseMemoryLibOptDxe/X64/SetMem32.asm deleted file mode 100644 index 4a42b2f..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.Asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES rdi - push rcx - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosd - pop rax - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.asm b/MdePkg/L= ibrary/BaseMemoryLibOptDxe/X64/SetMem64.asm deleted file mode 100644 index 9611c4c..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.Asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC USES rdi - push rcx - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosq - pop rax - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.asm b/MdePkg/Li= brary/BaseMemoryLibOptDxe/X64/ZeroMem.asm deleted file mode 100644 index 29398fb..0000000 --- a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.asm +++ /dev/null @@ -1,48 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.Asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES rdi - push rcx ; push Buffer - xor rax, rax ; rax =3D 0 - mov rdi, rcx ; rdi =3D Buffer - mov rcx, rdx ; rcx =3D Count - shr rcx, 3 ; rcx =3D rcx / 8 - and rdx, 7 ; rdx =3D rdx & 7 - cld - rep stosq - mov rcx, rdx ; rcx =3D rdx - rep stosb - pop rax ; rax =3D Buffer - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf b/M= dePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf index 21f060e..db4a2fb 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf +++ b/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf @@ -57,27 +57,16 @@ Ia32/CopyMem.nasm Ia32/CopyMem.S Ia32/ScanMem64.nasm - Ia32/ScanMem64.asm Ia32/ScanMem32.nasm - Ia32/ScanMem32.asm Ia32/ScanMem16.nasm - Ia32/ScanMem16.asm Ia32/ScanMem8.nasm - Ia32/ScanMem8.asm Ia32/CompareMem.nasm - Ia32/CompareMem.asm Ia32/ZeroMem.nasm - Ia32/ZeroMem.asm Ia32/SetMem64.nasm - Ia32/SetMem64.asm Ia32/SetMem32.nasm - Ia32/SetMem32.asm Ia32/SetMem16.nasm - Ia32/SetMem16.asm Ia32/SetMem.nasm - Ia32/SetMem.asm Ia32/CopyMem.nasm - Ia32/CopyMem.asm Ia32/IsZeroBuffer.nasm ScanMem64Wrapper.c ScanMem32Wrapper.c @@ -95,37 +84,26 @@ =20 [Sources.X64] X64/ScanMem64.nasm - X64/ScanMem64.asm X64/ScanMem64.S X64/ScanMem32.nasm - X64/ScanMem32.asm X64/ScanMem32.S X64/ScanMem16.nasm - X64/ScanMem16.asm X64/ScanMem16.S X64/ScanMem8.nasm - X64/ScanMem8.asm X64/ScanMem8.S X64/CompareMem.nasm - X64/CompareMem.asm X64/CompareMem.S X64/ZeroMem.nasm - X64/ZeroMem.asm X64/ZeroMem.S X64/SetMem64.nasm - X64/SetMem64.asm X64/SetMem64.S X64/SetMem32.nasm - X64/SetMem32.asm X64/SetMem32.S X64/SetMem16.nasm - X64/SetMem16.asm X64/SetMem16.S X64/SetMem.nasm - X64/SetMem.asm X64/SetMem.S X64/CopyMem.nasm - X64/CopyMem.asm X64/CopyMem.S X64/IsZeroBuffer.nasm ScanMem64Wrapper.c diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.asm b/MdePk= g/Library/BaseMemoryLibOptPei/Ia32/CompareMem.asm deleted file mode 100644 index 5a0792d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.asm +++ /dev/null @@ -1,56 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES esi edi - mov esi, [esp + 12] - mov edi, [esp + 16] - mov ecx, [esp + 20] - repe cmpsb - movzx eax, byte ptr [esi - 1] - movzx edx, byte ptr [edi - 1] - sub eax, edx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.asm b/MdePkg/L= ibrary/BaseMemoryLibOptPei/Ia32/CopyMem.asm deleted file mode 100644 index 6f8d007..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.asm +++ /dev/null @@ -1,61 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.Asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ) -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES esi edi - mov esi, [esp+16] ; esi <- Source - mov edi, [esp+12] ; edi <- Destination - mov edx, [esp+20] ; edx <- Count - cmp esi, edi - je @CopyDone - cmp edx, 0 - je @CopyDone - lea eax, [esi + edx - 1] ; eax <- End of Source - cmp esi, edi - jae @CopyBytes - cmp eax, edi - jb @CopyBytes ; Copy backward if overlapped - mov esi, eax ; esi <- End of Source - lea edi, [edi + edx - 1] ; edi <- End of Destination - std -@CopyBytes: - mov ecx, edx - rep movsb ; Copy bytes backward - cld -@CopyDone: - mov eax, [esp + 12] ; eax <- Destination as return val= ue - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.asm b/MdePkg= /Library/BaseMemoryLibOptPei/Ia32/ScanMem16.asm deleted file mode 100644 index 0ee190e..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasw - lea eax, [edi - 2] - cmovnz eax, ecx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.asm b/MdePkg= /Library/BaseMemoryLibOptPei/Ia32/ScanMem32.asm deleted file mode 100644 index adbf295..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasd - lea eax, [edi - 4] - cmovnz eax, ecx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.asm b/MdePkg= /Library/BaseMemoryLibOptPei/Ia32/ScanMem64.asm deleted file mode 100644 index 0a0f5d0..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.asm +++ /dev/null @@ -1,64 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - cmp eax, [edi] - lea edi, [edi + 8] - loopne @B - jne @F - cmp edx, [edi - 4] - jecxz @F - jne @B -@@: - lea eax, [edi - 8] - cmovne eax, ecx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.asm b/MdePkg/= Library/BaseMemoryLibOptPei/Ia32/ScanMem8.asm deleted file mode 100644 index c64d41d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov al, [esp + 16] - repne scasb - lea eax, [edi - 1] - cmovnz eax, ecx - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.asm b/MdePkg/Li= brary/BaseMemoryLibOptPei/Ia32/SetMem.asm deleted file mode 100644 index 663d238..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.Asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES edi - mov ecx, [esp + 12] - mov al, [esp + 16] - mov ah, al - shrd edx, eax, 16 - shld eax, edx, 16 - mov edx, ecx - mov edi, [esp + 8] - shr ecx, 2 - rep stosd - mov ecx, edx - and ecx, 3 - rep stosb - mov eax, [esp + 8] - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.asm b/MdePkg/= Library/BaseMemoryLibOptPei/Ia32/SetMem16.asm deleted file mode 100644 index 3f3350d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.Asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES edi - mov eax, [esp + 16] - mov edi, [esp + 8] - mov ecx, [esp + 12] - rep stosw - mov eax, [esp + 8] - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.asm b/MdePkg/= Library/BaseMemoryLibOptPei/Ia32/SetMem32.asm deleted file mode 100644 index b27b85b..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.Asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES edi - mov eax, [esp + 16] - mov edi, [esp + 8] - mov ecx, [esp + 12] - rep stosd - mov eax, [esp + 8] - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.asm b/MdePkg/= Library/BaseMemoryLibOptPei/Ia32/SetMem64.asm deleted file mode 100644 index 146f3b9..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.asm +++ /dev/null @@ -1,49 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.Asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - mov [edi + ecx*8 - 8], eax - mov [edi + ecx*8 - 4], edx - loop @B - mov eax, edi - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.asm b/MdePkg/L= ibrary/BaseMemoryLibOptPei/Ia32/ZeroMem.asm deleted file mode 100644 index 722bf67..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.asm +++ /dev/null @@ -1,50 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.Asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES edi - xor eax, eax - mov edi, [esp + 8] - mov ecx, [esp + 12] - mov edx, ecx - shr ecx, 2 - and edx, 3 - push edi - rep stosd - mov ecx, edx - rep stosb - pop eax - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.asm b/MdePkg= /Library/BaseMemoryLibOptPei/X64/CompareMem.asm deleted file mode 100644 index 0ef05b2..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.asm +++ /dev/null @@ -1,54 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES rsi rdi - mov rsi, rcx - mov rdi, rdx - mov rcx, r8 - repe cmpsb - movzx rax, byte ptr [rsi - 1] - movzx rdx, byte ptr [rdi - 1] - sub rax, rdx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.asm b/MdePkg/Li= brary/BaseMemoryLibOptPei/X64/CopyMem.asm deleted file mode 100644 index df2e7cc..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.asm +++ /dev/null @@ -1,61 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.Asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ) -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES rsi rdi - mov rsi, rdx ; rsi <- Source - mov rdi, rcx ; rdi <- Destination - lea r9, [rsi + r8 - 1] ; r9 <- End of Source - cmp rsi, rdi - mov rax, rdi ; rax <- Destination as return val= ue - jae @F - cmp r9, rdi - jae @CopyBackward ; Copy backward if overlapped -@@: - mov rcx, r8 - and r8, 7 - shr rcx, 3 - rep movsq ; Copy as many Qwords as possible - jmp @CopyBytes -@CopyBackward: - mov rsi, r9 ; rsi <- End of Source - lea rdi, [rdi + r8 - 1] ; esi <- End of Destination - std ; set direction flag -@CopyBytes: - mov rcx, r8 - rep movsb ; Copy bytes backward - cld - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.asm b/MdePkg/= Library/BaseMemoryLibOptPei/X64/ScanMem16.asm deleted file mode 100644 index a6114db..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasw - lea rax, [rdi - 2] - cmovnz rax, rcx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.asm b/MdePkg/= Library/BaseMemoryLibOptPei/X64/ScanMem32.asm deleted file mode 100644 index 40ff6c9..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasd - lea rax, [rdi - 4] - cmovnz rax, rcx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.asm b/MdePkg/= Library/BaseMemoryLibOptPei/X64/ScanMem64.asm deleted file mode 100644 index e78da7d..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasq - lea rax, [rdi - 8] - cmovnz rax, rcx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.asm b/MdePkg/L= ibrary/BaseMemoryLibOptPei/X64/ScanMem8.asm deleted file mode 100644 index fee2397..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES rdi - mov rdi, rcx - mov rcx, rdx - mov rax, r8 - repne scasb - lea rax, [rdi - 1] - cmovnz rax, rcx ; set rax to 0 if not found - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.asm b/MdePkg/Lib= rary/BaseMemoryLibOptPei/X64/SetMem.asm deleted file mode 100644 index 72b6405..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.Asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES rdi - push rcx ; push Buffer - mov rax, r8 ; rax =3D Value - mov rdi, rcx ; rdi =3D Buffer - mov rcx, rdx ; rcx =3D Count - rep stosb - pop rax ; rax =3D Buffer - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.asm b/MdePkg/L= ibrary/BaseMemoryLibOptPei/X64/SetMem16.asm deleted file mode 100644 index 446e3a3..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.Asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosw - mov rax, rdx - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.asm b/MdePkg/L= ibrary/BaseMemoryLibOptPei/X64/SetMem32.asm deleted file mode 100644 index abe733e..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.Asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosd - mov rax, rdx - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.asm b/MdePkg/L= ibrary/BaseMemoryLibOptPei/X64/SetMem64.asm deleted file mode 100644 index 0a91105..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.Asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosq - mov rax, rdx - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.asm b/MdePkg/Li= brary/BaseMemoryLibOptPei/X64/ZeroMem.asm deleted file mode 100644 index fc4403a..0000000 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.asm +++ /dev/null @@ -1,47 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.Asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES rdi - push rcx - xor rax, rax - mov rdi, rcx - mov rcx, rdx - shr rcx, 3 - and rdx, 7 - rep stosq - mov ecx, edx - rep stosb - pop rax - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf b/M= dePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf index 729e26a..892d069 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf +++ b/MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf @@ -70,27 +70,16 @@ Ia32/CopyMem.nasm Ia32/CopyMem.S Ia32/ScanMem64.nasm - Ia32/ScanMem64.asm Ia32/ScanMem32.nasm - Ia32/ScanMem32.asm Ia32/ScanMem16.nasm - Ia32/ScanMem16.asm Ia32/ScanMem8.nasm - Ia32/ScanMem8.asm Ia32/CompareMem.nasm - Ia32/CompareMem.asm Ia32/ZeroMem.nasm - Ia32/ZeroMem.asm Ia32/SetMem64.nasm - Ia32/SetMem64.asm Ia32/SetMem32.nasm - Ia32/SetMem32.asm Ia32/SetMem16.nasm - Ia32/SetMem16.asm Ia32/SetMem.nasm - Ia32/SetMem.asm Ia32/CopyMem.nasm - Ia32/CopyMem.asm Ia32/IsZeroBuffer.nasm =20 [Sources.X64] @@ -117,27 +106,16 @@ X64/CopyMem.nasm X64/CopyMem.S X64/ScanMem64.nasm - X64/ScanMem64.asm X64/ScanMem32.nasm - X64/ScanMem32.asm X64/ScanMem16.nasm - X64/ScanMem16.asm X64/ScanMem8.nasm - X64/ScanMem8.asm X64/CompareMem.nasm - X64/CompareMem.asm X64/ZeroMem.nasm - X64/ZeroMem.asm X64/SetMem64.nasm - X64/SetMem64.asm X64/SetMem32.nasm - X64/SetMem32.asm X64/SetMem16.nasm - X64/SetMem16.asm X64/SetMem.nasm - X64/SetMem.asm X64/CopyMem.nasm - X64/CopyMem.asm X64/IsZeroBuffer.nasm =20 [Packages] diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm b/MdePk= g/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm deleted file mode 100644 index 5a0792d..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm +++ /dev/null @@ -1,56 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES esi edi - mov esi, [esp + 12] - mov edi, [esp + 16] - mov ecx, [esp + 20] - repe cmpsb - movzx eax, byte ptr [esi - 1] - movzx edx, byte ptr [edi - 1] - sub eax, edx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm b/MdePkg/L= ibrary/BaseMemoryLibRepStr/Ia32/CopyMem.asm deleted file mode 100644 index cdb3520..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm +++ /dev/null @@ -1,63 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.Asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ) -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES esi edi - mov esi, [esp + 16] ; esi <- Source - mov edi, [esp + 12] ; edi <- Destination - mov edx, [esp + 20] ; edx <- Count - lea eax, [esi + edx - 1] ; eax <- End of Source - cmp esi, edi - jae @F - cmp eax, edi - jae @CopyBackward ; Copy backward if overlapped -@@: - mov ecx, edx - and edx, 3 - shr ecx, 2 - rep movsd ; Copy as many Dwords as possible - jmp @CopyBytes -@CopyBackward: - mov esi, eax ; esi <- End of Source - lea edi, [edi + edx - 1] ; edi <- End of Destination - std -@CopyBytes: - mov ecx, edx - rep movsb ; Copy bytes backward - cld - mov eax, [esp + 12] ; eax <- Destination as return val= ue - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm b/MdePkg= /Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm deleted file mode 100644 index c12eaff..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm +++ /dev/null @@ -1,57 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasw - lea eax, [edi - 2] - jz @F - mov eax, ecx -@@: =20 - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm b/MdePkg= /Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm deleted file mode 100644 index b065620..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm +++ /dev/null @@ -1,57 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasd - lea eax, [edi - 4] - jz @F - mov eax, ecx -@@: =20 - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm b/MdePkg= /Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm deleted file mode 100644 index 96e3b99..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm +++ /dev/null @@ -1,66 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - cmp eax, [edi] - lea edi, [edi + 8] - loopne @B - jne @F - cmp edx, [edi - 4] - jecxz @F - jne @B -@@: - lea eax, [edi - 8] - jz @F - mov eax, ecx -@@: =20 - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm b/MdePkg/= Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm deleted file mode 100644 index 202d58f..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm +++ /dev/null @@ -1,57 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov al, [esp + 16] - repne scasb - lea eax, [edi - 1] - jz @F - mov eax, ecx -@@: =20 - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.asm b/MdePkg/Li= brary/BaseMemoryLibRepStr/Ia32/SetMem.asm deleted file mode 100644 index 3fdaba9..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.Asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES edi - mov eax, [esp + 16] - mov edi, [esp + 8] - mov ecx, [esp + 12] - rep stosb - mov eax, [esp + 8] - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm b/MdePkg/= Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm deleted file mode 100644 index 3f3350d..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.Asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES edi - mov eax, [esp + 16] - mov edi, [esp + 8] - mov ecx, [esp + 12] - rep stosw - mov eax, [esp + 8] - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm b/MdePkg/= Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm deleted file mode 100644 index b27b85b..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.Asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES edi - mov eax, [esp + 16] - mov edi, [esp + 8] - mov ecx, [esp + 12] - rep stosd - mov eax, [esp + 8] - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm b/MdePkg/= Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm deleted file mode 100644 index 146f3b9..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm +++ /dev/null @@ -1,49 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.Asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - mov [edi + ecx*8 - 8], eax - mov [edi + ecx*8 - 4], edx - loop @B - mov eax, edi - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.asm b/MdePkg/L= ibrary/BaseMemoryLibRepStr/Ia32/ZeroMem.asm deleted file mode 100644 index 722bf67..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.asm +++ /dev/null @@ -1,50 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.Asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES edi - xor eax, eax - mov edi, [esp + 8] - mov ecx, [esp + 12] - mov edx, ecx - shr ecx, 2 - and edx, 3 - push edi - rep stosd - mov ecx, edx - rep stosb - pop eax - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/CompareMem.asm b/MdePkg= /Library/BaseMemoryLibRepStr/X64/CompareMem.asm deleted file mode 100644 index 0ef05b2..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/CompareMem.asm +++ /dev/null @@ -1,54 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES rsi rdi - mov rsi, rcx - mov rdi, rdx - mov rcx, r8 - repe cmpsb - movzx rax, byte ptr [rsi - 1] - movzx rdx, byte ptr [rdi - 1] - sub rax, rdx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/CopyMem.asm b/MdePkg/Li= brary/BaseMemoryLibRepStr/X64/CopyMem.asm deleted file mode 100644 index df2e7cc..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/CopyMem.asm +++ /dev/null @@ -1,61 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.Asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ) -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES rsi rdi - mov rsi, rdx ; rsi <- Source - mov rdi, rcx ; rdi <- Destination - lea r9, [rsi + r8 - 1] ; r9 <- End of Source - cmp rsi, rdi - mov rax, rdi ; rax <- Destination as return val= ue - jae @F - cmp r9, rdi - jae @CopyBackward ; Copy backward if overlapped -@@: - mov rcx, r8 - and r8, 7 - shr rcx, 3 - rep movsq ; Copy as many Qwords as possible - jmp @CopyBytes -@CopyBackward: - mov rsi, r9 ; rsi <- End of Source - lea rdi, [rdi + r8 - 1] ; esi <- End of Destination - std ; set direction flag -@CopyBytes: - mov rcx, r8 - rep movsb ; Copy bytes backward - cld - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem16.asm b/MdePkg/= Library/BaseMemoryLibRepStr/X64/ScanMem16.asm deleted file mode 100644 index a6114db..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem16.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasw - lea rax, [rdi - 2] - cmovnz rax, rcx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem32.asm b/MdePkg/= Library/BaseMemoryLibRepStr/X64/ScanMem32.asm deleted file mode 100644 index 40ff6c9..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem32.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasd - lea rax, [rdi - 4] - cmovnz rax, rcx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.asm b/MdePkg/= Library/BaseMemoryLibRepStr/X64/ScanMem64.asm deleted file mode 100644 index e78da7d..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem64.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasq - lea rax, [rdi - 8] - cmovnz rax, rcx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem8.asm b/MdePkg/L= ibrary/BaseMemoryLibRepStr/X64/ScanMem8.asm deleted file mode 100644 index fee2397..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/ScanMem8.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES rdi - mov rdi, rcx - mov rcx, rdx - mov rax, r8 - repne scasb - lea rax, [rdi - 1] - cmovnz rax, rcx ; set rax to 0 if not found - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem.asm b/MdePkg/Lib= rary/BaseMemoryLibRepStr/X64/SetMem.asm deleted file mode 100644 index ef15710..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.Asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES rdi - mov rax, r8 ; rax =3D Value - mov rdi, rcx ; rdi =3D Buffer - xchg rcx, rdx ; rcx =3D Count, rdx =3D Buffer - rep stosb - mov rax, rdx ; rax =3D Buffer - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem16.asm b/MdePkg/L= ibrary/BaseMemoryLibRepStr/X64/SetMem16.asm deleted file mode 100644 index 446e3a3..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem16.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.Asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosw - mov rax, rdx - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem32.asm b/MdePkg/L= ibrary/BaseMemoryLibRepStr/X64/SetMem32.asm deleted file mode 100644 index abe733e..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem32.asm +++ /dev/null @@ -1,44 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.Asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosd - mov rax, rdx - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem64.asm b/MdePkg/L= ibrary/BaseMemoryLibRepStr/X64/SetMem64.asm deleted file mode 100644 index 0a91105..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/SetMem64.asm +++ /dev/null @@ -1,43 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.Asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - xchg rcx, rdx - rep stosq - mov rax, rdx - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibRepStr/X64/ZeroMem.asm b/MdePkg/Li= brary/BaseMemoryLibRepStr/X64/ZeroMem.asm deleted file mode 100644 index fc4403a..0000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/X64/ZeroMem.asm +++ /dev/null @@ -1,47 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.Asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES rdi - push rcx - xor rax, rax - mov rdi, rcx - mov rcx, rdx - shr rcx, 3 - and rdx, 7 - rep stosq - mov ecx, edx - rep stosb - pop rax - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf b/MdePk= g/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf index fc82b16..71ca175 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf +++ b/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf @@ -69,52 +69,30 @@ Ia32/CopyMem.nasm Ia32/CopyMem.S Ia32/ScanMem64.nasm - Ia32/ScanMem64.asm Ia32/ScanMem32.nasm - Ia32/ScanMem32.asm Ia32/ScanMem16.nasm - Ia32/ScanMem16.asm Ia32/ScanMem8.nasm - Ia32/ScanMem8.asm Ia32/CompareMem.nasm - Ia32/CompareMem.asm Ia32/ZeroMem.nasm - Ia32/ZeroMem.asm Ia32/SetMem64.nasm - Ia32/SetMem64.asm Ia32/SetMem32.nasm - Ia32/SetMem32.asm Ia32/SetMem16.nasm - Ia32/SetMem16.asm Ia32/SetMem.nasm - Ia32/SetMem.asm Ia32/CopyMem.nasm - Ia32/CopyMem.asm Ia32/IsZeroBuffer.nasm =20 [Sources.X64] X64/ScanMem64.nasm - X64/ScanMem64.asm X64/ScanMem32.nasm - X64/ScanMem32.asm X64/ScanMem16.nasm - X64/ScanMem16.asm X64/ScanMem8.nasm - X64/ScanMem8.asm X64/CompareMem.nasm - X64/CompareMem.asm X64/ZeroMem.nasm - X64/ZeroMem.asm X64/SetMem64.nasm - X64/SetMem64.asm X64/SetMem32.nasm - X64/SetMem32.asm X64/SetMem16.nasm - X64/SetMem16.asm X64/SetMem.nasm - X64/SetMem.asm X64/CopyMem.nasm - X64/CopyMem.asm X64/ScanMem64.nasm X64/ScanMem64.S X64/ScanMem32.nasm diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.asm b/MdePkg/= Library/BaseMemoryLibSse2/Ia32/CompareMem.asm deleted file mode 100644 index 5a0792d..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.asm +++ /dev/null @@ -1,56 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES esi edi - mov esi, [esp + 12] - mov edi, [esp + 16] - mov ecx, [esp + 20] - repe cmpsb - movzx eax, byte ptr [esi - 1] - movzx edx, byte ptr [edi - 1] - sub eax, edx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm b/MdePkg/Lib= rary/BaseMemoryLibSse2/Ia32/CopyMem.asm deleted file mode 100644 index a57a628..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm +++ /dev/null @@ -1,84 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES esi edi - mov esi, [esp + 16] ; esi <- Source - mov edi, [esp + 12] ; edi <- Destination - mov edx, [esp + 20] ; edx <- Count - lea eax, [esi + edx - 1] ; eax <- End of Source - cmp esi, edi - jae @F - cmp eax, edi ; Overlapped? - jae @CopyBackward ; Copy backward if overlapped -@@: - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boun= dary - jz @F - cmp ecx, edx - cmova ecx, edx - sub edx, ecx ; edx <- remaining bytes to copy - rep movsb -@@: - mov ecx, edx - and edx, 15 - shr ecx, 4 ; ecx <- # of DQwords to copy - jz @CopyBytes - add esp, -16 - movdqu [esp], xmm0 ; save xmm0 -@@: - movdqu xmm0, [esi] ; esi may not be 16-bytes aligned - movntdq [edi], xmm0 ; edi should be 16-bytes aligned - add esi, 16 - add edi, 16 - loop @B - mfence - movdqu xmm0, [esp] ; restore xmm0 - add esp, 16 ; stack cleanup - jmp @CopyBytes -@CopyBackward: - mov esi, eax ; esi <- Last byte in Source - lea edi, [edi + edx - 1] ; edi <- Last byte in Destination - std -@CopyBytes: - mov ecx, edx - rep movsb - cld - mov eax, [esp + 12] ; eax <- Destination as return val= ue - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm b/MdePkg/L= ibrary/BaseMemoryLibSse2/Ia32/ScanMem16.asm deleted file mode 100644 index 0ee190e..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasw - lea eax, [edi - 2] - cmovnz eax, ecx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm b/MdePkg/L= ibrary/BaseMemoryLibSse2/Ia32/ScanMem32.asm deleted file mode 100644 index adbf295..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov eax, [esp + 16] - repne scasd - lea eax, [edi - 4] - cmovnz eax, ecx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm b/MdePkg/L= ibrary/BaseMemoryLibSse2/Ia32/ScanMem64.asm deleted file mode 100644 index 0a0f5d0..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm +++ /dev/null @@ -1,64 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES edi - mov ecx, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov edi, [esp + 8] -@@: - cmp eax, [edi] - lea edi, [edi + 8] - loopne @B - jne @F - cmp edx, [edi - 4] - jecxz @F - jne @B -@@: - lea eax, [edi - 8] - cmovne eax, ecx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm b/MdePkg/Li= brary/BaseMemoryLibSse2/Ia32/ScanMem8.asm deleted file mode 100644 index c64d41d..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm +++ /dev/null @@ -1,55 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES edi - mov ecx, [esp + 12] - mov edi, [esp + 8] - mov al, [esp + 16] - repne scasb - lea eax, [edi - 1] - cmovnz eax, ecx - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm b/MdePkg/Libr= ary/BaseMemoryLibSse2/Ia32/SetMem.asm deleted file mode 100644 index 369cc00..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm +++ /dev/null @@ -1,75 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES edi - mov edx, [esp + 12] ; edx <- Count - mov edi, [esp + 8] ; edi <- Buffer - mov al, [esp + 16] ; al <- Value - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boun= dary - jz @F - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosb -@@: - mov ecx, edx - and edx, 15 - shr ecx, 4 ; ecx <- # of DQwords to set - jz @SetBytes - mov ah, al ; ax <- Value | (Value << 8) - add esp, -16 - movdqu [esp], xmm0 ; save xmm0 - movd xmm0, eax - pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 t= imes - movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times -@@: - movntdq [edi], xmm0 ; edi should be 16-byte aligned - add edi, 16 - loop @B - mfence - movdqu xmm0, [esp] ; restore xmm0 - add esp, 16 ; stack cleanup -@SetBytes: - mov ecx, edx - rep stosb - mov eax, [esp + 8] ; eax <- Buffer as return value - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm b/MdePkg/Li= brary/BaseMemoryLibSse2/Ia32/SetMem16.asm deleted file mode 100644 index 3725512..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm +++ /dev/null @@ -1,71 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES edi - mov edx, [esp + 12] - mov edi, [esp + 8] - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boun= dary - mov eax, [esp + 16] - jz @F - shr ecx, 1 - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosw -@@: - mov ecx, edx - and edx, 7 - shr ecx, 3 - jz @SetWords - movd xmm0, eax - pshuflw xmm0, xmm0, 0 - movlhps xmm0, xmm0 -@@: - movntdq [edi], xmm0 ; edi should be 16-byte aligned - add edi, 16 - loop @B - mfence -@SetWords: - mov ecx, edx - rep stosw - mov eax, [esp + 8] - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm b/MdePkg/Li= brary/BaseMemoryLibSse2/Ia32/SetMem32.asm deleted file mode 100644 index 4c3aa42..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm +++ /dev/null @@ -1,70 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES edi - mov edx, [esp + 12] - mov edi, [esp + 8] - xor ecx, ecx - sub ecx, edi - and ecx, 15 ; ecx + edi aligns on 16-byte boun= dary - mov eax, [esp + 16] - jz @F - shr ecx, 2 - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosd -@@: - mov ecx, edx - and edx, 3 - shr ecx, 2 - jz @SetDwords - movd xmm0, eax - pshufd xmm0, xmm0, 0 -@@: - movntdq [edi], xmm0 - add edi, 16 - loop @B - mfence -@SetDwords: - mov ecx, edx - rep stosd - mov eax, [esp + 8] - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm b/MdePkg/Li= brary/BaseMemoryLibSse2/Ia32/SetMem64.asm deleted file mode 100644 index d6f52a0..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm +++ /dev/null @@ -1,64 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC - mov eax, [esp + 4] ; eax <- Buffer - mov ecx, [esp + 8] ; ecx <- Count - test al, 8 - mov edx, eax - movq xmm0, qword ptr [esp + 12] - jz @F - movq qword ptr [edx], xmm0 - add edx, 8 - dec ecx -@@: - shr ecx, 1 - jz @SetQwords - movlhps xmm0, xmm0 -@@: - movntdq [edx], xmm0 - lea edx, [edx + 16] - loop @B - mfence -@SetQwords: - jnc @F - movq qword ptr [edx], xmm0 -@@: - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm b/MdePkg/Lib= rary/BaseMemoryLibSse2/Ia32/ZeroMem.asm deleted file mode 100644 index 97252b1..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm +++ /dev/null @@ -1,67 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .xmm - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES edi - mov edi, [esp + 8] - mov edx, [esp + 12] - xor ecx, ecx - sub ecx, edi - xor eax, eax - and ecx, 15 - jz @F - cmp ecx, edx - cmova ecx, edx - sub edx, ecx - rep stosb -@@: - mov ecx, edx - and edx, 15 - shr ecx, 4 - jz @ZeroBytes - pxor xmm0, xmm0 -@@: - movntdq [edi], xmm0 - add edi, 16 - loop @B - mfence -@ZeroBytes: - mov ecx, edx - rep stosb - mov eax, [esp + 8] - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.asm b/MdePkg/L= ibrary/BaseMemoryLibSse2/X64/CompareMem.asm deleted file mode 100644 index 0ef05b2..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CompareMem.asm +++ /dev/null @@ -1,54 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CompareMem.Asm -; -; Abstract: -; -; CompareMem function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; INTN -; EFIAPI -; InternalMemCompareMem ( -; IN CONST VOID *DestinationBuffer, -; IN CONST VOID *SourceBuffer, -; IN UINTN Length -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCompareMem PROC USES rsi rdi - mov rsi, rcx - mov rdi, rdx - mov rcx, r8 - repe cmpsb - movzx rax, byte ptr [rsi - 1] - movzx rdx, byte ptr [rdi - 1] - sub rax, rdx - ret -InternalMemCompareMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.asm b/MdePkg/Libr= ary/BaseMemoryLibSse2/X64/CopyMem.asm deleted file mode 100644 index 8bcaca7..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.asm +++ /dev/null @@ -1,79 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; CopyMem.asm -; -; Abstract: -; -; CopyMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; EFIAPI -; InternalMemCopyMem ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINTN Count -; ); -;-------------------------------------------------------------------------= ----- -InternalMemCopyMem PROC USES rsi rdi - mov rsi, rdx ; rsi <- Source - mov rdi, rcx ; rdi <- Destination - lea r9, [rsi + r8 - 1] ; r9 <- Last byte of Source - cmp rsi, rdi - mov rax, rdi ; rax <- Destination as return val= ue - jae @F ; Copy forward if Source > Destina= tion - cmp r9, rdi ; Overlapped? - jae @CopyBackward ; Copy backward if overlapped -@@: - xor rcx, rcx - sub rcx, rdi ; rcx <- -rdi - and rcx, 15 ; rcx + rsi should be 16 bytes ali= gned - jz @F ; skip if rcx =3D=3D 0 - cmp rcx, r8 - cmova rcx, r8 - sub r8, rcx - rep movsb -@@: - mov rcx, r8 - and r8, 15 - shr rcx, 4 ; rcx <- # of DQwords to copy - jz @CopyBytes - movdqa [rsp + 18h], xmm0 ; save xmm0 on stack -@@: - movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned - movntdq [rdi], xmm0 ; rdi should be 16-byte aligned - add rsi, 16 - add rdi, 16 - loop @B - mfence - movdqa xmm0, [rsp + 18h] ; restore xmm0 - jmp @CopyBytes ; copy remaining bytes -@CopyBackward: - mov rsi, r9 ; rsi <- Last byte of Source - lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination - std -@CopyBytes: - mov rcx, r8 - rep movsb - cld - ret -InternalMemCopyMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.asm b/MdePkg/Li= brary/BaseMemoryLibSse2/X64/ScanMem16.asm deleted file mode 100644 index a6114db..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem16.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem16.Asm -; -; Abstract: -; -; ScanMem16 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem16 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT16 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem16 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasw - lea rax, [rdi - 2] - cmovnz rax, rcx - ret -InternalMemScanMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.asm b/MdePkg/Li= brary/BaseMemoryLibSse2/X64/ScanMem32.asm deleted file mode 100644 index 40ff6c9..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem32.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem32.Asm -; -; Abstract: -; -; ScanMem32 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem32 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT32 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem32 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasd - lea rax, [rdi - 4] - cmovnz rax, rcx - ret -InternalMemScanMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.asm b/MdePkg/Li= brary/BaseMemoryLibSse2/X64/ScanMem64.asm deleted file mode 100644 index e78da7d..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem64.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem64.Asm -; -; Abstract: -; -; ScanMem64 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem64 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT64 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem64 PROC USES rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasq - lea rax, [rdi - 8] - cmovnz rax, rcx - ret -InternalMemScanMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.asm b/MdePkg/Lib= rary/BaseMemoryLibSse2/X64/ScanMem8.asm deleted file mode 100644 index fee2397..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ScanMem8.asm +++ /dev/null @@ -1,53 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ScanMem8.Asm -; -; Abstract: -; -; ScanMem8 function -; -; Notes: -; -; The following BaseMemoryLib instances contain the same copy of this fi= le: -; -; BaseMemoryLibRepStr -; BaseMemoryLibMmx -; BaseMemoryLibSse2 -; BaseMemoryLibOptDxe -; BaseMemoryLibOptPei -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; CONST VOID * -; EFIAPI -; InternalMemScanMem8 ( -; IN CONST VOID *Buffer, -; IN UINTN Length, -; IN UINT8 Value -; ); -;-------------------------------------------------------------------------= ----- -InternalMemScanMem8 PROC USES rdi - mov rdi, rcx - mov rcx, rdx - mov rax, r8 - repne scasb - lea rax, [rdi - 1] - cmovnz rax, rcx ; set rax to 0 if not found - ret -InternalMemScanMem8 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.asm b/MdePkg/Libra= ry/BaseMemoryLibSse2/X64/SetMem.asm deleted file mode 100644 index 52b069c..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem.asm +++ /dev/null @@ -1,69 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem.asm -; -; Abstract: -; -; SetMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem PROC USES rdi - mov rdi, rcx ; rdi <- Buffer - mov al, r8b ; al <- Value - mov r9, rdi ; r9 <- Buffer as return value - xor rcx, rcx - sub rcx, rdi - and rcx, 15 ; rcx + rdi aligns on 16-byte boun= dary - jz @F - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosb -@@: - mov rcx, rdx - and rdx, 15 - shr rcx, 4 - jz @SetBytes - mov ah, al ; ax <- Value repeats twice - movdqa [rsp + 10h], xmm0 ; save xmm0 - movd xmm0, eax ; xmm0[0..16] <- Value repeats twi= ce - pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 t= imes - movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times -@@: - movntdq [rdi], xmm0 ; rdi should be 16-byte aligned - add rdi, 16 - loop @B - mfence - movdqa xmm0, [rsp + 10h] ; restore xmm0 -@SetBytes: - mov ecx, edx ; high 32 bits of rcx are always z= ero - rep stosb - mov rax, r9 ; rax <- Return value - ret -InternalMemSetMem ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.asm b/MdePkg/Lib= rary/BaseMemoryLibSse2/X64/SetMem16.asm deleted file mode 100644 index 8cb09ac..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem16.asm +++ /dev/null @@ -1,67 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem16.asm -; -; Abstract: -; -; SetMem16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem16 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT16 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem16 PROC USES rdi - mov rdi, rcx - mov r9, rdi - xor rcx, rcx - sub rcx, rdi - and rcx, 15 - mov rax, r8 - jz @F - shr rcx, 1 - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosw -@@: - mov rcx, rdx - and edx, 7 - shr rcx, 3 - jz @SetWords - movd xmm0, eax - pshuflw xmm0, xmm0, 0 - movlhps xmm0, xmm0 -@@: - movntdq [rdi], xmm0 - add rdi, 16 - loop @B - mfence -@SetWords: - mov ecx, edx - rep stosw - mov rax, r9 - ret -InternalMemSetMem16 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.asm b/MdePkg/Lib= rary/BaseMemoryLibSse2/X64/SetMem32.asm deleted file mode 100644 index 92404a0..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem32.asm +++ /dev/null @@ -1,66 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem32.asm -; -; Abstract: -; -; SetMem32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem32 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT8 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem32 PROC USES rdi - mov rdi, rcx - mov r9, rdi - xor rcx, rcx - sub rcx, rdi - and rcx, 15 - mov rax, r8 - jz @F - shr rcx, 2 - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosd -@@: - mov rcx, rdx - and edx, 3 - shr rcx, 2 - jz @SetDwords - movd xmm0, eax - pshufd xmm0, xmm0, 0 -@@: - movntdq [rdi], xmm0 - add rdi, 16 - loop @B - mfence -@SetDwords: - mov ecx, edx - rep stosd - mov rax, r9 - ret -InternalMemSetMem32 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.asm b/MdePkg/Lib= rary/BaseMemoryLibSse2/X64/SetMem64.asm deleted file mode 100644 index 5071f67..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.asm +++ /dev/null @@ -1,59 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SetMem64.asm -; -; Abstract: -; -; SetMem64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemSetMem64 ( -; IN VOID *Buffer, -; IN UINTN Count, -; IN UINT64 Value -; ) -;-------------------------------------------------------------------------= ----- -InternalMemSetMem64 PROC - mov rax, rcx ; rax <- Buffer - xchg rcx, rdx ; rcx <- Count & rdx <- Buffer - test dl, 8 - movd xmm0, r8 - jz @F - mov [rdx], r8 - add rdx, 8 - dec rcx -@@: - shr rcx, 1 - jz @SetQwords - movlhps xmm0, xmm0 -@@: - movntdq [rdx], xmm0 - lea rdx, [rdx + 16] - loop @B - mfence -@SetQwords: - jnc @F - mov [rdx], r8 -@@: - ret -InternalMemSetMem64 ENDP - - END diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.asm b/MdePkg/Libr= ary/BaseMemoryLibSse2/X64/ZeroMem.asm deleted file mode 100644 index d304729..0000000 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/ZeroMem.asm +++ /dev/null @@ -1,63 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ZeroMem.asm -; -; Abstract: -; -; ZeroMem function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID * -; InternalMemZeroMem ( -; IN VOID *Buffer, -; IN UINTN Count -; ) -;-------------------------------------------------------------------------= ----- -InternalMemZeroMem PROC USES rdi - mov rdi, rcx - xor rcx, rcx - xor eax, eax - sub rcx, rdi - and rcx, 15 - mov r8, rdi - jz @F - cmp rcx, rdx - cmova rcx, rdx - sub rdx, rcx - rep stosb -@@: - mov rcx, rdx - and edx, 15 - shr rcx, 4 - jz @ZeroBytes - pxor xmm0, xmm0 -@@: - movntdq [rdi], xmm0 ; rdi should be 16-byte aligned - add rdi, 16 - loop @B - mfence -@ZeroBytes: - mov ecx, edx - rep stosb - mov rax, r8 - ret -InternalMemZeroMem ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.i= nf b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf index 6fca7dd..8e119d8 100755 --- a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf +++ b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf @@ -39,15 +39,10 @@ SynchronizationMsc.c | MSFT =20 Ia32/InterlockedCompareExchange64.nasm| INTEL - Ia32/InterlockedCompareExchange64.asm | INTEL=20 Ia32/InterlockedCompareExchange32.nasm| INTEL - Ia32/InterlockedCompareExchange32.asm | INTEL=20 Ia32/InterlockedCompareExchange16.nasm| INTEL - Ia32/InterlockedCompareExchange16.asm | INTEL Ia32/InterlockedDecrement.nasm| INTEL - Ia32/InterlockedDecrement.asm | INTEL=20 Ia32/InterlockedIncrement.nasm| INTEL - Ia32/InterlockedIncrement.asm | INTEL=20 Synchronization.c | INTEL =20 Ia32/InternalGetSpinLockProperties.c | GCC @@ -61,20 +56,15 @@ X64/InterlockedCompareExchange16.c | MSFT =20 X64/InterlockedCompareExchange64.nasm| INTEL - X64/InterlockedCompareExchange64.asm | INTEL X64/InterlockedCompareExchange32.nasm| INTEL - X64/InterlockedCompareExchange32.asm | INTEL X64/InterlockedCompareExchange16.nasm| INTEL - X64/InterlockedCompareExchange16.asm | INTEL =20 X64/InterlockedDecrement.c | MSFT=20 X64/InterlockedIncrement.c | MSFT=20 SynchronizationMsc.c | MSFT=20 =20 X64/InterlockedDecrement.nasm| INTEL - X64/InterlockedDecrement.asm | INTEL=20 X64/InterlockedIncrement.nasm| INTEL - X64/InterlockedIncrement.asm | INTEL=20 Synchronization.c | INTEL=20 =20 Ia32/InternalGetSpinLockProperties.c | GCC diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareE= xchange16.asm b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompa= reExchange16.asm deleted file mode 100644 index 7362fe9..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange= 16.asm +++ /dev/null @@ -1,46 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; Copyright (c) 2015, Linaro Ltd. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedCompareExchange16.Asm -; -; Abstract: -; -; InterlockedCompareExchange16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .486 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; InternalSyncCompareExchange16 ( -; IN volatile UINT16 *Value, -; IN UINT16 CompareValue, -; IN UINT16 ExchangeValue -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncCompareExchange16 PROC - mov ecx, [esp + 4] - mov ax, [esp + 8] - mov dx, [esp + 12] - lock cmpxchg [ecx], dx - ret -InternalSyncCompareExchange16 ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareE= xchange32.asm b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompa= reExchange32.asm deleted file mode 100644 index 1a4a611..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange= 32.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedCompareExchange32.Asm -; -; Abstract: -; -; InterlockedCompareExchange32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .486 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; InternalSyncCompareExchange32 ( -; IN volatile UINT32 *Value, -; IN UINT32 CompareValue, -; IN UINT32 ExchangeValue -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncCompareExchange32 PROC - mov ecx, [esp + 4] - mov eax, [esp + 8] - mov edx, [esp + 12] - lock cmpxchg [ecx], edx - ret -InternalSyncCompareExchange32 ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareE= xchange64.asm b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompa= reExchange64.asm deleted file mode 100644 index e7b02db..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange= 64.asm +++ /dev/null @@ -1,47 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedCompareExchange64.Asm -; -; Abstract: -; -; InterlockedCompareExchange64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .586P - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalSyncCompareExchange64 ( -; IN volatile UINT64 *Value, -; IN UINT64 CompareValue, -; IN UINT64 ExchangeValue -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncCompareExchange64 PROC USES esi ebx - mov esi, [esp + 12] - mov eax, [esp + 16] - mov edx, [esp + 20] - mov ebx, [esp + 24] - mov ecx, [esp + 28] - lock cmpxchg8b qword ptr [esi] - ret -InternalSyncCompareExchange64 ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecremen= t.asm b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.asm deleted file mode 100644 index b5fa447..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.asm +++ /dev/null @@ -1,42 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedDecrement.Asm -; -; Abstract: -; -; InterlockedDecrement function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; InternalSyncDecrement ( -; IN volatile UINT32 *Value -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncDecrement PROC - mov eax, [esp + 4] - lock dec dword ptr [eax] - mov eax, [eax] - ret -InternalSyncDecrement ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncremen= t.asm b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.asm deleted file mode 100644 index 61c2533..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.asm +++ /dev/null @@ -1,42 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedIncrement.Asm -; -; Abstract: -; -; InterlockedIncrement function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .386 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; InternalSyncIncrement ( -; IN volatile UINT32 *Value -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncIncrement PROC - mov eax, [esp + 4] - lock inc dword ptr [eax] - mov eax, [eax] - ret -InternalSyncIncrement ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareEx= change16.asm b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompare= Exchange16.asm deleted file mode 100644 index 262adeb..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange1= 6.asm +++ /dev/null @@ -1,42 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; Copyright (c) 2015, Linaro Ltd. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedCompareExchange16.Asm -; -; Abstract: -; -; InterlockedCompareExchange16 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT16 -; EFIAPI -; InternalSyncCompareExchange16 ( -; IN volatile UINT16 *Value, -; IN UINT16 CompareValue, -; IN UINT16 ExchangeValue -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncCompareExchange16 PROC - mov ax, dx - lock cmpxchg [rcx], r8w - ret -InternalSyncCompareExchange16 ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareEx= change32.asm b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompare= Exchange32.asm deleted file mode 100644 index 711b399..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange3= 2.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedCompareExchange32.Asm -; -; Abstract: -; -; InterlockedCompareExchange32 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; InternalSyncCompareExchange32 ( -; IN volatile UINT32 *Value, -; IN UINT32 CompareValue, -; IN UINT32 ExchangeValue -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncCompareExchange32 PROC - mov eax, edx - lock cmpxchg [rcx], r8d - ret -InternalSyncCompareExchange32 ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareEx= change64.asm b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompare= Exchange64.asm deleted file mode 100644 index be429d8..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange6= 4.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedCompareExchange64.Asm -; -; Abstract: -; -; InterlockedCompareExchange64 function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT64 -; EFIAPI -; InternalSyncCompareExchange64 ( -; IN volatile UINT64 *Value, -; IN UINT64 CompareValue, -; IN UINT64 ExchangeValue -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncCompareExchange64 PROC - mov rax, rdx - lock cmpxchg [rcx], r8 - ret -InternalSyncCompareExchange64 ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement= .asm b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.asm deleted file mode 100644 index 4dc3886..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedDecrement.Asm -; -; Abstract: -; -; InterlockedDecrement function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; InternalSyncDecrement ( -; IN volatile UINT32 *Value -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncDecrement PROC - lock dec dword ptr [rcx] - mov eax, [rcx] - ret -InternalSyncDecrement ENDP - - END diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement= .asm b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.asm deleted file mode 100644 index fc086b6..0000000 --- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.asm +++ /dev/null @@ -1,39 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; InterlockedIncrement.Asm -; -; Abstract: -; -; InterlockedIncrement function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; UINT32 -; EFIAPI -; InternalSyncIncrement ( -; IN volatile UINT32 *Value -; ); -;-------------------------------------------------------------------------= ----- -InternalSyncIncrement PROC - lock inc dword ptr [rcx] - mov eax, [rcx] - ret -InternalSyncIncrement ENDP - - END --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 05:27:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1526221932745917.3492289555722; Sun, 13 May 2018 07:32:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BC0B1210D6CED; Sun, 13 May 2018 07:32:07 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D934A210D6CD3 for ; Sun, 13 May 2018 07:32:04 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2018 07:32:04 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.158.42]) by fmsmga004.fm.intel.com with ESMTP; 13 May 2018 07:32:03 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,396,1520924400"; d="scan'208";a="53911633" From: Liming Gao To: edk2-devel@lists.01.org Date: Sun, 13 May 2018 22:31:41 +0800 Message-Id: <1526221902-9060-6-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1526221902-9060-1-git-send-email-liming.gao@intel.com> References: <1526221902-9060-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [Patch 4/5] SourceLevelDebugPkg: Remove X86 ASM and S files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" NASM has replaced ASM and S files. Rmove ASM from all modules. Remove S files from the drivers only. After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- .../DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm | 422 -----------------= ---- .../DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm | 405 -----------------= --- .../Library/DebugAgent/DxeDebugAgentLib.inf | 2 - .../Library/DebugAgent/SecPeiDebugAgentLib.inf | 2 - .../Library/DebugAgent/SmmDebugAgentLib.inf | 2 - .../PeCoffExtraActionLibDebug/Ia32/IntHandler.asm | 33 -- .../PeCoffExtraActionLibDebug.inf | 2 - .../PeCoffExtraActionLibDebug/X64/IntHandler.asm | 29 -- 8 files changed, 897 deletions(-) delete mode 100644 SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon= /Ia32/AsmFuncs.asm delete mode 100644 SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon= /X64/AsmFuncs.asm delete mode 100644 SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/I= a32/IntHandler.asm delete mode 100644 SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/X= 64/IntHandler.asm diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/A= smFuncs.asm b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/= AsmFuncs.asm deleted file mode 100644 index 44ed6f7..0000000 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs= .asm +++ /dev/null @@ -1,422 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; 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 BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; AsmFuncs.asm -; -; Abstract: -; -; Debug interrupt handle functions. -; -;-------------------------------------------------------------------------= ----- - -#include "DebugException.h" - -.686p -.xmm -.model flat,c - -; -; InterruptProcess() -; -InterruptProcess PROTO C - -public Exception0Handle, TimerInterruptHandle, ExceptionStubHeaderSize - -AGENT_HANDLER_SIGNATURE MACRO - db 41h, 47h, 54h, 48h ; SIGNATURE_32('A','G','T','H') -ENDM - -.data - -ExceptionStubHeaderSize DD Exception1Handle - Exception0Handle -CommonEntryAddr DD CommonEntry - -.code - -AGENT_HANDLER_SIGNATURE -Exception0Handle: - cli - push eax - mov eax, 0 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception1Handle: - cli - push eax - mov eax, 1 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception2Handle: - cli - push eax - mov eax, 2 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception3Handle: - cli - push eax - mov eax, 3 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception4Handle: - cli - push eax - mov eax, 4 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception5Handle: - cli - push eax - mov eax, 5 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception6Handle: - cli - push eax - mov eax, 6 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception7Handle: - cli - push eax - mov eax, 7 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception8Handle: - cli - push eax - mov eax, 8 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception9Handle: - cli - push eax - mov eax, 9 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception10Handle: - cli - push eax - mov eax, 10 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception11Handle: - cli - push eax - mov eax, 11 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception12Handle: - cli - push eax - mov eax, 12 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception13Handle: - cli - push eax - mov eax, 13 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception14Handle: - cli - push eax - mov eax, 14 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception15Handle: - cli - push eax - mov eax, 15 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception16Handle: - cli - push eax - mov eax, 16 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception17Handle: - cli - push eax - mov eax, 17 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception18Handle: - cli - push eax - mov eax, 18 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception19Handle: - cli - push eax - mov eax, 19 - jmp dword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -TimerInterruptHandle: - cli - push eax - mov eax, 32 - jmp dword ptr [CommonEntryAddr] - -CommonEntry: -; -; +---------------------+ -; + EFlags + -; +---------------------+ -; + CS + -; +---------------------+ -; + EIP + -; +---------------------+ -; + Error Code + -; +---------------------+ -; + EAX / Vector Number + -; +---------------------+ -; + EBP + -; +---------------------+ <-- EBP -; - cmp eax, DEBUG_EXCEPT_DOUBLE_FAULT - je NoExtrPush - cmp eax, DEBUG_EXCEPT_INVALID_TSS - je NoExtrPush - cmp eax, DEBUG_EXCEPT_SEG_NOT_PRESENT - je NoExtrPush - cmp eax, DEBUG_EXCEPT_STACK_FAULT - je NoExtrPush - cmp eax, DEBUG_EXCEPT_GP_FAULT - je NoExtrPush - cmp eax, DEBUG_EXCEPT_PAGE_FAULT - je NoExtrPush - cmp eax, DEBUG_EXCEPT_ALIGNMENT_CHECK - je NoExtrPush - - push [esp] - mov dword ptr [esp + 4], 0 - -NoExtrPush: - - push ebp - mov ebp, esp ; save esp in ebp - ; - ; Make stack 16-byte alignment to make sure save fxrstor later - ; - and esp, 0fffffff0h - sub esp, 12 - - ; store UINT32 Edi, Esi, Ebp, Ebx, Edx, Ecx, Eax; - push dword ptr [ebp + 4] ; original eax - push ebx - push ecx - push edx - mov ebx, eax ; save vector in ebx - mov eax, ebp - add eax, 4 * 6 - push eax ; original ESP - push dword ptr [ebp] ; EBP - push esi - push edi - - ;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; - ;; insure FXSAVE/FXRSTOR is enabled in CR4... - ;; ... while we're at it, make sure DE is also enabled... - mov eax, 1 - push ebx ; temporarily save value of ebx on stack=20 - cpuid ; use CPUID to determine if FXSAVE/FXRESTOR and - ; DE are supported - pop ebx ; retore value of ebx that was overwritten by CPUI= D=20 - mov eax, cr4 - push eax ; push cr4 firstly - test edx, BIT24 ; Test for FXSAVE/FXRESTOR support - jz @F - or eax, BIT9 ; Set CR4.OSFXSR -@@: =20 - test edx, BIT2 ; Test for Debugging Extensions support - jz @F - or eax, BIT3 ; Set CR4.DE -@@: =20 - mov cr4, eax - mov eax, cr3 - push eax - mov eax, cr2 - push eax - push 0 ; cr0 will not saved??? - mov eax, cr0 - push eax - - xor ecx, ecx - mov ecx, Ss - push ecx - mov ecx, Cs - push ecx - mov ecx, Ds - push ecx - mov ecx, Es - push ecx - mov ecx, Fs - push ecx - mov ecx, Gs - push ecx - - ;; EIP - mov ecx, [ebp + 4 * 3] ; EIP - push ecx - - ;; UINT32 Gdtr[2], Idtr[2]; - sub esp, 8 - sidt fword ptr [esp] - sub esp, 8 - sgdt fword ptr [esp] - - ;; UINT32 Ldtr, Tr; - xor eax, eax - str ax - push eax - sldt ax - push eax - - ;; EFlags - mov ecx, [ebp + 4 * 5] - push ecx - - ;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - mov eax, dr7 - push eax - - ;; clear Dr7 while executing debugger itself - xor eax, eax - mov dr7, eax - - ;; Dr6 - mov eax, dr6 - push eax - - ;; insure all status bits in dr6 are clear... - xor eax, eax - mov dr6, eax - - mov eax, dr3 - push eax - mov eax, dr2 - push eax - mov eax, dr1 - push eax - mov eax, dr0 - push eax - - ;; Clear Direction Flag - cld - - ;; FX_SAVE_STATE_IA32 FxSaveState; - sub esp, 512 - mov edi, esp - ;; Clear the buffer - xor eax, eax - mov ecx, 128 ;=3D 512 / 4 - rep stosd - mov edi, esp - - test edx, BIT24 ; Test for FXSAVE/FXRESTOR support. - ; edx still contains result from CPUID above - jz @F - db 0fh, 0aeh, 00000111y ;fxsave [edi] -@@: =20 - - ;; save the exception data - push dword ptr [ebp + 8] - - ; call the C interrupt process function - push esp ; Structure - push ebx ; vector - call InterruptProcess - add esp, 8 - - ; skip the exception data - add esp, 4 - - ;; FX_SAVE_STATE_IA32 FxSaveState; - mov esi, esp - mov eax, 1 - cpuid ; use CPUID to determine if FXSAVE/FXRESTOR are su= pported - test edx, BIT24 ; Test for FXSAVE/FXRESTOR support - jz @F - db 0fh, 0aeh, 00001110y ; fxrstor [esi] -@@: =20 - add esp, 512 - - ;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - pop eax - mov dr0, eax - pop eax - mov dr1, eax - pop eax - mov dr2, eax - pop eax - mov dr3, eax - ;; skip restore of dr6. We cleared dr6 during the context save. - add esp, 4 - pop eax - mov dr7, eax - - ;; set EFlags - pop dword ptr [ebp + 4 * 5] ; set EFLAGS in stack - - ;; UINT32 Ldtr, Tr; - ;; UINT32 Gdtr[2], Idtr[2]; - ;; Best not let anyone mess with these particular registers... - add esp, 24 - - ;; UINT32 Eip; - pop dword ptr [ebp + 4 * 3] ; set EIP in stack - - ;; UINT32 Gs, Fs, Es, Ds, Cs, Ss; - ;; NOTE - modified segment registers could hang the debugger... We - ;; could attempt to insulate ourselves against this possibility, - ;; but that poses risks as well. - ;; - pop gs - pop fs - pop es - pop ds - pop dword ptr [ebp + 4 * 4] ; set CS in stack - pop ss - - ;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; - pop eax - mov cr0, eax - add esp, 4 ; skip for Cr1 - pop eax - mov cr2, eax - pop eax - mov cr3, eax - pop eax - mov cr4, eax - - ;; restore general register - pop edi - pop esi - pop dword ptr [ebp] ; save updated ebp - pop dword ptr [ebp + 4] ; save updated esp - pop edx - pop ecx - pop ebx - pop eax - - mov esp, ebp - pop ebp ; restore ebp maybe updated - pop esp ; restore esp maybe updated - sub esp, 4 * 3 ; restore interupt pushced stack - - iretd - -END diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/As= mFuncs.asm b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/As= mFuncs.asm deleted file mode 100644 index 6d01f64..0000000 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.= asm +++ /dev/null @@ -1,405 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; 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 BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; AsmFuncs.asm -; -; Abstract: -; -; Debug interrupt handle functions. -; -;-------------------------------------------------------------------------= ----- - -#include "DebugException.h" - - -externdef InterruptProcess:near - -data SEGMENT - -public Exception0Handle, TimerInterruptHandle, ExceptionStubHeade= rSize - -AGENT_HANDLER_SIGNATURE MACRO - db 41h, 47h, 54h, 48h ; SIGNATURE_32('A','G','T','H') -ENDM - -ExceptionStubHeaderSize dd Exception1Handle - Exception0Handle= ; -CommonEntryAddr dq CommonEntry ; - -.code - -AGENT_HANDLER_SIGNATURE -Exception0Handle: - cli - push rcx - mov rcx, 0 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE=09 -Exception1Handle: - cli - push rcx - mov rcx, 1 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception2Handle: - cli - push rcx - mov rcx, 2 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception3Handle: - cli - push rcx - mov rcx, 3 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception4Handle: - cli - push rcx - mov rcx, 4 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception5Handle: - cli - push rcx - mov rcx, 5 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception6Handle: - cli - push rcx - mov rcx, 6 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception7Handle: - cli - push rcx - mov rcx, 7 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception8Handle: - cli - push rcx - mov rcx, 8 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception9Handle: - cli - push rcx - mov rcx, 9 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception10Handle: - cli - push rcx - mov rcx, 10 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception11Handle: - cli - push rcx - mov rcx, 11 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception12Handle: - cli - push rcx - mov rcx, 12 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception13Handle: - cli - push rcx - mov rcx, 13 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception14Handle: - cli - push rcx - mov rcx, 14 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception15Handle: - cli - push rcx - mov rcx, 15 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception16Handle: - cli - push rcx - mov rcx, 16 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception17Handle: - cli - push rcx - mov rcx, 17 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception18Handle: - cli - push rcx - mov rcx, 18 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -Exception19Handle: - cli - push rcx - mov rcx, 19 - jmp qword ptr [CommonEntryAddr] -AGENT_HANDLER_SIGNATURE -TimerInterruptHandle: - cli - push rcx - mov rcx, 32 - jmp qword ptr [CommonEntryAddr] - -CommonEntry: - ; We need to determine if any extra data was pushed by the exception - cmp rcx, DEBUG_EXCEPT_DOUBLE_FAULT - je NoExtrPush - cmp rcx, DEBUG_EXCEPT_INVALID_TSS - je NoExtrPush - cmp rcx, DEBUG_EXCEPT_SEG_NOT_PRESENT - je NoExtrPush - cmp rcx, DEBUG_EXCEPT_STACK_FAULT - je NoExtrPush - cmp rcx, DEBUG_EXCEPT_GP_FAULT - je NoExtrPush - cmp rcx, DEBUG_EXCEPT_PAGE_FAULT - je NoExtrPush - cmp rcx, DEBUG_EXCEPT_ALIGNMENT_CHECK - je NoExtrPush - - push [rsp] - mov qword ptr [rsp + 8], 0 - -NoExtrPush: - push rbp - mov rbp, rsp - - ; store UINT64 r8, r9, r10, r11, r12, r13, r14, r15; - push r15 - push r14 - push r13 - push r12 - push r11 - push r10 - push r9 - push r8 - - mov r8, cr8 - push r8 - - ; store UINT64 Rdi, Rsi, Rbp, Rsp, Rdx, Rcx, Rbx, Rax; - push rax - push rbx - push qword ptr [rbp + 8] ; original rcx - push rdx - push qword ptr [rbp + 6 * 8] ; original rsp - push qword ptr [rbp] ; original rbp - push rsi - push rdi - - ;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; - ;; insure FXSAVE/FXRSTOR is enabled in CR4... - ;; ... while we're at it, make sure DE is also enabled... - mov rax, cr4 - or rax, 208h - mov cr4, rax - push rax - mov rax, cr3 - push rax - mov rax, cr2 - push rax - push 0 - mov rax, cr0 - push rax - - xor rax, rax - mov rax, Ss - push rax - mov rax, Cs - push rax - mov rax, Ds - push rax - mov rax, Es - push rax - mov rax, Fs - push rax - mov rax, Gs - push rax - - ;; EIP - mov rax, [rbp + 8 * 3] ; EIP - push rax - - ;; UINT64 Gdtr[2], Idtr[2]; - sub rsp, 16 - sidt fword ptr [rsp] - sub rsp, 16 - sgdt fword ptr [rsp] - - ;; UINT64 Ldtr, Tr; - xor rax, rax - str ax - push rax - sldt ax - push rax - - ;; EFlags - mov rax, [rbp + 8 * 5] - push rax - - ;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - mov rax, dr7 - push rax - - ;; clear Dr7 while executing debugger itself - xor rax, rax - mov dr7, rax - - ;; Dr6 - mov rax, dr6 - push rax - - ;; insure all status bits in dr6 are clear... - xor rax, rax - mov dr6, rax - - mov rax, dr3 - push rax - mov rax, dr2 - push rax - mov rax, dr1 - push rax - mov rax, dr0 - push rax - - ;; Clear Direction Flag - cld - - sub rsp, 512 - mov rdi, rsp - ;; Clear the buffer - xor rax, rax - push rcx - mov rcx, 64 ;=3D 512 / 8 - rep stosq - pop rcx - mov rdi, rsp - db 0fh, 0aeh, 00000111y ;fxsave [rdi] - - ;; save the exception data - push qword ptr [rbp + 16] - - ; call the C interrupt process function - mov rdx, rsp ; Structure - mov r15, rcx ; save vector in r15 - =20 - ; - ; Per X64 calling convention, allocate maximum parameter stack space - ; and make sure RSP is 16-byte aligned - ; - sub rsp, 32 + 8 - call InterruptProcess - add rsp, 32 + 8 - - ;; skip the exception data - add rsp, 8 - =20 - mov rsi, rsp - db 0fh, 0aeh, 00001110y ; fxrstor [rsi] - add rsp, 512 - - ;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - pop rax - mov dr0, rax - pop rax - mov dr1, rax - pop rax - mov dr2, rax - pop rax - mov dr3, rax - ;; skip restore of dr6. We cleared dr6 during the context save. - add rsp, 8 - pop rax - mov dr7, rax - - ;; set EFlags - pop qword ptr [rbp + 8 * 5] - - ;; UINT64 Ldtr, Tr; - ;; UINT64 Gdtr[2], Idtr[2]; - ;; Best not let anyone mess with these particular registers... - add rsp, 24 * 2 - - ;; UINT64 Eip; - pop qword ptr [rbp + 8 * 3] ; set EIP in stack - - ;; UINT64 Gs, Fs, Es, Ds, Cs, Ss; - ;; NOTE - modified segment registers could hang the debugger... We - ;; could attempt to insulate ourselves against this possibility, - ;; but that poses risks as well. - ;; - pop rax - pop rax - pop rax - mov es, rax - pop rax - mov ds, rax - pop qword ptr [rbp + 8 * 4] ; Set CS in stack - pop rax - mov ss, rax - - ;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4; - pop rax - mov cr0, rax - add rsp, 8 ; skip for Cr1 - pop rax - mov cr2, rax - pop rax - mov cr3, rax - pop rax - mov cr4, rax - - ;; restore general register - pop rdi - pop rsi - add rsp, 8 ; skip rbp - add rsp, 8 ; skip rsp - pop rdx - pop rcx - pop rbx - pop rax - - pop r8 - mov cr8, r8 - - ; store UINT64 r8, r9, r10, r11, r12, r13, r14, r15; - pop r8 - pop r9 - pop r10 - pop r11 - pop r12 - pop r13 - pop r14 - pop r15 - - mov rsp, rbp - pop rbp - add rsp, 16 ; skip rcx and error code - - iretq - -END diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf b/= SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf index eaa766b..e83e344 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf +++ b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -43,7 +43,6 @@ =20 [Sources.Ia32] DebugAgentCommon/Ia32/AsmFuncs.S - DebugAgentCommon/Ia32/AsmFuncs.asm DebugAgentCommon/Ia32/AsmFuncs.nasm DebugAgentCommon/Ia32/ArchDebugSupport.h DebugAgentCommon/Ia32/ArchDebugSupport.c @@ -51,7 +50,6 @@ =20 [Sources.X64] DebugAgentCommon/X64/AsmFuncs.S - DebugAgentCommon/X64/AsmFuncs.asm DebugAgentCommon/X64/AsmFuncs.nasm DebugAgentCommon/X64/ArchDebugSupport.h DebugAgentCommon/X64/ArchDebugSupport.c diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf= b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf index 5599ff1..5b5ed9d 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf +++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf @@ -40,7 +40,6 @@ =20 [Sources.Ia32] DebugAgentCommon/Ia32/AsmFuncs.S - DebugAgentCommon/Ia32/AsmFuncs.asm DebugAgentCommon/Ia32/AsmFuncs.nasm DebugAgentCommon/Ia32/ArchDebugSupport.h DebugAgentCommon/Ia32/ArchDebugSupport.c @@ -48,7 +47,6 @@ =20 [Sources.X64] DebugAgentCommon/X64/AsmFuncs.S - DebugAgentCommon/X64/AsmFuncs.asm DebugAgentCommon/X64/AsmFuncs.nasm DebugAgentCommon/X64/ArchDebugSupport.h DebugAgentCommon/X64/ArchDebugSupport.c diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf b/= SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf index 0435c5a..195c13e 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf +++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf @@ -40,7 +40,6 @@ =20 [Sources.Ia32] DebugAgentCommon/Ia32/AsmFuncs.S - DebugAgentCommon/Ia32/AsmFuncs.asm DebugAgentCommon/Ia32/AsmFuncs.nasm DebugAgentCommon/Ia32/ArchDebugSupport.h DebugAgentCommon/Ia32/ArchDebugSupport.c @@ -48,7 +47,6 @@ =20 [Sources.X64] DebugAgentCommon/X64/AsmFuncs.S - DebugAgentCommon/X64/AsmFuncs.asm DebugAgentCommon/X64/AsmFuncs.nasm DebugAgentCommon/X64/ArchDebugSupport.h DebugAgentCommon/X64/ArchDebugSupport.c diff --git a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/Ia32/Int= Handler.asm b/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/Ia32/In= tHandler.asm deleted file mode 100644 index ce9c03b..0000000 --- a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/Ia32/IntHandler= .asm +++ /dev/null @@ -1,33 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2013, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; IntHandler.asm -; -; Abstract: -; -; Assembly interrupt handler function. -; -;-------------------------------------------------------------------------= ----- - - -.686p -.model flat,c - -public AsmInterruptHandle - -.code -AsmInterruptHandle: - cli - mov al, 1 - iretd -END diff --git a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffEx= traActionLibDebug.inf b/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDeb= ug/PeCoffExtraActionLibDebug.inf index 1206e31..fc82e9b 100644 --- a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActi= onLibDebug.inf +++ b/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActi= onLibDebug.inf @@ -34,13 +34,11 @@ =20 [Sources.IA32] Ia32/IntHandlerFuncs.c - Ia32/IntHandler.asm Ia32/IntHandler.nasm Ia32/IntHandler.S =20 [Sources.X64] X64/IntHandlerFuncs.c - X64/IntHandler.asm X64/IntHandler.nasm X64/IntHandler.S =20 diff --git a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/X64/IntH= andler.asm b/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/X64/IntH= andler.asm deleted file mode 100644 index 93f4d6f..0000000 --- a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/X64/IntHandler.= asm +++ /dev/null @@ -1,29 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2013, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; IntHandler.asm -; -; Abstract: -; -; Assembly interrupt handler function. -; -;-------------------------------------------------------------------------= ----- - -public AsmInterruptHandle - -.code -AsmInterruptHandle: - cli - mov al, 1 - iretq -END --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 05:27:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1526221937836895.7543888183982; Sun, 13 May 2018 07:32:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EEAD4210D6CF3; Sun, 13 May 2018 07:32:07 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 47EE8210D6CD3 for ; Sun, 13 May 2018 07:32:05 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2018 07:32:05 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.158.42]) by fmsmga004.fm.intel.com with ESMTP; 13 May 2018 07:32:04 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,396,1520924400"; d="scan'208";a="53911635" From: Liming Gao To: edk2-devel@lists.01.org Date: Sun, 13 May 2018 22:31:42 +0800 Message-Id: <1526221902-9060-7-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1526221902-9060-1-git-send-email-liming.gao@intel.com> References: <1526221902-9060-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [Patch 5/5] UefiCpuPkg: Remove X86 ASM and S files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" NASM has replaced ASM and S files. Rmove ASM from all modules. Remove S files from the drivers only. After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- UefiCpuPkg/CpuDxe/CpuDxe.inf | 4 - UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S | 57 --- UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm | 58 --- UefiCpuPkg/CpuDxe/X64/CpuAsm.S | 60 --- UefiCpuPkg/CpuDxe/X64/CpuAsm.asm | 54 --- .../Library/BaseUefiCpuLib/BaseUefiCpuLib.inf | 2 - .../Library/BaseUefiCpuLib/Ia32/InitializeFpu.asm | 79 ---- .../Library/BaseUefiCpuLib/X64/InitializeFpu.asm | 62 --- .../DxeCpuExceptionHandlerLib.inf | 2 - .../Ia32/ExceptionHandlerAsm.asm | 467 -----------------= ---- .../PeiCpuExceptionHandlerLib.inf | 2 - .../SecPeiCpuExceptionHandlerLib.inf | 2 - .../SmmCpuExceptionHandlerLib.inf | 2 - .../X64/ExceptionHandlerAsm.asm | 389 ----------------- .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm | 285 ------------- .../SmmCpuFeaturesLib/Ia32/SmiException.asm | 175 -------- .../SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf | 4 - .../Library/SmmCpuFeaturesLib/X64/SmiEntry.asm | 281 ------------- .../Library/SmmCpuFeaturesLib/X64/SmiException.asm | 178 -------- .../Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.S | 38 -- .../Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.asm | 45 -- .../Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf | 4 - .../Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.S | 37 -- .../Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.asm | 41 -- 24 files changed, 2328 deletions(-) delete mode 100644 UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S delete mode 100644 UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm delete mode 100644 UefiCpuPkg/CpuDxe/X64/CpuAsm.S delete mode 100644 UefiCpuPkg/CpuDxe/X64/CpuAsm.asm delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/Ia32/InitializeFpu.asm delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/X64/InitializeFpu.asm delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/Exceptio= nHandlerAsm.asm delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Exception= HandlerAsm.asm delete mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm delete mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.= asm delete mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm delete mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.a= sm delete mode 100644 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.S delete mode 100644 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.asm delete mode 100644 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.S delete mode 100644 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.asm diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/CpuDxe/CpuDxe.inf index 02f86b7..13c79d0 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.inf +++ b/UefiCpuPkg/CpuDxe/CpuDxe.inf @@ -58,14 +58,10 @@ CpuPageTable.c =20 [Sources.IA32] - Ia32/CpuAsm.asm Ia32/CpuAsm.nasm - Ia32/CpuAsm.S =20 [Sources.X64] - X64/CpuAsm.asm X64/CpuAsm.nasm - X64/CpuAsm.S =20 [Protocols] gEfiCpuArchProtocolGuid ## PRODUCES diff --git a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S b/UefiCpuPkg/CpuDxe/Ia32/CpuAs= m.S deleted file mode 100644 index e034bc2..0000000 --- a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S +++ /dev/null @@ -1,57 +0,0 @@ -#-------------------------------------------------------------------------= ----- -#* -#* Copyright (c) 2006 - 2013, 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 ma= y be found at -#* http://opensource.org/licenses/bsd-license.php -#* -#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. -#* -#* CpuAsm.S -#* -#* Abstract: -#* -#-------------------------------------------------------------------------= ----- - - -#.MMX -#.XMM - -#-------------------------------------------------------------------------= ----- -# VOID -# SetCodeSelector ( -# UINT16 Selector -# ); -#-------------------------------------------------------------------------= ----- -ASM_GLOBAL ASM_PFX(SetCodeSelector) -ASM_PFX(SetCodeSelector): - movl 4(%esp), %ecx - subl $0x10, %esp=20 - leal setCodeSelectorLongJump, %eax=20 - movl %eax, (%esp) - movw %cx, 4(%esp) - .byte 0xFF, 0x2C, 0x24 # jmp *(%esp) note:(FWORD jmp)=20 -setCodeSelectorLongJump: - addl $0x10, %esp=20 - ret - -#-------------------------------------------------------------------------= ----- -# VOID -# SetDataSelectors ( -# UINT16 Selector -# ); -#-------------------------------------------------------------------------= ----- -ASM_GLOBAL ASM_PFX(SetDataSelectors) -ASM_PFX(SetDataSelectors): - movl 4(%esp), %ecx - movw %cx, %ss - movw %cx, %ds - movw %cx, %es - movw %cx, %fs - movw %cx, %gs - ret - -#END - diff --git a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm b/UefiCpuPkg/CpuDxe/Ia32/Cpu= Asm.asm deleted file mode 100644 index 7f8f0d6..0000000 --- a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm +++ /dev/null @@ -1,58 +0,0 @@ - TITLE CpuAsm.asm: -;-------------------------------------------------------------------------= ----- -;* -;* Copyright (c) 2006 - 2013, 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 ma= y be found at -;* http://opensource.org/licenses/bsd-license.php -;* -;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. -;* -;* CpuAsm.asm -;* -;* Abstract: -;* -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; SetCodeSelector ( -; UINT16 Selector -; ); -;-------------------------------------------------------------------------= ----- -SetCodeSelector PROC PUBLIC - mov ecx, [esp+4] - sub esp, 0x10 - lea eax, setCodeSelectorLongJump - mov [esp], eax - mov [esp+4], cx - jmp fword ptr [esp] -setCodeSelectorLongJump: - add esp, 0x10 - ret -SetCodeSelector ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; SetDataSelectors ( -; UINT16 Selector -; ); -;-------------------------------------------------------------------------= ----- -SetDataSelectors PROC PUBLIC - mov ecx, [esp+4] - mov ss, cx - mov ds, cx - mov es, cx - mov fs, cx - mov gs, cx - ret -SetDataSelectors ENDP - - -END diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.S b/UefiCpuPkg/CpuDxe/X64/CpuAsm.S deleted file mode 100644 index e82cadf..0000000 --- a/UefiCpuPkg/CpuDxe/X64/CpuAsm.S +++ /dev/null @@ -1,60 +0,0 @@ -# TITLE CpuAsm.S:=20 - -#-------------------------------------------------------------------------= ----- -#* -#* Copyright (c) 2008 - 2013, 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 ma= y be found at -#* http://opensource.org/licenses/bsd-license.php -#* -#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. -#* -#* CpuAsm.S -#* -#* Abstract: -#* -#-------------------------------------------------------------------------= ----- - - -#text SEGMENT - - -#-------------------------------------------------------------------------= ----- -# VOID -# SetCodeSelector ( -# UINT16 Selector -# ); -#-------------------------------------------------------------------------= ----- -ASM_GLOBAL ASM_PFX(SetCodeSelector) -ASM_PFX(SetCodeSelector): - subq $0x10, %rsp=20 - leaq L_setCodeSelectorLongJump(%rip), %rax=20 - movq %rax, (%rsp)=20 - movw %cx, 4(%rsp) - .byte 0xFF, 0x2C, 0x24 # jmp (%rsp) note:fword jmp -L_setCodeSelectorLongJump: - addq $0x10, %rsp - ret - -#-------------------------------------------------------------------------= ----- -# VOID -# SetDataSelectors ( -# UINT16 Selector -# ); -#-------------------------------------------------------------------------= ----- -ASM_GLOBAL ASM_PFX(SetDataSelectors) -ASM_PFX(SetDataSelectors): - movw %cx, %ss - movw %cx, %ds - movw %cx, %es - movw %cx, %fs - movw %cx, %gs - ret - -#text ENDS - -#END - - diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm b/UefiCpuPkg/CpuDxe/X64/CpuAs= m.asm deleted file mode 100644 index c71b06a..0000000 --- a/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm +++ /dev/null @@ -1,54 +0,0 @@ - TITLE CpuAsm.asm:=20 -;-------------------------------------------------------------------------= ----- -;* -;* Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.
-;* This program and the accompanying materials =20 -;* are licensed and made available under the terms and conditions of the= BSD License =20 -;* which accompanies this distribution. The full text of the license ma= y be found at =20 -;* http://opensource.org/licenses/bsd-license.php = =20 -;* = =20 -;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,= =20 -;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. =20 -;* =20 -;* CpuAsm.asm -;* =20 -;* Abstract: -;* -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; SetCodeSelector ( -; UINT16 Selector -; ); -;-------------------------------------------------------------------------= ----- -SetCodeSelector PROC PUBLIC - sub rsp, 0x10 - lea rax, setCodeSelectorLongJump - mov [rsp], rax - mov [rsp+4], cx - jmp fword ptr [rsp] -setCodeSelectorLongJump: - add rsp, 0x10 - ret -SetCodeSelector ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; SetDataSelectors ( -; UINT16 Selector -; ); -;-------------------------------------------------------------------------= ----- -SetDataSelectors PROC PUBLIC - mov ss, cx - mov ds, cx - mov es, cx - mov fs, cx - mov gs, cx - ret -SetDataSelectors ENDP - -END - diff --git a/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf b/UefiCpu= Pkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf index ce5d3aa..6829005 100644 --- a/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf +++ b/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf @@ -30,12 +30,10 @@ # =20 [Sources.IA32] - Ia32/InitializeFpu.asm Ia32/InitializeFpu.nasm Ia32/InitializeFpu.S =20 [Sources.X64] - X64/InitializeFpu.asm X64/InitializeFpu.nasm X64/InitializeFpu.S =20 diff --git a/UefiCpuPkg/Library/BaseUefiCpuLib/Ia32/InitializeFpu.asm b/Uef= iCpuPkg/Library/BaseUefiCpuLib/Ia32/InitializeFpu.asm deleted file mode 100644 index 3c31da9..0000000 --- a/UefiCpuPkg/Library/BaseUefiCpuLib/Ia32/InitializeFpu.asm +++ /dev/null @@ -1,79 +0,0 @@ -;-------------------------------------------------------------------------= ----- -;* -;* Copyright (c) 2009, 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 ma= y be found at -;* http://opensource.org/licenses/bsd-license.php -;* -;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. -;* -;* =20 -;-------------------------------------------------------------------------= ----- - - - .686 - .model flat,C - .const -; -; Float control word initial value:=20 -; all exceptions masked, double-precision, round-to-nearest -; -mFpuControlWord DW 027Fh -; -; Multimedia-extensions control word: -; all exceptions masked, round-to-nearest, flush to zero for masked underf= low -; -mMmxControlWord DD 01F80h=20 - - .xmm - .code - -; -; Initializes floating point units for requirement of UEFI specification. -; -; This function initializes floating-point control word to 0x027F (all exc= eptions -; masked,double-precision, round-to-nearest) and multimedia-extensions con= trol word -; (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush= to zero -; for masked underflow). -; -InitializeFloatingPointUnits PROC PUBLIC - - push ebx - - ; - ; Initialize floating point units - ; - finit - fldcw mFpuControlWord - =20 - ; - ; Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] =3D 1) to test - ; whether the processor supports SSE instruction. - ; - mov eax, 1 - cpuid - bt edx, 25 - jnc Done - =20 - ; - ; Set OSFXSR bit 9 in CR4 - ; - mov eax, cr4 - or eax, BIT9 - mov cr4, eax - =20 - ; - ; The processor should support SSE instruction and we can use - ; ldmxcsr instruction - ; - ldmxcsr mMmxControlWord -Done: - pop ebx - - ret - -InitializeFloatingPointUnits ENDP - -END diff --git a/UefiCpuPkg/Library/BaseUefiCpuLib/X64/InitializeFpu.asm b/Uefi= CpuPkg/Library/BaseUefiCpuLib/X64/InitializeFpu.asm deleted file mode 100644 index 331af15..0000000 --- a/UefiCpuPkg/Library/BaseUefiCpuLib/X64/InitializeFpu.asm +++ /dev/null @@ -1,62 +0,0 @@ -;-------------------------------------------------------------------------= ----- -;* -;* Copyright (c) 2009 - 2012, 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 ma= y be found at -;* http://opensource.org/licenses/bsd-license.php -;* -;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. -;* -;* -;-------------------------------------------------------------------------= ----- - - -.const -; -; Float control word initial value:=20 -; all exceptions masked, double-extended-precision, round-to-nearest -; -mFpuControlWord DW 037Fh -; -; Multimedia-extensions control word: -; all exceptions masked, round-to-nearest, flush to zero for masked underf= low -; -mMmxControlWord DD 01F80h=20 - -.code - - -; -; Initializes floating point units for requirement of UEFI specification. -; -; This function initializes floating-point control word to 0x027F (all exc= eptions -; masked,double-precision, round-to-nearest) and multimedia-extensions con= trol word -; (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush= to zero -; for masked underflow). -; -InitializeFloatingPointUnits PROC PUBLIC - - ; - ; Initialize floating point units - ; - ; The following opcodes stand for instruction 'finit'=20 - ; to be supported by some 64-bit assemblers - ; - DB 9Bh, 0DBh, 0E3h - fldcw mFpuControlWord - =20 - ; - ; Set OSFXSR bit 9 in CR4 - ; - mov rax, cr4 - or rax, BIT9 - mov cr4, rax - - ldmxcsr mMmxControlWord - =20 - ret -InitializeFloatingPointUnits ENDP - -END diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandl= erLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandle= rLib.inf index 58e55a8..50f4aa8 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.i= nf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.i= nf @@ -28,7 +28,6 @@ # =20 [Sources.Ia32] - Ia32/ExceptionHandlerAsm.asm Ia32/ExceptionHandlerAsm.nasm Ia32/ExceptionTssEntryAsm.nasm Ia32/ExceptionHandlerAsm.S @@ -36,7 +35,6 @@ Ia32/ArchInterruptDefs.h =20 [Sources.X64] - X64/ExceptionHandlerAsm.asm X64/ExceptionHandlerAsm.nasm X64/ExceptionHandlerAsm.S X64/ArchExceptionHandler.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandle= rAsm.asm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerA= sm.asm deleted file mode 100644 index 126680e..0000000 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.asm +++ /dev/null @@ -1,467 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ExceptionHandlerAsm.Asm -; -; Abstract: -; -; IA32 CPU Exception Handler -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - .686 - .model flat,C - -; -; CommonExceptionHandler() -; -CommonExceptionHandler PROTO C - -.data - -EXTRN mErrorCodeFlag:DWORD ; Error code flags for exceptions -EXTRN mDoFarReturnFlag:DWORD ; Do far return flag - -.code - -ALIGN 8 - -; -; exception handler stub table -; -AsmIdtVectorBegin: -REPEAT 32 - db 6ah ; push #VectorNum - db ($ - AsmIdtVectorBegin) / ((AsmIdtVectorEnd - AsmIdtVectorBegi= n) / 32) ; VectorNum - push eax - mov eax, CommonInterruptEntry - jmp eax -ENDM -AsmIdtVectorEnd: - -HookAfterStubBegin: - db 6ah ; push -VectorNum: - db 0 ; 0 will be fixed - push eax - mov eax, HookAfterStubHeaderEnd - jmp eax -HookAfterStubHeaderEnd: - pop eax - sub esp, 8 ; reserve room for filling exception data later - push [esp + 8] - xchg ecx, [esp] ; get vector number - bt mErrorCodeFlag, ecx - jnc @F - push [esp] ; addition push if exception data needed -@@: - xchg ecx, [esp] ; restore ecx - push eax - -;-------------------------------------------------------------------------= ---; -; CommonInterruptEntry = ; -;-------------------------------------------------------------------------= ---; -; The follow algorithm is used for the common interrupt routine. -; Entry from each interrupt with a push eax and eax=3Dinterrupt number -; Stack: -; +---------------------+ -; + EFlags + -; +---------------------+ -; + CS + -; +---------------------+ -; + EIP + -; +---------------------+ -; + Error Code + -; +---------------------+ -; + Vector Number + -; +---------------------+ -; + EBP + -; +---------------------+ <-- EBP -CommonInterruptEntry PROC PUBLIC - cli - pop eax - ; - ; All interrupt handlers are invoked through interrupt gates, so - ; IF flag automatically cleared at the entry point - ; - - ; - ; Get vector number from top of stack - ; - xchg ecx, [esp] - and ecx, 0FFh ; Vector number should be less than 256 - cmp ecx, 32 ; Intel reserved vector for exceptions? - jae NoErrorCode - bt mErrorCodeFlag, ecx - jc HasErrorCode - -NoErrorCode: - - ; - ; Stack: - ; +---------------------+ - ; + EFlags + - ; +---------------------+ - ; + CS + - ; +---------------------+ - ; + EIP + - ; +---------------------+ - ; + ECX + - ; +---------------------+ <-- ESP - ; - ; Registers: - ; ECX - Vector Number - ; - - ; - ; Put Vector Number on stack - ; - push ecx - - ; - ; Put 0 (dummy) error code on stack, and restore ECX - ; - xor ecx, ecx ; ECX =3D 0 - xchg ecx, [esp+4] - - jmp ErrorCodeAndVectorOnStack - -HasErrorCode: - - ; - ; Stack: - ; +---------------------+ - ; + EFlags + - ; +---------------------+ - ; + CS + - ; +---------------------+ - ; + EIP + - ; +---------------------+ - ; + Error Code + - ; +---------------------+ - ; + ECX + - ; +---------------------+ <-- ESP - ; - ; Registers: - ; ECX - Vector Number - ; - - ; - ; Put Vector Number on stack and restore ECX - ; - xchg ecx, [esp] - -ErrorCodeAndVectorOnStack: - push ebp - mov ebp, esp - - ; - ; Stack: - ; +---------------------+ - ; + EFlags + - ; +---------------------+ - ; + CS + - ; +---------------------+ - ; + EIP + - ; +---------------------+ - ; + Error Code + - ; +---------------------+ - ; + Vector Number + - ; +---------------------+ - ; + EBP + - ; +---------------------+ <-- EBP - ; - - ; - ; Align stack to make sure that EFI_FX_SAVE_STATE_IA32 of EFI_SYSTEM_C= ONTEXT_IA32 - ; is 16-byte aligned - ; - and esp, 0fffffff0h - sub esp, 12 - - sub esp, 8 - push 0 ; clear EXCEPTION_HANDLER_CONTEXT.OldIdtHandler - push 0 ; clear EXCEPTION_HANDLER_CONTEXT.ExceptionDataFl= ag - -;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - push eax - push ecx - push edx - push ebx - lea ecx, [ebp + 6 * 4] - push ecx ; ESP - push dword ptr [ebp] ; EBP - push esi - push edi - -;; UINT32 Gs, Fs, Es, Ds, Cs, Ss; - mov eax, ss - push eax - movzx eax, word ptr [ebp + 4 * 4] - push eax - mov eax, ds - push eax - mov eax, es - push eax - mov eax, fs - push eax - mov eax, gs - push eax - -;; UINT32 Eip; - mov eax, [ebp + 3 * 4] - push eax - -;; UINT32 Gdtr[2], Idtr[2]; - sub esp, 8 - sidt [esp] - mov eax, [esp + 2] - xchg eax, [esp] - and eax, 0FFFFh - mov [esp+4], eax - - sub esp, 8 - sgdt [esp] - mov eax, [esp + 2] - xchg eax, [esp] - and eax, 0FFFFh - mov [esp+4], eax - -;; UINT32 Ldtr, Tr; - xor eax, eax - str ax - push eax - sldt ax - push eax - -;; UINT32 EFlags; - mov eax, [ebp + 5 * 4] - push eax - -;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; - mov eax, 1 - push ebx ; temporarily save value of ebx on stack - cpuid ; use CPUID to determine if FXSAVE/FXRESTOR and DE - ; are supported - pop ebx ; retore value of ebx that was overwritten by CPUID - mov eax, cr4 - push eax ; push cr4 firstly - test edx, BIT24 ; Test for FXSAVE/FXRESTOR support - jz @F - or eax, BIT9 ; Set CR4.OSFXSR -@@: - test edx, BIT2 ; Test for Debugging Extensions support - jz @F - or eax, BIT3 ; Set CR4.DE -@@: - mov cr4, eax - mov eax, cr3 - push eax - mov eax, cr2 - push eax - xor eax, eax - push eax - mov eax, cr0 - push eax - -;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - mov eax, dr7 - push eax - mov eax, dr6 - push eax - mov eax, dr3 - push eax - mov eax, dr2 - push eax - mov eax, dr1 - push eax - mov eax, dr0 - push eax - -;; FX_SAVE_STATE_IA32 FxSaveState; - sub esp, 512 - mov edi, esp - test edx, BIT24 ; Test for FXSAVE/FXRESTOR support. - ; edx still contains result from CPUID above - jz @F - db 0fh, 0aeh, 07h ;fxsave [edi] -@@: - -;; UEFI calling convention for IA32 requires that Direction flag in EFLAGs= is clear - cld - -;; UINT32 ExceptionData; - push dword ptr [ebp + 2 * 4] - -;; Prepare parameter and call - mov edx, esp - push edx - mov edx, dword ptr [ebp + 1 * 4] - push edx - - ; - ; Call External Exception Handler - ; - mov eax, CommonExceptionHandler - call eax - add esp, 8 - - cli -;; UINT32 ExceptionData; - add esp, 4 - -;; FX_SAVE_STATE_IA32 FxSaveState; - mov esi, esp - mov eax, 1 - cpuid ; use CPUID to determine if FXSAVE/FXRESTOR - ; are supported - test edx, BIT24 ; Test for FXSAVE/FXRESTOR support - jz @F - db 0fh, 0aeh, 0eh ; fxrstor [esi] -@@: - add esp, 512 - -;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -;; Skip restoration of DRx registers to support in-circuit emualators -;; or debuggers set breakpoint in interrupt/exception context - add esp, 4 * 6 - -;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4; - pop eax - mov cr0, eax - add esp, 4 ; not for Cr1 - pop eax - mov cr2, eax - pop eax - mov cr3, eax - pop eax - mov cr4, eax - -;; UINT32 EFlags; - pop dword ptr [ebp + 5 * 4] - -;; UINT32 Ldtr, Tr; -;; UINT32 Gdtr[2], Idtr[2]; -;; Best not let anyone mess with these particular registers... - add esp, 24 - -;; UINT32 Eip; - pop dword ptr [ebp + 3 * 4] - -;; UINT32 Gs, Fs, Es, Ds, Cs, Ss; -;; NOTE - modified segment registers could hang the debugger... We -;; could attempt to insulate ourselves against this possibility, -;; but that poses risks as well. -;; - pop gs - pop fs - pop es - pop ds - pop dword ptr [ebp + 4 * 4] - pop ss - -;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; - pop edi - pop esi - add esp, 4 ; not for ebp - add esp, 4 ; not for esp - pop ebx - pop edx - pop ecx - pop eax - - pop dword ptr [ebp - 8] - pop dword ptr [ebp - 4] - mov esp, ebp - pop ebp - add esp, 8 - cmp dword ptr [esp - 16], 0 ; check EXCEPTION_HANDLER_CONTEXT.Ol= dIdtHandler - jz DoReturn - cmp dword ptr [esp - 20], 1 ; check EXCEPTION_HANDLER_CONTEXT.Ex= ceptionDataFlag - jz ErrorCode - jmp dword ptr [esp - 16] -ErrorCode: - sub esp, 4 - jmp dword ptr [esp - 12] - -DoReturn: - cmp mDoFarReturnFlag, 0 ; Check if need to do far return instead= of IRET - jz DoIret - push [esp + 8] ; save EFLAGS - add esp, 16 - push [esp - 8] ; save CS in new location - push [esp - 8] ; save EIP in new location - push [esp - 8] ; save EFLAGS in new location - popfd ; restore EFLAGS - retf ; far return - -DoIret: - iretd - -CommonInterruptEntry ENDP - -;---------------------------------------; -; _AsmGetTemplateAddressMap ; -;-------------------------------------------------------------------------= ---; -; -; Protocol prototype -; AsmGetTemplateAddressMap ( -; EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap -; ); -; -; Routine Description: -; -; Return address map of interrupt handler template so that C code can gen= erate -; interrupt table. -; -; Arguments: -; -; -; Returns: -; -; Nothing -; -; -; Input: [ebp][0] =3D Original ebp -; [ebp][4] =3D Return address -; -; Output: Nothing -; -; Destroys: Nothing -;-------------------------------------------------------------------------= ----; -AsmGetTemplateAddressMap proc near public - push ebp ; C prolog - mov ebp, esp - pushad - - mov ebx, dword ptr [ebp + 08h] - mov dword ptr [ebx], AsmIdtVectorBegin - mov dword ptr [ebx + 4h], (AsmIdtVectorEnd - AsmIdtVectorBegin) / 32 - mov dword ptr [ebx + 8h], HookAfterStubBegin - - popad - pop ebp - ret -AsmGetTemplateAddressMap ENDP - -;-------------------------------------------------------------------------= ------------ -; AsmVectorNumFixup (*NewVectorAddr, VectorNum, *OldVectorAddr); -;-------------------------------------------------------------------------= ------------ -AsmVectorNumFixup proc near public - mov eax, dword ptr [esp + 8] - mov ecx, [esp + 4] - mov [ecx + (VectorNum - HookAfterStubBegin)], al - ret -AsmVectorNumFixup ENDP -END diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandl= erLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandle= rLib.inf index 4c0d435..3288dbe 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i= nf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i= nf @@ -28,7 +28,6 @@ # =20 [Sources.Ia32] - Ia32/ExceptionHandlerAsm.asm Ia32/ExceptionHandlerAsm.nasm Ia32/ExceptionTssEntryAsm.nasm Ia32/ExceptionHandlerAsm.S @@ -36,7 +35,6 @@ Ia32/ArchInterruptDefs.h =20 [Sources.X64] - X64/ExceptionHandlerAsm.asm X64/ExceptionHandlerAsm.nasm X64/ExceptionHandlerAsm.S X64/ArchExceptionHandler.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHa= ndlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException= HandlerLib.inf index e5c03c1..a433b74 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLi= b.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLi= b.inf @@ -28,7 +28,6 @@ # =20 [Sources.Ia32] - Ia32/ExceptionHandlerAsm.asm Ia32/ExceptionHandlerAsm.nasm Ia32/ExceptionTssEntryAsm.nasm Ia32/ExceptionHandlerAsm.S @@ -36,7 +35,6 @@ Ia32/ArchInterruptDefs.h =20 [Sources.X64] - X64/ExceptionHandlerAsm.asm X64/ExceptionHandlerAsm.nasm X64/ExceptionHandlerAsm.S X64/ArchExceptionHandler.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandl= erLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandle= rLib.inf index 56b875b..725d71b 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.i= nf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.i= nf @@ -28,7 +28,6 @@ # =20 [Sources.Ia32] - Ia32/ExceptionHandlerAsm.asm Ia32/ExceptionHandlerAsm.nasm Ia32/ExceptionTssEntryAsm.nasm Ia32/ExceptionHandlerAsm.S @@ -36,7 +35,6 @@ Ia32/ArchInterruptDefs.h =20 [Sources.X64] - X64/ExceptionHandlerAsm.asm X64/ExceptionHandlerAsm.nasm X64/ExceptionHandlerAsm.S X64/ArchExceptionHandler.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandler= Asm.asm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm= .asm deleted file mode 100644 index 726c64a..0000000 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.asm +++ /dev/null @@ -1,389 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; ExceptionHandlerAsm.Asm -; -; Abstract: -; -; x64 CPU Exception Handler -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - -; -; CommonExceptionHandler() -; -externdef CommonExceptionHandler:near - -EXTRN mErrorCodeFlag:DWORD ; Error code flags for exceptions -EXTRN mDoFarReturnFlag:QWORD ; Do far return flag - -data SEGMENT - -.code - -ALIGN 8 - -AsmIdtVectorBegin: -REPEAT 32 - db 6ah ; push #VectorNum - db ($ - AsmIdtVectorBegin) / ((AsmIdtVectorEnd - AsmIdtVectorBegi= n) / 32) ; VectorNum - push rax - mov rax, CommonInterruptEntry - jmp rax -ENDM -AsmIdtVectorEnd: - -HookAfterStubHeaderBegin: - db 6ah ; push -@VectorNum: - db 0 ; 0 will be fixed - push rax - mov rax, HookAfterStubHeaderEnd - jmp rax -HookAfterStubHeaderEnd: - mov rax, rsp - and sp, 0fff0h ; make sure 16-byte aligned for exception c= ontext - sub rsp, 18h ; reserve room for filling exception data l= ater - push rcx - mov rcx, [rax + 8] - bt mErrorCodeFlag, ecx - jnc @F - push [rsp] ; push additional rcx to make stack alignment -@@: - xchg rcx, [rsp] ; restore rcx, save Exception Number in stack - push [rax] ; push rax into stack to keep code consisten= ce - -;---------------------------------------; -; CommonInterruptEntry ; -;---------------------------------------; -; The follow algorithm is used for the common interrupt routine. -; Entry from each interrupt with a push eax and eax=3Dinterrupt number -; Stack frame would be as follows as specified in IA32 manuals: -; -; +---------------------+ <-- 16-byte aligned ensured by processor -; + Old SS + -; +---------------------+ -; + Old RSP + -; +---------------------+ -; + RFlags + -; +---------------------+ -; + CS + -; +---------------------+ -; + RIP + -; +---------------------+ -; + Error Code + -; +---------------------+ -; + Vector Number + -; +---------------------+ -; + RBP + -; +---------------------+ <-- RBP, 16-byte aligned -; The follow algorithm is used for the common interrupt routine. -CommonInterruptEntry PROC PUBLIC - cli - pop rax - ; - ; All interrupt handlers are invoked through interrupt gates, so - ; IF flag automatically cleared at the entry point - ; - xchg rcx, [rsp] ; Save rcx into stack and save vector number i= nto rcx - and rcx, 0FFh - cmp ecx, 32 ; Intel reserved vector for exceptions? - jae NoErrorCode - bt mErrorCodeFlag, ecx - jc @F - -NoErrorCode: - - ; - ; Push a dummy error code on the stack - ; to maintain coherent stack map - ; - push [rsp] - mov qword ptr [rsp + 8], 0 -@@: - push rbp - mov rbp, rsp - push 0 ; clear EXCEPTION_HANDLER_CONTEXT.OldIdtHandler - push 0 ; clear EXCEPTION_HANDLER_CONTEXT.ExceptionDataF= lag - - ; - ; Stack: - ; +---------------------+ <-- 16-byte aligned ensured by processor - ; + Old SS + - ; +---------------------+ - ; + Old RSP + - ; +---------------------+ - ; + RFlags + - ; +---------------------+ - ; + CS + - ; +---------------------+ - ; + RIP + - ; +---------------------+ - ; + Error Code + - ; +---------------------+ - ; + RCX / Vector Number + - ; +---------------------+ - ; + RBP + - ; +---------------------+ <-- RBP, 16-byte aligned - ; - - - ; - ; Since here the stack pointer is 16-byte aligned, so - ; EFI_FX_SAVE_STATE_X64 of EFI_SYSTEM_CONTEXT_x64 - ; is 16-byte aligned - ; - -;; UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -;; UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - push r15 - push r14 - push r13 - push r12 - push r11 - push r10 - push r9 - push r8 - push rax - push qword ptr [rbp + 8] ; RCX - push rdx - push rbx - push qword ptr [rbp + 48] ; RSP - push qword ptr [rbp] ; RBP - push rsi - push rdi - -;; UINT64 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero - movzx rax, word ptr [rbp + 56] - push rax ; for ss - movzx rax, word ptr [rbp + 32] - push rax ; for cs - mov rax, ds - push rax - mov rax, es - push rax - mov rax, fs - push rax - mov rax, gs - push rax - - mov [rbp + 8], rcx ; save vector number - -;; UINT64 Rip; - push qword ptr [rbp + 24] - -;; UINT64 Gdtr[2], Idtr[2]; - xor rax, rax - push rax - push rax - sidt [rsp] - xchg rax, [rsp + 2] - xchg rax, [rsp] - xchg rax, [rsp + 8] - - xor rax, rax - push rax - push rax - sgdt [rsp] - xchg rax, [rsp + 2] - xchg rax, [rsp] - xchg rax, [rsp + 8] - -;; UINT64 Ldtr, Tr; - xor rax, rax - str ax - push rax - sldt ax - push rax - -;; UINT64 RFlags; - push qword ptr [rbp + 40] - -;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; - mov rax, cr8 - push rax - mov rax, cr4 - or rax, 208h - mov cr4, rax - push rax - mov rax, cr3 - push rax - mov rax, cr2 - push rax - xor rax, rax - push rax - mov rax, cr0 - push rax - -;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; - mov rax, dr7 - push rax - mov rax, dr6 - push rax - mov rax, dr3 - push rax - mov rax, dr2 - push rax - mov rax, dr1 - push rax - mov rax, dr0 - push rax - -;; FX_SAVE_STATE_X64 FxSaveState; - sub rsp, 512 - mov rdi, rsp - db 0fh, 0aeh, 07h ;fxsave [rdi] - -;; UEFI calling convention for x64 requires that Direction flag in EFLAGs = is clear - cld - -;; UINT32 ExceptionData; - push qword ptr [rbp + 16] - -;; Prepare parameter and call - mov rcx, [rbp + 8] - mov rdx, rsp - ; - ; Per X64 calling convention, allocate maximum parameter stack space - ; and make sure RSP is 16-byte aligned - ; - sub rsp, 4 * 8 + 8 - mov rax, CommonExceptionHandler - call rax - add rsp, 4 * 8 + 8 - - cli -;; UINT64 ExceptionData; - add rsp, 8 - -;; FX_SAVE_STATE_X64 FxSaveState; - - mov rsi, rsp - db 0fh, 0aeh, 0Eh ; fxrstor [rsi] - add rsp, 512 - -;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; -;; Skip restoration of DRx registers to support in-circuit emualators -;; or debuggers set breakpoint in interrupt/exception context - add rsp, 8 * 6 - -;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8; - pop rax - mov cr0, rax - add rsp, 8 ; not for Cr1 - pop rax - mov cr2, rax - pop rax - mov cr3, rax - pop rax - mov cr4, rax - pop rax - mov cr8, rax - -;; UINT64 RFlags; - pop qword ptr [rbp + 40] - -;; UINT64 Ldtr, Tr; -;; UINT64 Gdtr[2], Idtr[2]; -;; Best not let anyone mess with these particular registers... - add rsp, 48 - -;; UINT64 Rip; - pop qword ptr [rbp + 24] - -;; UINT64 Gs, Fs, Es, Ds, Cs, Ss; - pop rax - ; mov gs, rax ; not for gs - pop rax - ; mov fs, rax ; not for fs - ; (X64 will not use fs and gs, so we do not restore it) - pop rax - mov es, rax - pop rax - mov ds, rax - pop qword ptr [rbp + 32] ; for cs - pop qword ptr [rbp + 56] ; for ss - -;; UINT64 Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; -;; UINT64 R8, R9, R10, R11, R12, R13, R14, R15; - pop rdi - pop rsi - add rsp, 8 ; not for rbp - pop qword ptr [rbp + 48] ; for rsp - pop rbx - pop rdx - pop rcx - pop rax - pop r8 - pop r9 - pop r10 - pop r11 - pop r12 - pop r13 - pop r14 - pop r15 - - mov rsp, rbp - pop rbp - add rsp, 16 - cmp qword ptr [rsp - 32], 0 ; check EXCEPTION_HANDLER_CONTEXT.Old= IdtHandler - jz DoReturn - cmp qword ptr [rsp - 40], 1 ; check EXCEPTION_HANDLER_CONTEXT.Exc= eptionDataFlag - jz ErrorCode - jmp qword ptr [rsp - 32] -ErrorCode: - sub rsp, 8 - jmp qword ptr [rsp - 24] - -DoReturn: - cmp mDoFarReturnFlag, 0 ; Check if need to do far return instead= of IRET - jz DoIret - push rax - mov rax, rsp ; save old RSP to rax - mov rsp, [rsp + 20h] - push [rax + 10h] ; save CS in new location - push [rax + 8h] ; save EIP in new location - push [rax + 18h] ; save EFLAGS in new location - mov rax, [rax] ; restore rax - popfq ; restore EFLAGS - DB 48h ; prefix to composite "retq" with next "retf" - retf ; far return -DoIret: - iretq - -CommonInterruptEntry ENDP - -;-------------------------------------------------------------------------= ------------ -; GetTemplateAddressMap (&AddressMap); -;-------------------------------------------------------------------------= ------------ -; comments here for definition of address map -AsmGetTemplateAddressMap PROC - mov rax, offset AsmIdtVectorBegin - mov qword ptr [rcx], rax - mov qword ptr [rcx + 8h], (AsmIdtVectorEnd - AsmIdtVectorBegin) /= 32 - mov rax, offset HookAfterStubHeaderBegin - mov qword ptr [rcx + 10h], rax - ret -AsmGetTemplateAddressMap ENDP - -;-------------------------------------------------------------------------= ------------ -; AsmVectorNumFixup (*NewVectorAddr, VectorNum, *OldVectorAddr); -;-------------------------------------------------------------------------= ------------ -AsmVectorNumFixup PROC - mov rax, rdx - mov [rcx + (@VectorNum - HookAfterStubHeaderBegin)], al - ret -AsmVectorNumFixup ENDP - -END diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm b/UefiC= puPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm deleted file mode 100644 index 91dc1eb..0000000 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm +++ /dev/null @@ -1,285 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SmiEntry.asm -; -; Abstract: -; -; Code template of the SMI handler for a particular processor -; -;-------------------------------------------------------------------------= ------ - - .686p - .model flat,C - .xmm - -MSR_IA32_MISC_ENABLE EQU 1A0h -MSR_EFER EQU 0c0000080h -MSR_EFER_XD EQU 0800h - -; -; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR -; -DSC_OFFSET EQU 0fb00h -DSC_GDTPTR EQU 48h -DSC_GDTSIZ EQU 50h -DSC_CS EQU 14h -DSC_DS EQU 16h -DSC_SS EQU 18h -DSC_OTHERSEG EQU 1Ah - -PROTECT_MODE_CS EQU 08h -PROTECT_MODE_DS EQU 20h -TSS_SEGMENT EQU 40h - -SmiRendezvous PROTO C -CpuSmmDebugEntry PROTO C -CpuSmmDebugExit PROTO C - -EXTERNDEF gcStmSmiHandlerTemplate:BYTE -EXTERNDEF gcStmSmiHandlerSize:WORD -EXTERNDEF gcStmSmiHandlerOffset:WORD -EXTERNDEF gStmSmiCr3:DWORD -EXTERNDEF gStmSmiStack:DWORD -EXTERNDEF gStmSmbase:DWORD -EXTERNDEF gStmXdSupported:BYTE -EXTERNDEF FeaturePcdGet (PcdCpuSmmStackGuard):BYTE -EXTERNDEF gStmSmiHandlerIdtr:FWORD - - .code - -gcStmSmiHandlerTemplate LABEL BYTE - -_StmSmiEntryPoint: - DB 0bbh ; mov bx, imm16 - DW offset _StmGdtDesc - _StmSmiEntryPoint + 8000h - DB 2eh, 0a1h ; mov ax, cs:[offset16] - DW DSC_OFFSET + DSC_GDTSIZ - dec eax - mov cs:[edi], eax ; mov cs:[bx], ax - DB 66h, 2eh, 0a1h ; mov eax, cs:[offset16] - DW DSC_OFFSET + DSC_GDTPTR - mov cs:[edi + 2], ax ; mov cs:[bx + 2], eax - mov bp, ax ; ebp =3D GDT base - DB 66h - lgdt fword ptr cs:[edi] ; lgdt fword ptr cs:[bx] -; Patch ProtectedMode Segment - DB 0b8h ; mov ax, imm16 - DW PROTECT_MODE_CS ; set AX for segment directly - mov cs:[edi - 2], eax ; mov cs:[bx - 2], ax -; Patch ProtectedMode entry - DB 66h, 0bfh ; mov edi, SMBASE -gStmSmbase DD ? - DB 67h - lea ax, [edi + (@32bit - _StmSmiEntryPoint) + 8000h] - mov cs:[edi - 6], ax ; mov cs:[bx - 6], eax - mov ebx, cr0 - DB 66h - and ebx, 9ffafff3h - DB 66h - or ebx, 23h - mov cr0, ebx - DB 66h, 0eah - DD ? - DW ? -_StmGdtDesc FWORD ? - -@32bit: - mov ax, PROTECT_MODE_DS - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - DB 0bch ; mov esp, imm32 -gStmSmiStack DD ? - mov eax, offset gStmSmiHandlerIdtr - lidt fword ptr [eax] - jmp ProtFlatMode - -ProtFlatMode: - DB 0b8h ; mov eax, imm32 -gStmSmiCr3 DD ? - mov cr3, eax -; -; Need to test for CR4 specific bit support -; - mov eax, 1 - cpuid ; use CPUID to determine if specif= ic CR4 bits are supported - xor eax, eax ; Clear EAX - test edx, BIT2 ; Check for DE capabilities - jz @f - or eax, BIT3 -@@: - test edx, BIT6 ; Check for PAE capabilities - jz @f - or eax, BIT5 -@@: - test edx, BIT7 ; Check for MCE capabilities - jz @f - or eax, BIT6 -@@: - test edx, BIT24 ; Check for FXSR capabilities - jz @f - or eax, BIT9 -@@: - test edx, BIT25 ; Check for SSE capabilities - jz @f - or eax, BIT10 -@@: ; as cr4.PGE is not set here, refr= esh cr3 - mov cr4, eax ; in PreModifyMtrrs() to flush TLB. - - cmp FeaturePcdGet (PcdCpuSmmStackGuard), 0 - jz @F -; Load TSS - mov byte ptr [ebp + TSS_SEGMENT + 5], 89h ; clear busy flag - mov eax, TSS_SEGMENT - ltr ax -@@: - -; enable NXE if supported - DB 0b0h ; mov al, imm8 -gStmXdSupported DB 1 - cmp al, 0 - jz @SkipXd -; -; Check XD disable bit -; - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - push edx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr - jmp @XdDone -@SkipXd: - sub esp, 4 -@XdDone: - - mov ebx, cr0 - or ebx, 080010023h ; enable paging + WP + NE + MP + PE - mov cr0, ebx - lea ebx, [edi + DSC_OFFSET] - mov ax, [ebx + DSC_DS] - mov ds, eax - mov ax, [ebx + DSC_OTHERSEG] - mov es, eax - mov fs, eax - mov gs, eax - mov ax, [ebx + DSC_SS] - mov ss, eax - -CommonHandler: - mov ebx, [esp + 4] ; CPU Index - push ebx - mov eax, CpuSmmDebugEntry - call eax - add esp, 4 - - push ebx - mov eax, SmiRendezvous - call eax - add esp, 4 - - push ebx - mov eax, CpuSmmDebugExit - call eax - add esp, 4 - - mov eax, offset gStmXdSupported - mov al, [eax] - cmp al, 0 - jz @f - pop edx ; get saved MSR_IA32_MISC_ENABLE[63-= 32] - test edx, BIT2 - jz @f - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - or dx, BIT2 ; set XD Disable bit if it was set b= efore entering into SMM - wrmsr - -@@: - rsm - -_StmSmiHandler: -; -; Check XD disable bit -; - xor esi, esi - mov eax, offset gStmXdSupported - mov al, [eax] - cmp al, 0 - jz @StmXdDone - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - mov esi, edx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr -@StmXdDone: - push esi - - ; below step is needed, because STM does not run above code. - ; we have to run below code to set IDT/CR0/CR4 - mov eax, offset gStmSmiHandlerIdtr - lidt fword ptr [eax] - - - mov eax, cr0 - or eax, 80010023h ; enable paging + WP + NE + MP + PE - mov cr0, eax -; -; Need to test for CR4 specific bit support -; - mov eax, 1 - cpuid ; use CPUID to determine if specif= ic CR4 bits are supported - mov eax, cr4 ; init EAX - test edx, BIT2 ; Check for DE capabilities - jz @f - or eax, BIT3 -@@: - test edx, BIT6 ; Check for PAE capabilities - jz @f - or eax, BIT5 -@@: - test edx, BIT7 ; Check for MCE capabilities - jz @f - or eax, BIT6 -@@: - test edx, BIT24 ; Check for FXSR capabilities - jz @f - or eax, BIT9 -@@: - test edx, BIT25 ; Check for SSE capabilities - jz @f - or eax, BIT10 -@@: ; as cr4.PGE is not set here, refr= esh cr3 - mov cr4, eax ; in PreModifyMtrrs() to flush TLB. - ; STM init finish - jmp CommonHandler - -gcStmSmiHandlerSize DW $ - _StmSmiEntryPoint -gcStmSmiHandlerOffset DW _StmSmiHandler - _StmSmiEntryPoint - - END diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.asm b/U= efiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.asm deleted file mode 100644 index d0ae147..0000000 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.asm +++ /dev/null @@ -1,175 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SmiException.asm -; -; Abstract: -; -; Exception handlers used in SM mode -; -;-------------------------------------------------------------------------= ------ - - .686p - .model flat,C - -EXTERNDEF gcStmPsd:BYTE - -EXTERNDEF SmmStmExceptionHandler:PROC -EXTERNDEF SmmStmSetup:PROC -EXTERNDEF SmmStmTeardown:PROC -EXTERNDEF gStmXdSupported:BYTE - -CODE_SEL =3D 08h -DATA_SEL =3D 20h -TSS_SEL =3D 40h - -MSR_IA32_MISC_ENABLE EQU 1A0h -MSR_EFER EQU 0c0000080h -MSR_EFER_XD EQU 0800h - - .data - -gcStmPsd LABEL BYTE - DB 'TXTPSSIG' - DW PSD_SIZE - DW 1 ; Version - DD 0 ; LocalApicId - DB 05h ; Cr4Pse;Cr4Pae;Intel64Mode;ExecutionDi= sableOutsideSmrr - DB 0 ; BIOS to STM - DB 0 ; STM to BIOS - DB 0 - DW CODE_SEL - DW DATA_SEL - DW DATA_SEL - DW DATA_SEL - DW TSS_SEL - DW 0 - DQ 0 ; SmmCr3 - DQ _OnStmSetup - DQ _OnStmTeardown - DQ 0 ; SmmSmiHandlerRip - SMM guest entrypoi= nt - DQ 0 ; SmmSmiHandlerRsp - DQ 0 - DD 0 - DD 80010100h ; RequiredStmSmmRevId - DQ _OnException - DQ 0 ; ExceptionStack - DW DATA_SEL - DW 01Fh ; ExceptionFilter - DD 0 - DQ 0 - DQ 0 ; BiosHwResourceRequirementsPtr - DQ 0 ; AcpiRsdp - DB 0 ; PhysicalAddressBits -PSD_SIZE =3D $ - offset gcStmPsd - - .code -;-------------------------------------------------------------------------= ----- -; SMM Exception handlers -;-------------------------------------------------------------------------= ----- -_OnException PROC - mov ecx, esp - push ecx - call SmmStmExceptionHandler - add esp, 4 - - mov ebx, eax - mov eax, 4 - DB 0fh, 01h, 0c1h ; VMCALL - jmp $ -_OnException ENDP - -_OnStmSetup PROC -; -; Check XD disable bit -; - xor esi, esi - mov eax, offset gStmXdSupported - mov al, [eax] - cmp al, 0 - jz @StmXdDone1 - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - mov esi, edx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr -@StmXdDone1: - push esi - - call SmmStmSetup - - mov eax, offset gStmXdSupported - mov al, [eax] - cmp al, 0 - jz @f - pop edx ; get saved MSR_IA32_MISC_ENABLE[63-= 32] - test edx, BIT2 - jz @f - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - or dx, BIT2 ; set XD Disable bit if it was set b= efore entering into SMM - wrmsr -@@: - - rsm -_OnStmSetup ENDP - -_OnStmTeardown PROC -; -; Check XD disable bit -; - xor esi, esi - mov eax, offset gStmXdSupported - mov al, [eax] - cmp al, 0 - jz @StmXdDone2 - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - mov esi, edx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr -@StmXdDone2: - push esi - - call SmmStmTeardown - - mov eax, offset gStmXdSupported - mov al, [eax] - cmp al, 0 - jz @f - pop edx ; get saved MSR_IA32_MISC_ENABLE[63-= 32] - test edx, BIT2 - jz @f - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - or dx, BIT2 ; set XD Disable bit if it was set b= efore entering into SMM - wrmsr -@@: - - rsm -_OnStmTeardown ENDP - - END diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf = b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf index db8dcdc..2ec6a24 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf @@ -31,8 +31,6 @@ [Sources.Ia32] Ia32/SmmStmSupport.c =20 - Ia32/SmiEntry.asm - Ia32/SmiException.asm =20 Ia32/SmiEntry.nasm Ia32/SmiException.nasm @@ -43,8 +41,6 @@ [Sources.X64] X64/SmmStmSupport.c =20 - X64/SmiEntry.asm - X64/SmiException.asm =20 X64/SmiEntry.nasm X64/SmiException.nasm diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm b/UefiCp= uPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm deleted file mode 100644 index ad51e07..0000000 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.asm +++ /dev/null @@ -1,281 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SmiEntry.asm -; -; Abstract: -; -; Code template of the SMI handler for a particular processor -; -;-------------------------------------------------------------------------= ------ - -; -; Variables referenced by C code -; -EXTERNDEF SmiRendezvous:PROC -EXTERNDEF CpuSmmDebugEntry:PROC -EXTERNDEF CpuSmmDebugExit:PROC -EXTERNDEF gcStmSmiHandlerTemplate:BYTE -EXTERNDEF gcStmSmiHandlerSize:WORD -EXTERNDEF gcStmSmiHandlerOffset:WORD -EXTERNDEF gStmSmiCr3:DWORD -EXTERNDEF gStmSmiStack:DWORD -EXTERNDEF gStmSmbase:DWORD -EXTERNDEF gStmXdSupported:BYTE -EXTERNDEF gStmSmiHandlerIdtr:FWORD - -MSR_IA32_MISC_ENABLE EQU 1A0h -MSR_EFER EQU 0c0000080h -MSR_EFER_XD EQU 0800h - -; -; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR -; -DSC_OFFSET EQU 0fb00h -DSC_GDTPTR EQU 48h -DSC_GDTSIZ EQU 50h -DSC_CS EQU 14h -DSC_DS EQU 16h -DSC_SS EQU 18h -DSC_OTHERSEG EQU 1ah -; -; Constants relating to CPU State Save Area -; -SSM_DR6 EQU 0ffd0h -SSM_DR7 EQU 0ffc8h - -PROTECT_MODE_CS EQU 08h -PROTECT_MODE_DS EQU 20h -LONG_MODE_CS EQU 38h -TSS_SEGMENT EQU 40h -GDT_SIZE EQU 50h - - .code - -gcStmSmiHandlerTemplate LABEL BYTE - -_StmSmiEntryPoint: - ; - ; The encoding of BX in 16-bit addressing mode is the same as of RDI i= n 64- - ; bit addressing mode. And that coincidence has been used in the follo= wing - ; "64-bit like" 16-bit code. Be aware that once RDI is referenced as a - ; base address register, it is actually BX that is referenced. - ; - DB 0bbh ; mov bx, imm16 - DW offset _StmGdtDesc - _StmSmiEntryPoint + 8000h ; bx =3D GdtDe= sc offset -; fix GDT descriptor - DB 2eh, 0a1h ; mov ax, cs:[offset16] - DW DSC_OFFSET + DSC_GDTSIZ - DB 48h ; dec ax - DB 2eh - mov [rdi], eax ; mov cs:[bx], ax - DB 66h, 2eh, 0a1h ; mov eax, cs:[offset16] - DW DSC_OFFSET + DSC_GDTPTR - DB 2eh - mov [rdi + 2], ax ; mov cs:[bx + 2], eax - DB 66h, 2eh - lgdt fword ptr [rdi] ; lgdt fword ptr cs:[bx] -; Patch ProtectedMode Segment - DB 0b8h ; mov ax, imm16 - DW PROTECT_MODE_CS ; set AX for segment directly - DB 2eh - mov [rdi - 2], eax ; mov cs:[bx - 2], ax -; Patch ProtectedMode entry - DB 66h, 0bfh ; mov edi, SMBASE -gStmSmbase DD ? - lea ax, [edi + (@ProtectedMode - _StmSmiEntryPoint) + 8000h] - DB 2eh - mov [rdi - 6], ax ; mov cs:[bx - 6], eax -; Switch into @ProtectedMode - mov rbx, cr0 - DB 66h - and ebx, 9ffafff3h - DB 66h - or ebx, 00000023h - - mov cr0, rbx - DB 66h, 0eah - DD ? - DW ? - -_StmGdtDesc FWORD ? -@ProtectedMode: - mov ax, PROTECT_MODE_DS - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - DB 0bch ; mov esp, imm32 -gStmSmiStack DD ? - jmp ProtFlatMode - -ProtFlatMode: - DB 0b8h ; mov eax, offset gStmSmiCr3 -gStmSmiCr3 DD ? - mov cr3, rax - mov eax, 668h ; as cr4.PGE is not set here, refr= esh cr3 - mov cr4, rax ; in PreModifyMtrrs() to flush TLB. -; Load TSS - sub esp, 8 ; reserve room in stack - sgdt fword ptr [rsp] - mov eax, [rsp + 2] ; eax =3D GDT base - add esp, 8 - mov dl, 89h - mov [rax + TSS_SEGMENT + 5], dl ; clear busy flag - mov eax, TSS_SEGMENT - ltr ax - -; enable NXE if supported - DB 0b0h ; mov al, imm8 -gStmXdSupported DB 1 - cmp al, 0 - jz @SkipXd -; -; Check XD disable bit -; - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - sub esp, 4 - push rdx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr - jmp @XdDone -@SkipXd: - sub esp, 8 -@XdDone: - -; Switch into @LongMode - push LONG_MODE_CS ; push cs hardcore here - call Base ; push return address for retf later -Base: - add dword ptr [rsp], @LongMode - Base; offset for far retf, seg is= the 1st arg - - mov ecx, MSR_EFER - rdmsr - or ah, 1 ; enable LME - wrmsr - mov rbx, cr0 - or ebx, 080010023h ; enable paging + WP + NE + MP + PE - mov cr0, rbx - retf -@LongMode: ; long mode (64-bit code) starts h= ere - mov rax, offset gStmSmiHandlerIdtr - lidt fword ptr [rax] - lea ebx, [rdi + DSC_OFFSET] - mov ax, [rbx + DSC_DS] - mov ds, eax - mov ax, [rbx + DSC_OTHERSEG] - mov es, eax - mov fs, eax - mov gs, eax - mov ax, [rbx + DSC_SS] - mov ss, eax - -CommonHandler: - mov rbx, [rsp + 0x08] ; rbx <- CpuIndex - - ; - ; Save FP registers - ; - sub rsp, 200h - DB 48h ; FXSAVE64 - fxsave [rsp] - - add rsp, -20h - - mov rcx, rbx - mov rax, CpuSmmDebugEntry - call rax - - mov rcx, rbx - mov rax, SmiRendezvous ; rax <- absolute addr of SmiRedez= vous - call rax - - mov rcx, rbx - mov rax, CpuSmmDebugExit - call rax - - add rsp, 20h - - ; - ; Restore FP registers - ; - DB 48h ; FXRSTOR64 - fxrstor [rsp] - - add rsp, 200h - - mov rax, offset ASM_PFX(gStmXdSupported) - mov al, [rax] - cmp al, 0 - jz @f - pop rdx ; get saved MSR_IA32_MISC_ENABLE[63-= 32] - test edx, BIT2 - jz @f - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - or dx, BIT2 ; set XD Disable bit if it was set b= efore entering into SMM - wrmsr - -@@: - rsm - -_StmSmiHandler: -; -; Check XD disable bit -; - xor r8, r8 - mov rax, offset ASM_PFX(gStmXdSupported) - mov al, [rax] - cmp al, 0 - jz @StmXdDone - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - mov r8, rdx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr -@StmXdDone: - push r8 - - ; below step is needed, because STM does not run above code. - ; we have to run below code to set IDT/CR0/CR4 - mov rax, offset gStmSmiHandlerIdtr - lidt fword ptr [rax] - - mov rax, cr0 - or eax, 80010023h ; enable paging + WP + NE + MP + PE - mov cr0, rax - mov rax, cr4 - mov eax, 668h ; as cr4.PGE is not set here, refr= esh cr3 - mov cr4, rax ; in PreModifyMtrrs() to flush TLB. - ; STM init finish - jmp CommonHandler - -gcStmSmiHandlerSize DW $ - _StmSmiEntryPoint -gcStmSmiHandlerOffset DW _StmSmiHandler - _StmSmiEntryPoint - - END diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.asm b/Ue= fiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.asm deleted file mode 100644 index 33e9860..0000000 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.asm +++ /dev/null @@ -1,178 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; SmiException.asm -; -; Abstract: -; -; Exception handlers used in SM mode -; -;-------------------------------------------------------------------------= ------ - -EXTERNDEF gcStmPsd:BYTE - -EXTERNDEF SmmStmExceptionHandler:PROC -EXTERNDEF SmmStmSetup:PROC -EXTERNDEF SmmStmTeardown:PROC -EXTERNDEF gStmXdSupported:BYTE - -CODE_SEL EQU 38h -DATA_SEL EQU 20h -TR_SEL EQU 40h - -MSR_IA32_MISC_ENABLE EQU 1A0h -MSR_EFER EQU 0c0000080h -MSR_EFER_XD EQU 0800h - - .data - -; -; This structure serves as a template for all processors. -; -gcStmPsd LABEL BYTE - DB 'TXTPSSIG' - DW PSD_SIZE - DW 1 ; Version - DD 0 ; LocalApicId - DB 0Fh ; Cr4Pse;Cr4Pae;Intel64Mode;ExecutionDi= sableOutsideSmrr - DB 0 ; BIOS to STM - DB 0 ; STM to BIOS - DB 0 - DW CODE_SEL - DW DATA_SEL - DW DATA_SEL - DW DATA_SEL - DW TR_SEL - DW 0 - DQ 0 ; SmmCr3 - DQ _OnStmSetup - DQ _OnStmTeardown - DQ 0 ; SmmSmiHandlerRip - SMM guest entrypoi= nt - DQ 0 ; SmmSmiHandlerRsp - DQ 0 - DD 0 - DD 80010100h ; RequiredStmSmmRevId - DQ _OnException - DQ 0 ; ExceptionStack - DW DATA_SEL - DW 01Fh ; ExceptionFilter - DD 0 - DQ 0 - DQ 0 ; BiosHwResourceRequirementsPtr - DQ 0 ; AcpiRsdp - DB 0 ; PhysicalAddressBits -PSD_SIZE =3D $ - offset gcStmPsd - - .code -;-------------------------------------------------------------------------= ----- -; SMM Exception handlers -;-------------------------------------------------------------------------= ----- -_OnException PROC - mov rcx, rsp - add rsp, -28h - call SmmStmExceptionHandler - add rsp, 28h - mov ebx, eax - mov eax, 4 - DB 0fh, 01h, 0c1h ; VMCALL - jmp $ -_OnException ENDP - -_OnStmSetup PROC -; -; Check XD disable bit -; - xor r8, r8 - mov rax, offset ASM_PFX(gStmXdSupported) - mov al, [rax] - cmp al, 0 - jz @StmXdDone1 - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - mov r8, rdx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr -@StmXdDone1: - push r8 - - add rsp, -20h - call SmmStmSetup - add rsp, 20h - - mov rax, offset ASM_PFX(gStmXdSupported) - mov al, [rax] - cmp al, 0 - jz @f - pop rdx ; get saved MSR_IA32_MISC_ENABLE[63-= 32] - test edx, BIT2 - jz @f - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - or dx, BIT2 ; set XD Disable bit if it was set b= efore entering into SMM - wrmsr -@@: - - rsm -_OnStmSetup ENDP - -_OnStmTeardown PROC -; -; Check XD disable bit -; - xor r8, r8 - mov rax, offset ASM_PFX(gStmXdSupported) - mov al, [rax] - cmp al, 0 - jz @StmXdDone2 - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - mov r8, rdx ; save MSR_IA32_MISC_ENABLE[63-32] - test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz @f - and dx, 0FFFBh ; clear XD Disable bit if it is set - wrmsr -@@: - mov ecx, MSR_EFER - rdmsr - or ax, MSR_EFER_XD ; enable NXE - wrmsr -@StmXdDone2: - push r8 - - add rsp, -20h - call SmmStmTeardown - add rsp, 20h - - mov rax, offset ASM_PFX(gStmXdSupported) - mov al, [rax] - cmp al, 0 - jz @f - pop rdx ; get saved MSR_IA32_MISC_ENABLE[63-= 32] - test edx, BIT2 - jz @f - mov ecx, MSR_IA32_MISC_ENABLE - rdmsr - or dx, BIT2 ; set XD Disable bit if it was set b= efore entering into SMM - wrmsr -@@: - - rsm -_OnStmTeardown ENDP - - END diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.S b/UefiC= puPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.S deleted file mode 100644 index ede19f2..0000000 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.S +++ /dev/null @@ -1,38 +0,0 @@ -#-------------------------------------------------------------------------= ----- -#* -#* Copyright (c) 2012, 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 ma= y be found at -#* http://opensource.org/licenses/bsd-license.php -#* -#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. -#* -#* AsmFuncs.S -#* -#* Abstract: -#* -#* Assembly function to set segment selectors. -# -#-------------------------------------------------------------------------= ----- - -.text - -#-------------------------------------------------------------------------= ----- -#=20 -# VOID -# EFIAPI -# AsmSetDataSelectors ( -# IN UINT16 SelectorValue -# ); -#-------------------------------------------------------------------------= ----- -ASM_GLOBAL ASM_PFX(AsmSetDataSelectors) -ASM_PFX(AsmSetDataSelectors): - movl 4(%esp), %eax - movw %ax, %ss - movw %ax, %ds - movw %ax, %es - movw %ax, %fs - movw %ax, %gs=20 - ret diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.asm b/Uef= iCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.asm deleted file mode 100644 index 79496c4..0000000 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.asm +++ /dev/null @@ -1,45 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2012, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; AsmFuncs.Asm -; -; Abstract: -; -; Assembly function to set segment selectors. -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - -.686 -.model flat,C - -.code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmSetDataSelectors ( -; IN UINT16 SelectorValue -; ); -;-------------------------------------------------------------------------= ----- -AsmSetDataSelectors PROC near public - mov eax, [esp + 4] - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax =20 - ret -AsmSetDataSelectors ENDP - -END diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf b/Uefi= CpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf index 47fecd7..407aab6 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf @@ -37,14 +37,10 @@ S3Resume.c =20 [Sources.IA32] - Ia32/AsmFuncs.asm Ia32/AsmFuncs.nasm - Ia32/AsmFuncs.S =20 [Sources.X64] - X64/AsmFuncs.asm X64/AsmFuncs.nasm - X64/AsmFuncs.S =20 [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.S b/UefiCp= uPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.S deleted file mode 100644 index 2ced09f..0000000 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.S +++ /dev/null @@ -1,37 +0,0 @@ -#-------------------------------------------------------------------------= ----- -#* -#* Copyright (c) 2012, 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 ma= y be found at -#* http://opensource.org/licenses/bsd-license.php -#* -#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. -#* -#* AsmFuncs.S -#* -#* Abstract: -#* -#* Assembly function to set segment selectors. -# -#-------------------------------------------------------------------------= ----- - -.text - -#-------------------------------------------------------------------------= ----- -#=20 -# VOID -# EFIAPI -# AsmSetDataSelectors ( -# IN UINT16 SelectorValue -# ); -#-------------------------------------------------------------------------= ----- -ASM_GLOBAL ASM_PFX(AsmSetDataSelectors) -ASM_PFX(AsmSetDataSelectors): - movw %cx, %ss - movw %cx, %ds - movw %cx, %es - movw %cx, %fs - movw %cx, %gs=20 - ret diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.asm b/Uefi= CpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.asm deleted file mode 100644 index eb014a5..0000000 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.asm +++ /dev/null @@ -1,41 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2012, Intel Corporation. All rights reserved.
-; This program and the accompanying materials -; are licensed and made available under the terms and conditions of the BS= D License -; which accompanies this distribution. The full text of the license may b= e found at -; http://opensource.org/licenses/bsd-license.php. -; -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -; -; Module Name: -; -; AsmFuncs.Asm -; -; Abstract: -; -; Assembly function to set segment selectors. -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - -.code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; AsmSetDataSelectors ( -; IN UINT16 SelectorValue -; ); -;-------------------------------------------------------------------------= ----- -AsmSetDataSelectors PROC - mov ds, cx - mov es, cx - mov fs, cx - mov gs, cx - mov ss, cx =20 - ret -AsmSetDataSelectors ENDP - -END --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel