UefiCpuPkg/CpuDxe: Enable protection for newly added page table
[mirror_edk2.git] / UefiCpuPkg / Library / SmmCpuPlatformHookLibNull / SmmCpuPlatformHookLibNull.c
CommitLineData
2b63446b
MK
1/** @file\r
2SMM CPU Platform Hook NULL library instance.\r
3\r
4Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14#include <PiSmm.h>\r
15#include <Library/SmmCpuPlatformHookLib.h>\r
16\r
17/**\r
18 Checks if platform produces a valid SMI.\r
19\r
20 This function checks if platform produces a valid SMI. This function is\r
21 called at SMM entry to detect if this is a spurious SMI. This function\r
22 must be implemented in an MP safe way because it is called by multiple CPU\r
23 threads.\r
24\r
25 @retval TRUE There is a valid SMI\r
26 @retval FALSE There is no valid SMI\r
27\r
28**/\r
29BOOLEAN\r
30EFIAPI\r
31PlatformValidSmi (\r
32 VOID\r
33 )\r
34{\r
35 return TRUE;\r
36}\r
37\r
38/**\r
39 Clears platform top level SMI status bit.\r
40\r
41 This function clears platform top level SMI status bit.\r
42\r
43 @retval TRUE The platform top level SMI status is cleared.\r
44 @retval FALSE The platform top level SMI status cannot be cleared.\r
45\r
46**/\r
47BOOLEAN\r
48EFIAPI\r
49ClearTopLevelSmiStatus (\r
50 VOID\r
51 )\r
52{\r
53 return TRUE;\r
54}\r
55\r
56/**\r
57 Performs platform specific way of SMM BSP election.\r
58\r
59 This function performs platform specific way of SMM BSP election.\r
60\r
61 @param IsBsp Output parameter. TRUE: the CPU this function executes\r
62 on is elected to be the SMM BSP. FALSE: the CPU this\r
63 function executes on is to be SMM AP.\r
64\r
65 @retval EFI_SUCCESS The function executes successfully.\r
66 @retval EFI_NOT_READY The function does not determine whether this CPU should be\r
67 BSP or AP. This may occur if hardware init sequence to\r
68 enable the determination is yet to be done, or the function\r
69 chooses not to do BSP election and will let SMM CPU driver to\r
70 use its default BSP election process.\r
71 @retval EFI_DEVICE_ERROR The function cannot determine whether this CPU should be\r
72 BSP or AP due to hardware error.\r
73\r
74**/\r
75EFI_STATUS\r
76EFIAPI\r
77PlatformSmmBspElection (\r
78 OUT BOOLEAN *IsBsp\r
79 )\r
80{\r
81 return EFI_NOT_READY;\r
82}\r
83\r
84/**\r
85 Get platform page table attribute.\r
86\r
87 This function gets page table attribute of platform.\r
88\r
89 @param Address Input parameter. Obtain the page table entries attribute on this address.\r
90 @param PageSize Output parameter. The size of the page.\r
91 @param NumOfPages Output parameter. Number of page.\r
92 @param PageAttribute Output parameter. Paging Attributes (WB, UC, etc).\r
93\r
94 @retval EFI_SUCCESS The platform page table attribute from the address is determined.\r
95 @retval EFI_UNSUPPORTED The platform does not support getting page table attribute for the address.\r
96\r
97**/\r
98EFI_STATUS\r
99EFIAPI\r
100GetPlatformPageTableAttribute (\r
101 IN UINT64 Address,\r
102 IN OUT SMM_PAGE_SIZE_TYPE *PageSize,\r
103 IN OUT UINTN *NumOfPages,\r
104 IN OUT UINTN *PageAttribute\r
105 )\r
106{\r
107 return EFI_UNSUPPORTED;\r
108}\r