]>
Commit | Line | Data |
---|---|---|
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 | |
14 | extern ASM_PFX(mTopOfApCommonStack)\r | |
15 | extern ASM_PFX(ApEntryPointInC)\r | |
16 | \r | |
17 | SECTION .data\r | |
18 | \r | |
19 | ;\r | |
20 | ; This lock only allows one AP to use the mTopOfApCommonStack stack at a time\r | |
21 | ;\r | |
22 | ApStackLock:\r | |
23 | dd 0\r | |
24 | \r | |
25 | SECTION .text\r | |
26 | \r | |
27 | ;------------------------------------------------------------------------------\r | |
28 | ; VOID\r | |
29 | ; EFIAPI\r | |
30 | ; AsmApEntryPoint (\r | |
31 | ; VOID\r | |
32 | ; );\r | |
33 | ;------------------------------------------------------------------------------\r | |
34 | global ASM_PFX(AsmApEntryPoint)\r | |
35 | ASM_PFX(AsmApEntryPoint):\r | |
36 | cli\r | |
37 | AsmApEntryPointAcquireLock:\r | |
38 | lock 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 | |
47 | lock btc dword [ApStackLock], 0\r | |
48 | \r | |
49 | mov eax, 0x100\r | |
50 | AsmApEntryPointShareLock:\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 | |
64 | global ASM_PFX(AsmApDoneWithCommonStack)\r | |
65 | ASM_PFX(AsmApDoneWithCommonStack):\r | |
66 | lock btc dword [ApStackLock], 0\r | |
67 | ret\r | |
68 | \r |