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 <PiSmm.h>
11 #include <Library/SmmCpuFeaturesLib.h>
12 
13 /**
14   Internal worker function that is called to complete CPU initialization at the
15   end of SmmCpuFeaturesInitializeProcessor().
16 
17 **/
18 VOID
FinishSmmCpuFeaturesInitializeProcessor(VOID)19 FinishSmmCpuFeaturesInitializeProcessor (
20   VOID
21   )
22 {
23 }
24 
25 /**
26   Return the size, in bytes, of a custom SMI Handler in bytes.  If 0 is
27   returned, then a custom SMI handler is not provided by this library,
28   and the default SMI handler must be used.
29 
30   @retval 0    Use the default SMI handler.
31   @retval > 0  Use the SMI handler installed by SmmCpuFeaturesInstallSmiHandler()
32                The caller is required to allocate enough SMRAM for each CPU to
33                support the size of the custom SMI handler.
34 **/
35 UINTN
36 EFIAPI
SmmCpuFeaturesGetSmiHandlerSize(VOID)37 SmmCpuFeaturesGetSmiHandlerSize (
38   VOID
39   )
40 {
41   return 0;
42 }
43 
44 /**
45   Install a custom SMI handler for the CPU specified by CpuIndex.  This function
46   is only called if SmmCpuFeaturesGetSmiHandlerSize() returns a size is greater
47   than zero and is called by the CPU that was elected as monarch during System
48   Management Mode initialization.
49 
50   @param[in] CpuIndex   The index of the CPU to install the custom SMI handler.
51                         The value must be between 0 and the NumberOfCpus field
52                         in the System Management System Table (SMST).
53   @param[in] SmBase     The SMBASE address for the CPU specified by CpuIndex.
54   @param[in] SmiStack   The stack to use when an SMI is processed by the
55                         the CPU specified by CpuIndex.
56   @param[in] StackSize  The size, in bytes, if the stack used when an SMI is
57                         processed by the CPU specified by CpuIndex.
58   @param[in] GdtBase    The base address of the GDT to use when an SMI is
59                         processed by the CPU specified by CpuIndex.
60   @param[in] GdtSize    The size, in bytes, of the GDT used when an SMI is
61                         processed by the CPU specified by CpuIndex.
62   @param[in] IdtBase    The base address of the IDT to use when an SMI is
63                         processed by the CPU specified by CpuIndex.
64   @param[in] IdtSize    The size, in bytes, of the IDT used when an SMI is
65                         processed by the CPU specified by CpuIndex.
66   @param[in] Cr3        The base address of the page tables to use when an SMI
67                         is processed by the CPU specified by CpuIndex.
68 **/
69 VOID
70 EFIAPI
SmmCpuFeaturesInstallSmiHandler(IN UINTN CpuIndex,IN UINT32 SmBase,IN VOID * SmiStack,IN UINTN StackSize,IN UINTN GdtBase,IN UINTN GdtSize,IN UINTN IdtBase,IN UINTN IdtSize,IN UINT32 Cr3)71 SmmCpuFeaturesInstallSmiHandler (
72   IN UINTN   CpuIndex,
73   IN UINT32  SmBase,
74   IN VOID    *SmiStack,
75   IN UINTN   StackSize,
76   IN UINTN   GdtBase,
77   IN UINTN   GdtSize,
78   IN UINTN   IdtBase,
79   IN UINTN   IdtSize,
80   IN UINT32  Cr3
81   )
82 {
83 }
84