]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm
UefiCpuPkg: Avoid "error A2085" when DDK3790 tool chain is used
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / Ia32 / MpAsm.asm
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
718abab1
SD
14.686\r
15.xmm\r
fab82c18
JJ
16.model flat, C\r
17\r
18extern mTopOfApCommonStack:DWORD\r
19extern ApEntryPointInC:PROC\r
20\r
21.code\r
22\r
23;\r
24; This lock only allows one AP to use the mTopOfApCommonStack stack at a time\r
25;\r
26ApStackLock dd 0\r
27\r
28;.code\r
29\r
30;------------------------------------------------------------------------------\r
31; VOID\r
32; EFIAPI\r
33; AsmApEntryPoint (\r
34; VOID\r
35; );\r
36;------------------------------------------------------------------------------\r
37AsmApEntryPoint PROC\r
38\r
39 cli\r
40AsmApEntryPointAcquireLock:\r
41lock bts dword ptr [ApStackLock], 0\r
42 pause\r
43 jc AsmApEntryPointAcquireLock\r
44\r
45 mov esp, [mTopOfApCommonStack]\r
46 call ApEntryPointInC\r
47\r
48 cli\r
49\r
50lock btc dword ptr [ApStackLock], 0\r
51\r
52 mov eax, 100h\r
53AsmApEntryPointShareLock:\r
54 pause\r
55 dec eax\r
56 jnz AsmApEntryPointShareLock\r
57\r
58 jmp AsmApEntryPoint\r
59\r
60AsmApEntryPoint ENDP\r
61\r
62;------------------------------------------------------------------------------\r
63; VOID\r
64; EFIAPI\r
65; AsmApDoneWithCommonStack (\r
66; VOID\r
67; );\r
68;------------------------------------------------------------------------------\r
69AsmApDoneWithCommonStack PROC PUBLIC\r
70\r
71lock btc dword ptr [ApStackLock], 0\r
72 ret\r
73\r
74AsmApDoneWithCommonStack ENDP\r
75\r
76END\r