]>
Commit | Line | Data |
---|---|---|
7947da3c MK |
1 | /** @file\r |
2 | Semaphore mechanism to indicate to the BSP that an AP has exited SMM\r | |
3 | after SMBASE relocation.\r | |
4 | \r | |
5 | Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r | |
0acd8697 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
7947da3c MK |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #include "PiSmmCpuDxeSmm.h"\r | |
11 | \r | |
12 | UINTN mSmmRelocationOriginalAddress;\r | |
13 | volatile BOOLEAN *mRebasedFlag;\r | |
14 | \r | |
15 | /**\r | |
16 | Hook return address of SMM Save State so that semaphore code\r | |
17 | can be executed immediately after AP exits SMM to indicate to\r | |
18 | the BSP that an AP has exited SMM after SMBASE relocation.\r | |
19 | \r | |
20 | @param[in] CpuIndex The processor index.\r | |
21 | @param[in] RebasedFlag A pointer to a flag that is set to TRUE\r | |
22 | immediately after AP exits SMM.\r | |
23 | \r | |
24 | **/\r | |
25 | VOID\r | |
26 | SemaphoreHook (\r | |
27 | IN UINTN CpuIndex,\r | |
28 | IN volatile BOOLEAN *RebasedFlag\r | |
29 | )\r | |
30 | {\r | |
31 | SMRAM_SAVE_STATE_MAP *CpuState;\r | |
32 | \r | |
33 | mRebasedFlag = RebasedFlag;\r | |
34 | \r | |
053e878b | 35 | CpuState = (SMRAM_SAVE_STATE_MAP *)(UINTN)(SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET);\r |
7947da3c MK |
36 | mSmmRelocationOriginalAddress = (UINTN)HookReturnFromSmm (\r |
37 | CpuIndex,\r | |
38 | CpuState,\r | |
39 | (UINT64)(UINTN)&SmmRelocationSemaphoreComplete,\r | |
40 | (UINT64)(UINTN)&SmmRelocationSemaphoreComplete\r | |
41 | );\r | |
42 | }\r |