]>
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 | |
718abab1 SD |
14 | .686\r |
15 | .xmm\r | |
fab82c18 JJ |
16 | .model flat, C\r |
17 | \r | |
18 | extern mTopOfApCommonStack:DWORD\r | |
19 | extern 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 | |
26 | ApStackLock 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 | |
37 | AsmApEntryPoint PROC\r | |
38 | \r | |
39 | cli\r | |
40 | AsmApEntryPointAcquireLock:\r | |
41 | lock 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 | |
50 | lock btc dword ptr [ApStackLock], 0\r | |
51 | \r | |
52 | mov eax, 100h\r | |
53 | AsmApEntryPointShareLock:\r | |
54 | pause\r | |
55 | dec eax\r | |
56 | jnz AsmApEntryPointShareLock\r | |
57 | \r | |
58 | jmp AsmApEntryPoint\r | |
59 | \r | |
60 | AsmApEntryPoint ENDP\r | |
61 | \r | |
62 | ;------------------------------------------------------------------------------\r | |
63 | ; VOID\r | |
64 | ; EFIAPI\r | |
65 | ; AsmApDoneWithCommonStack (\r | |
66 | ; VOID\r | |
67 | ; );\r | |
68 | ;------------------------------------------------------------------------------\r | |
69 | AsmApDoneWithCommonStack PROC PUBLIC\r | |
70 | \r | |
71 | lock btc dword ptr [ApStackLock], 0\r | |
72 | ret\r | |
73 | \r | |
74 | AsmApDoneWithCommonStack ENDP\r | |
75 | \r | |
76 | END\r |