]>
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 | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #include "PiSmmCpuDxeSmm.h"\r | |
17 | \r | |
18 | UINTN mSmmRelocationOriginalAddress;\r | |
19 | volatile BOOLEAN *mRebasedFlag;\r | |
20 | \r | |
21 | /**\r | |
22 | Hook return address of SMM Save State so that semaphore code\r | |
23 | can be executed immediately after AP exits SMM to indicate to\r | |
24 | the BSP that an AP has exited SMM after SMBASE relocation.\r | |
25 | \r | |
26 | @param[in] CpuIndex The processor index.\r | |
27 | @param[in] RebasedFlag A pointer to a flag that is set to TRUE\r | |
28 | immediately after AP exits SMM.\r | |
29 | \r | |
30 | **/\r | |
31 | VOID\r | |
32 | SemaphoreHook (\r | |
33 | IN UINTN CpuIndex,\r | |
34 | IN volatile BOOLEAN *RebasedFlag\r | |
35 | )\r | |
36 | {\r | |
37 | SMRAM_SAVE_STATE_MAP *CpuState;\r | |
38 | \r | |
39 | mRebasedFlag = RebasedFlag;\r | |
40 | \r | |
41 | CpuState = (SMRAM_SAVE_STATE_MAP *)(UINTN)(SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET);\r | |
42 | mSmmRelocationOriginalAddress = (UINTN)HookReturnFromSmm (\r | |
43 | CpuIndex,\r | |
44 | CpuState,\r | |
45 | (UINT64)(UINTN)&SmmRelocationSemaphoreComplete,\r | |
46 | (UINT64)(UINTN)&SmmRelocationSemaphoreComplete\r | |
47 | );\r | |
48 | }\r |