]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/X64/CpuAsm.S
UefiCpuPkg/CpuDxe: Enable protection for newly added page table
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / X64 / CpuAsm.S
CommitLineData
c2fd60f0 1# TITLE CpuAsm.S: \r
2\r
3#------------------------------------------------------------------------------\r
4#*\r
e41aad15 5#* Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
01a1c0fc 6#* This program and the accompanying materials\r
c2fd60f0 7#* are licensed and made available under the terms and conditions of the BSD License\r
8#* which accompanies this distribution. The full text of the license may be found at\r
9#* http://opensource.org/licenses/bsd-license.php\r
10#*\r
11#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13#*\r
14#* CpuAsm.S\r
15#*\r
16#* Abstract:\r
17#*\r
18#------------------------------------------------------------------------------\r
19\r
20\r
21#text SEGMENT\r
22\r
23\r
c2fd60f0 24#------------------------------------------------------------------------------\r
25# VOID\r
26# SetCodeSelector (\r
27# UINT16 Selector\r
28# );\r
29#------------------------------------------------------------------------------\r
30ASM_GLOBAL ASM_PFX(SetCodeSelector)\r
31ASM_PFX(SetCodeSelector):\r
32 subq $0x10, %rsp \r
4d0ceb8d 33 leaq L_setCodeSelectorLongJump(%rip), %rax \r
c2fd60f0 34 movq %rax, (%rsp) \r
35 movw %cx, 4(%rsp)\r
36 .byte 0xFF, 0x2C, 0x24 # jmp (%rsp) note:fword jmp\r
4d0ceb8d 37L_setCodeSelectorLongJump:\r
c2fd60f0 38 addq $0x10, %rsp\r
39 ret\r
40\r
41#------------------------------------------------------------------------------\r
42# VOID\r
43# SetDataSelectors (\r
44# UINT16 Selector\r
45# );\r
46#------------------------------------------------------------------------------\r
47ASM_GLOBAL ASM_PFX(SetDataSelectors)\r
48ASM_PFX(SetDataSelectors):\r
49 movw %cx, %ss\r
50 movw %cx, %ds\r
51 movw %cx, %es\r
52 movw %cx, %fs\r
53 movw %cx, %gs\r
54 ret\r
55\r
c2fd60f0 56#text ENDS\r
57\r
58#END\r
59\r
60\r