]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/Ia32/CpuAsm.nasm
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / Ia32 / CpuAsm.nasm
CommitLineData
762e073a
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
762e073a
LG
5;*\r
6;* CpuAsm.nasm\r
7;*\r
8;* Abstract:\r
9;*\r
10;------------------------------------------------------------------------------\r
11\r
12 SECTION .text\r
13\r
14;------------------------------------------------------------------------------\r
15; VOID\r
16; SetCodeSelector (\r
17; UINT16 Selector\r
18; );\r
19;------------------------------------------------------------------------------\r
20global ASM_PFX(SetCodeSelector)\r
21ASM_PFX(SetCodeSelector):\r
22 mov ecx, [esp+4]\r
23 sub esp, 0x10\r
24 lea eax, [setCodeSelectorLongJump]\r
25 mov [esp], eax\r
26 mov [esp+4], cx\r
27 jmp dword far [esp]\r
28setCodeSelectorLongJump:\r
29 add esp, 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
40 mov ecx, [esp+4]\r
41o16 mov ss, cx\r
42o16 mov ds, cx\r
43o16 mov es, cx\r
44o16 mov fs, cx\r
45o16 mov gs, cx\r
46 ret\r
47\r