]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm
UefiCpuPkg CpuDxe: Add nasm source file in CpuDxe.inf
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / X64 / CpuAsm.nasm
CommitLineData
b85a6ffb
LG
1;------------------------------------------------------------------------------\r
2;*\r
3;* Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
4;* This program and the accompanying materials\r
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.nasm\r
13;*\r
14;* Abstract:\r
15;*\r
16;------------------------------------------------------------------------------\r
17\r
18 DEFAULT REL\r
19 SECTION .text\r
20\r
21;------------------------------------------------------------------------------\r
22; VOID\r
23; SetCodeSelector (\r
24; UINT16 Selector\r
25; );\r
26;------------------------------------------------------------------------------\r
27global ASM_PFX(SetCodeSelector)\r
28ASM_PFX(SetCodeSelector):\r
29 sub rsp, 0x10\r
30 lea rax, [setCodeSelectorLongJump]\r
31 mov [rsp], rax\r
32 mov [rsp+4], cx\r
33 jmp dword far [rsp]\r
34setCodeSelectorLongJump:\r
35 add rsp, 0x10\r
36 ret\r
37\r
38;------------------------------------------------------------------------------\r
39; VOID\r
40; SetDataSelectors (\r
41; UINT16 Selector\r
42; );\r
43;------------------------------------------------------------------------------\r
44global ASM_PFX(SetDataSelectors)\r
45ASM_PFX(SetDataSelectors):\r
46o16 mov ss, cx\r
47o16 mov ds, cx\r
48o16 mov es, cx\r
49o16 mov fs, cx\r
50o16 mov gs, cx\r
51 ret\r
52\r