]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / UefiCpuPkg / Library / SmmCpuFeaturesLib / SmmCpuFeaturesLibNoStm.c
1 /** @file
2 The CPU specific programming for PiSmmCpuDxeSmm module when STM support
3 is not included.
4
5 Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include <PiMm.h>
11 #include <Library/SmmCpuFeaturesLib.h>
12 #include "CpuFeaturesLib.h"
13
14 /**
15 Internal worker function that is called to complete CPU initialization at the
16 end of SmmCpuFeaturesInitializeProcessor().
17
18 **/
19 VOID
20 FinishSmmCpuFeaturesInitializeProcessor (
21 VOID
22 )
23 {
24 }
25
26 /**
27 Return the size, in bytes, of a custom SMI Handler in bytes. If 0 is
28 returned, then a custom SMI handler is not provided by this library,
29 and the default SMI handler must be used.
30
31 @retval 0 Use the default SMI handler.
32 @retval > 0 Use the SMI handler installed by SmmCpuFeaturesInstallSmiHandler()
33 The caller is required to allocate enough SMRAM for each CPU to
34 support the size of the custom SMI handler.
35 **/
36 UINTN
37 EFIAPI
38 SmmCpuFeaturesGetSmiHandlerSize (
39 VOID
40 )
41 {
42 return 0;
43 }
44
45 /**
46 Install a custom SMI handler for the CPU specified by CpuIndex. This function
47 is only called if SmmCpuFeaturesGetSmiHandlerSize() returns a size is greater
48 than zero and is called by the CPU that was elected as monarch during System
49 Management Mode initialization.
50
51 @param[in] CpuIndex The index of the CPU to install the custom SMI handler.
52 The value must be between 0 and the NumberOfCpus field
53 in the System Management System Table (SMST).
54 @param[in] SmBase The SMBASE address for the CPU specified by CpuIndex.
55 @param[in] SmiStack The stack to use when an SMI is processed by the
56 the CPU specified by CpuIndex.
57 @param[in] StackSize The size, in bytes, if the stack used when an SMI is
58 processed by the CPU specified by CpuIndex.
59 @param[in] GdtBase The base address of the GDT to use when an SMI is
60 processed by the CPU specified by CpuIndex.
61 @param[in] GdtSize The size, in bytes, of the GDT used when an SMI is
62 processed by the CPU specified by CpuIndex.
63 @param[in] IdtBase The base address of the IDT to use when an SMI is
64 processed by the CPU specified by CpuIndex.
65 @param[in] IdtSize The size, in bytes, of the IDT used when an SMI is
66 processed by the CPU specified by CpuIndex.
67 @param[in] Cr3 The base address of the page tables to use when an SMI
68 is processed by the CPU specified by CpuIndex.
69 **/
70 VOID
71 EFIAPI
72 SmmCpuFeaturesInstallSmiHandler (
73 IN UINTN CpuIndex,
74 IN UINT32 SmBase,
75 IN VOID *SmiStack,
76 IN UINTN StackSize,
77 IN UINTN GdtBase,
78 IN UINTN GdtSize,
79 IN UINTN IdtBase,
80 IN UINTN IdtSize,
81 IN UINT32 Cr3
82 )
83 {
84 }