summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/CapsulePei
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-06-04 13:35:58 +0800
committerLiming Gao <liming.gao@intel.com>2018-06-07 15:26:27 +0800
commit6d614649abfb4fc80d303467bc1a30851e191fdd (patch)
tree593f2ff08a633ce6c6208f82a307c01e08026884 /MdeModulePkg/Universal/CapsulePei
parent13688930ae9ad5101f10d28f650382058e449616 (diff)
downloadedk2-6d614649abfb4fc80d303467bc1a30851e191fdd.tar.gz
MdeModulePkg: Remove X86 ASM and S files
NASM has replaced ASM and S files. 1. Remove ASM from all modules. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/CapsulePei')
-rw-r--r--MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf4
-rw-r--r--MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.S81
-rw-r--r--MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.asm87
3 files changed, 1 insertions, 171 deletions
diff --git a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf b/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
index 8318eaa2d6..254f399be9 100644
--- a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
+++ b/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
@@ -9,7 +9,7 @@
# This external input must be validated carefully to avoid security issue like
# buffer overflow, integer overflow.
#
-# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions
@@ -39,8 +39,6 @@
[Sources]
X64/X64Entry.c
X64/PageFaultHandler.nasm
- X64/PageFaultHandler.asm
- X64/PageFaultHandler.S
Common/CapsuleCoalesce.c
[Packages]
diff --git a/MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.S b/MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.S
deleted file mode 100644
index 9e17cc39ee..0000000000
--- 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.<BR>
-#
-# 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 IMPLIED.
-#
-##
-
-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)
- movdqa %xmm1, 0x10(%rsp)
- movdqa %xmm2, 0x20(%rsp)
- movdqa %xmm3, 0x30(%rsp)
- movdqa %xmm4, 0x40(%rsp)
- movdqa %xmm5, 0x50(%rsp)
-
- 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 registers
-
- 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 PageFaultHandler
- 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/MdeModulePkg/Universal/CapsulePei/X64/PageFaultHandler.asm
deleted file mode 100644
index 2f1eab72ef..0000000000
--- 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.<BR>
-;
-; 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 IMPLIED.
-;
-;;
-
-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 PageFaultHandler
- 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