]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm
UefiCpuPkg/CpuDxe: Enable protection for newly added page table
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / X64 / CpuAsm.nasm
1 ;------------------------------------------------------------------------------
2 ;*
3 ;* Copyright (c) 2016, 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 ;* CpuAsm.nasm
13 ;*
14 ;* Abstract:
15 ;*
16 ;------------------------------------------------------------------------------
17
18 DEFAULT REL
19 SECTION .text
20
21 ;------------------------------------------------------------------------------
22 ; VOID
23 ; SetCodeSelector (
24 ; UINT16 Selector
25 ; );
26 ;------------------------------------------------------------------------------
27 global ASM_PFX(SetCodeSelector)
28 ASM_PFX(SetCodeSelector):
29 sub rsp, 0x10
30 lea rax, [setCodeSelectorLongJump]
31 mov [rsp], rax
32 mov [rsp+4], cx
33 jmp dword far [rsp]
34 setCodeSelectorLongJump:
35 add rsp, 0x10
36 ret
37
38 ;------------------------------------------------------------------------------
39 ; VOID
40 ; SetDataSelectors (
41 ; UINT16 Selector
42 ; );
43 ;------------------------------------------------------------------------------
44 global ASM_PFX(SetDataSelectors)
45 ASM_PFX(SetDataSelectors):
46 o16 mov ss, cx
47 o16 mov ds, cx
48 o16 mov es, cx
49 o16 mov fs, cx
50 o16 mov gs, cx
51 ret
52