]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm
UefiCpuPkg/CpuDxe: Move SetMtrrsFromBuffer() location.
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / Ia32 / MpAsm.nasm
CommitLineData
fab82c18
JJ
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2006 - 2014, 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;------------------------------------------------------------------------------\r
13\r
14extern ASM_PFX(mTopOfApCommonStack)\r
15extern ASM_PFX(ApEntryPointInC)\r
16\r
17SECTION .data\r
18\r
19;\r
20; This lock only allows one AP to use the mTopOfApCommonStack stack at a time\r
21;\r
22ApStackLock:\r
23 dd 0\r
24\r
25SECTION .text\r
26\r
27;------------------------------------------------------------------------------\r
28; VOID\r
29; EFIAPI\r
30; AsmApEntryPoint (\r
31; VOID\r
32; );\r
33;------------------------------------------------------------------------------\r
34global ASM_PFX(AsmApEntryPoint)\r
35ASM_PFX(AsmApEntryPoint):\r
36 cli\r
37AsmApEntryPointAcquireLock:\r
38lock bts dword [ApStackLock], 0\r
39 pause\r
40 jc AsmApEntryPointAcquireLock\r
41\r
42 mov esp, [ASM_PFX(mTopOfApCommonStack)]\r
43 call ASM_PFX(ApEntryPointInC)\r
44\r
45 cli\r
46\r
47lock btc dword [ApStackLock], 0\r
48\r
49 mov eax, 0x100\r
50AsmApEntryPointShareLock:\r
51 pause\r
52 dec eax\r
53 jnz AsmApEntryPointShareLock\r
54\r
55 jmp ASM_PFX(AsmApEntryPoint)\r
56\r
57;------------------------------------------------------------------------------\r
58; VOID\r
59; EFIAPI\r
60; AsmApDoneWithCommonStack (\r
61; VOID\r
62; );\r
63;------------------------------------------------------------------------------\r
64global ASM_PFX(AsmApDoneWithCommonStack)\r
65ASM_PFX(AsmApDoneWithCommonStack):\r
66lock btc dword [ApStackLock], 0\r
67 ret\r
68\r