]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm
UefiCpuPkg/CpuDxe: Fix boot error
[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
0acd8697 4;* SPDX-License-Identifier: BSD-2-Clause-Patent\r
b85a6ffb
LG
5;*\r
6;* CpuAsm.nasm\r
7;*\r
8;* Abstract:\r
9;*\r
10;------------------------------------------------------------------------------\r
11\r
12 DEFAULT REL\r
13 SECTION .text\r
14\r
15;------------------------------------------------------------------------------\r
16; VOID\r
17; SetCodeSelector (\r
18; UINT16 Selector\r
19; );\r
20;------------------------------------------------------------------------------\r
21global ASM_PFX(SetCodeSelector)\r
22ASM_PFX(SetCodeSelector):\r
23 sub rsp, 0x10\r
24 lea rax, [setCodeSelectorLongJump]\r
25 mov [rsp], rax\r
cee5b044
GD
26 mov [rsp+8], cx\r
27 jmp qword far [rsp]\r
b85a6ffb
LG
28setCodeSelectorLongJump:\r
29 add rsp, 0x10\r
30 ret\r
31\r
32;------------------------------------------------------------------------------\r
33; VOID\r
34; SetDataSelectors (\r
35; UINT16 Selector\r
36; );\r
37;------------------------------------------------------------------------------\r
38global ASM_PFX(SetDataSelectors)\r
39ASM_PFX(SetDataSelectors):\r
40o16 mov ss, cx\r
41o16 mov ds, cx\r
42o16 mov es, cx\r
43o16 mov fs, cx\r
44o16 mov gs, cx\r
45 ret\r
46\r