]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c
UefiCpuPkg: Apply uncrustify changes
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / Ia32 / Semaphore.c
... / ...
CommitLineData
1/** @file\r
2Semaphore mechanism to indicate to the BSP that an AP has exited SMM\r
3after SMBASE relocation.\r
4\r
5Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
6SPDX-License-Identifier: BSD-2-Clause-Patent\r
7\r
8**/\r
9\r
10#include "PiSmmCpuDxeSmm.h"\r
11\r
12UINTN mSmmRelocationOriginalAddress;\r
13volatile 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
25VOID\r
26SemaphoreHook (\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
35 CpuState = (SMRAM_SAVE_STATE_MAP *)(UINTN)(SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET);\r
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