]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/Ia32/CpuAsm.nasm
UefiCpuPkg CpuDxe: Convert Ia32/CpuAsm.asm to NASM
[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
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 SECTION .text\r
19\r
20;------------------------------------------------------------------------------\r
21; VOID\r
22; SetCodeSelector (\r
23; UINT16 Selector\r
24; );\r
25;------------------------------------------------------------------------------\r
26global ASM_PFX(SetCodeSelector)\r
27ASM_PFX(SetCodeSelector):\r
28 mov ecx, [esp+4]\r
29 sub esp, 0x10\r
30 lea eax, [setCodeSelectorLongJump]\r
31 mov [esp], eax\r
32 mov [esp+4], cx\r
33 jmp dword far [esp]\r
34setCodeSelectorLongJump:\r
35 add esp, 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
46 mov ecx, [esp+4]\r
47o16 mov ss, cx\r
48o16 mov ds, cx\r
49o16 mov es, cx\r
50o16 mov fs, cx\r
51o16 mov gs, cx\r
52 ret\r
53\r