]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/SmmBaseHelper/X64/PageFaultHandler.S
5a50507353b55ba29940672e5878f494142d7b69
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / SmmBaseHelper / X64 / PageFaultHandler.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
4 # This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
8 #
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 #
12 # Module Name:
13 #
14 # PageFaultHandler.S
15 #
16 # Abstract:
17 #
18 # Defines page fault handler used to hook SMM IDT
19 #
20 #------------------------------------------------------------------------------
21
22 ASM_GLOBAL ASM_PFX(PageFaultHandlerHook)
23 ASM_PFX(PageFaultHandlerHook):
24 pushq %rax # save all volatile registers
25 pushq %rcx
26 pushq %rdx
27 pushq %r8
28 pushq %r9
29 pushq %r10
30 pushq %r11
31 addq $-0x20, %rsp
32 call ASM_PFX(PageFaultHandler)
33 addq $0x20, %rsp
34 test %rax, %rax
35 popq %r11
36 popq %r10
37 popq %r9
38 popq %r8
39 popq %rdx
40 popq %rcx
41 popq %rax # restore all volatile registers
42 jnz L1
43 jmpq *ASM_PFX(mOriginalHandler)
44 L1:
45 addq $0x08, %rsp # skip error code for PF
46 iretq