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