2 Semaphore mechanism to indicate to the BSP that an AP has exited SMM
3 after SMBASE relocation.
5 Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "PiSmmCpuDxeSmm.h"
12 UINTN mSmmRelocationOriginalAddress
;
13 volatile BOOLEAN
*mRebasedFlag
;
16 Hook return address of SMM Save State so that semaphore code
17 can be executed immediately after AP exits SMM to indicate to
18 the BSP that an AP has exited SMM after SMBASE relocation.
20 @param[in] CpuIndex The processor index.
21 @param[in] RebasedFlag A pointer to a flag that is set to TRUE
22 immediately after AP exits SMM.
28 IN
volatile BOOLEAN
*RebasedFlag
31 SMRAM_SAVE_STATE_MAP
*CpuState
;
33 mRebasedFlag
= RebasedFlag
;
35 CpuState
= (SMRAM_SAVE_STATE_MAP
*)(UINTN
)(SMM_DEFAULT_SMBASE
+ SMRAM_SAVE_STATE_MAP_OFFSET
);
36 mSmmRelocationOriginalAddress
= (UINTN
)HookReturnFromSmm (
39 (UINT64
)(UINTN
)&SmmRelocationSemaphoreComplete
,
40 (UINT64
)(UINTN
)&SmmRelocationSemaphoreComplete