]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / Include / Library / SmmCpuPlatformHookLib.h
CommitLineData
2b63446b
MK
1/** @file\r
2 Public include file for the SMM CPU Platform Hook Library.\r
3\r
4 Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
0acd8697 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
2b63446b
MK
6\r
7**/\r
8\r
9#ifndef __SMM_CPU_PLATFORM_HOOK_LIB_H__\r
10#define __SMM_CPU_PLATFORM_HOOK_LIB_H__\r
11\r
12///\r
13/// SMM Page Size Type\r
14///\r
15typedef enum {\r
16 SmmPageSize4K,\r
17 SmmPageSize2M,\r
18 SmmPageSize1G,\r
19 MaxSmmPageSizeType\r
20} SMM_PAGE_SIZE_TYPE;\r
21\r
22/**\r
23 Checks if platform produces a valid SMI.\r
24\r
25 This function checks if platform produces a valid SMI. This function is\r
26 called at SMM entry to detect if this is a spurious SMI. This function\r
27 must be implemented in an MP safe way because it is called by multiple CPU\r
28 threads.\r
29\r
30 @retval TRUE There is a valid SMI\r
31 @retval FALSE There is no valid SMI\r
32\r
33**/\r
34BOOLEAN\r
35EFIAPI\r
36PlatformValidSmi (\r
37 VOID\r
38 );\r
39\r
40/**\r
41 Clears platform top level SMI status bit.\r
42\r
43 This function clears platform top level SMI status bit.\r
44\r
45 @retval TRUE The platform top level SMI status is cleared.\r
46 @retval FALSE The platform top level SMI status cannot be cleared.\r
47\r
48**/\r
49BOOLEAN\r
50EFIAPI\r
51ClearTopLevelSmiStatus (\r
52 VOID\r
53 );\r
54\r
55/**\r
56 Performs platform specific way of SMM BSP election.\r
57\r
58 This function performs platform specific way of SMM BSP election.\r
59\r
60 @param IsBsp Output parameter. TRUE: the CPU this function executes\r
61 on is elected to be the SMM BSP. FALSE: the CPU this\r
62 function executes on is to be SMM AP.\r
63\r
64 @retval EFI_SUCCESS The function executes successfully.\r
65 @retval EFI_NOT_READY The function does not determine whether this CPU should be\r
66 BSP or AP. This may occur if hardware init sequence to\r
67 enable the determination is yet to be done, or the function\r
68 chooses not to do BSP election and will let SMM CPU driver to\r
69 use its default BSP election process.\r
70 @retval EFI_DEVICE_ERROR The function cannot determine whether this CPU should be\r
71 BSP or AP due to hardware error.\r
72\r
73**/\r
74EFI_STATUS\r
75EFIAPI\r
76PlatformSmmBspElection (\r
77 OUT BOOLEAN *IsBsp\r
78 );\r
79\r
80/**\r
81 Get platform page table attribute .\r
82\r
83 This function gets page table attribute of platform.\r
84\r
85 @param Address Input parameter. Obtain the page table entries attribute on this address.\r
86 @param PageSize Output parameter. The size of the page.\r
87 @param NumOfPages Output parameter. Number of page.\r
88 @param PageAttribute Output parameter. Paging Attributes (WB, UC, etc).\r
89\r
90 @retval EFI_SUCCESS The platform page table attribute from the address is determined.\r
91 @retval EFI_UNSUPPORTED The platform does not support getting page table attribute for the address.\r
92\r
93**/\r
94EFI_STATUS\r
95EFIAPI\r
96GetPlatformPageTableAttribute (\r
97 IN UINT64 Address,\r
98 OUT SMM_PAGE_SIZE_TYPE *PageSize,\r
99 OUT UINTN *NumOfPages,\r
100 OUT UINTN *PageAttribute\r
101 );\r
102\r
103#endif\r