DxeMePolicyUpdate.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /** @file
  2. Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef _DXE_ME_POLICY_UPDATE_H_
  6. #define _DXE_ME_POLICY_UPDATE_H_
  7. #include <PiDxe.h>
  8. #include <Library/UefiBootServicesTableLib.h>
  9. #include <Library/UefiRuntimeServicesTableLib.h>
  10. #include <Library/DebugLib.h>
  11. #include <Guid/EventGroup.h>
  12. #include <IndustryStandard/Acpi10.h>
  13. #include <Library/BaseMemoryLib.h>
  14. #include <Protocol/MePolicy.h>
  15. #include <Library/HobLib.h>
  16. #include <ConfigBlock/MePeiConfig.h>
  17. #define PLATFORM_BOOT_TABLE_PTR_TYPE 0x1001
  18. #define PLATFORM_BOOT_RECORD_TYPE 0x1022
  19. //
  20. // Timeout values based on HPET
  21. //
  22. #define HECI_MSG_DELAY 2000000 ///< show warning msg and stay for 2 seconds.
  23. #define CONVERSION_MULTIPLIER 1000000 ///< msec to nanosec multiplier
  24. #define PLATFORM_BOOT_TABLE_SIGNATURE SIGNATURE_32 ('P', 'B', 'P', 'T')
  25. //
  26. // Platform Boot Performance Table Record
  27. //
  28. typedef struct {
  29. UINT16 Type;
  30. UINT8 Length;
  31. UINT8 Revision;
  32. UINT32 Reserved;
  33. UINT64 TimestampDelta1;
  34. UINT64 TimestampDelta2;
  35. UINT64 TimestampDelta3;
  36. } PLATFORM_BOOT_TABLE_RECORD;
  37. //
  38. // Platform boot Performance Table
  39. //
  40. typedef struct {
  41. EFI_ACPI_COMMON_HEADER Header;
  42. PLATFORM_BOOT_TABLE_RECORD PlatformBoot;
  43. } PLATFORM_BOOT_PERFORMANCE_TABLE;
  44. /**
  45. Update ME Policy while MePlatformProtocol is installed.
  46. @param[in] MePolicyInstance Instance of ME Policy Protocol
  47. **/
  48. VOID
  49. UpdateMePolicyFromMeSetup (
  50. IN ME_POLICY_PROTOCOL *MePolicyInstance
  51. );
  52. /**
  53. Update ME Policy if Setup variable exists.
  54. @param[in, out] MePolicyInstance Instance of ME Policy Protocol
  55. **/
  56. VOID
  57. UpdateMePolicyFromSetup (
  58. IN OUT ME_POLICY_PROTOCOL *MePolicyInstance
  59. );
  60. /**
  61. Functions performs HECI exchange with FW to update MePolicy settings.
  62. @param[in] Event A pointer to the Event that triggered the callback.
  63. @param[in] Context A pointer to private data registered with the callback function.
  64. **/
  65. VOID
  66. EFIAPI
  67. UpdateMeSetupCallback (
  68. IN EFI_EVENT Event,
  69. IN VOID *Context
  70. );
  71. #endif