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