SmmCpuFeaturesLibNoStm.c 2.9 KB

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