]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
UefiCpuPkg/CpuDxe: Enable protection for newly added page table
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / Ia32 / CpuAsm.S
CommitLineData
c2fd60f0 1#------------------------------------------------------------------------------\r
2#*\r
e41aad15 3#* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
01a1c0fc 4#* This program and the accompanying materials\r
c2fd60f0 5#* are licensed and made available under the terms and conditions of the BSD License\r
6#* which accompanies this distribution. The full text of the license may be found at\r
7#* http://opensource.org/licenses/bsd-license.php\r
8#*\r
9#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#*\r
12#* CpuAsm.S\r
13#*\r
14#* Abstract:\r
15#*\r
16#------------------------------------------------------------------------------\r
17\r
18\r
19#.MMX\r
20#.XMM\r
21\r
c2fd60f0 22#------------------------------------------------------------------------------\r
23# VOID\r
24# SetCodeSelector (\r
25# UINT16 Selector\r
26# );\r
27#------------------------------------------------------------------------------\r
28ASM_GLOBAL ASM_PFX(SetCodeSelector)\r
29ASM_PFX(SetCodeSelector):\r
30 movl 4(%esp), %ecx\r
31 subl $0x10, %esp \r
32 leal setCodeSelectorLongJump, %eax \r
33 movl %eax, (%esp)\r
34 movw %cx, 4(%esp)\r
35 .byte 0xFF, 0x2C, 0x24 # jmp *(%esp) note:(FWORD jmp) \r
36setCodeSelectorLongJump:\r
37 addl $0x10, %esp \r
38 ret\r
39\r
40#------------------------------------------------------------------------------\r
41# VOID\r
42# SetDataSelectors (\r
43# UINT16 Selector\r
44# );\r
45#------------------------------------------------------------------------------\r
46ASM_GLOBAL ASM_PFX(SetDataSelectors)\r
47ASM_PFX(SetDataSelectors):\r
48 movl 4(%esp), %ecx\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#END\r
57\r