ShadowMicrocode.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /** @file
  2. This file declares EDKII Shadow Microcode PPI.
  3. Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __PPI_SHADOW_MICROCODE_H__
  7. #define __PPI_SHADOW_MICROCODE_H__
  8. #define EDKII_PEI_SHADOW_MICROCODE_PPI_GUID \
  9. { \
  10. 0x430f6965, 0x9a69, 0x41c5, { 0x93, 0xed, 0x8b, 0xf0, 0x64, 0x35, 0xc1, 0xc6 } \
  11. }
  12. typedef struct _EDKII_PEI_SHADOW_MICROCODE_PPI EDKII_PEI_SHADOW_MICROCODE_PPI;
  13. typedef struct {
  14. UINT32 ProcessorSignature;
  15. UINT8 PlatformId;
  16. } EDKII_PEI_MICROCODE_CPU_ID;
  17. /**
  18. Shadow microcode update patches to memory.
  19. The function is used for shadowing microcode update patches to a continuous memory.
  20. It shall allocate memory buffer and only shadow the microcode patches for those
  21. processors specified by MicrocodeCpuId array. The checksum verification may be
  22. skiped in this function so the caller must perform checksum verification before
  23. using the microcode patches in returned memory buffer.
  24. @param[in] This The PPI instance pointer.
  25. @param[in] CpuIdCount Number of elements in MicrocodeCpuId array.
  26. @param[in] MicrocodeCpuId A pointer to an array of EDKII_PEI_MICROCODE_CPU_ID
  27. structures.
  28. @param[out] BufferSize Pointer to receive the total size of Buffer.
  29. @param[out] Buffer Pointer to receive address of allocated memory
  30. with microcode patches data in it.
  31. @retval EFI_SUCCESS The microcode has been shadowed to memory.
  32. @retval EFI_OUT_OF_RESOURCES The operation fails due to lack of resources.
  33. **/
  34. typedef
  35. EFI_STATUS
  36. (EFIAPI *EDKII_PEI_SHADOW_MICROCODE)(
  37. IN EDKII_PEI_SHADOW_MICROCODE_PPI *This,
  38. IN UINTN CpuIdCount,
  39. IN EDKII_PEI_MICROCODE_CPU_ID *MicrocodeCpuId,
  40. OUT UINTN *BufferSize,
  41. OUT VOID **Buffer
  42. );
  43. ///
  44. /// This PPI is installed by some platform or chipset-specific PEIM that
  45. /// abstracts handling microcode shadow support.
  46. ///
  47. struct _EDKII_PEI_SHADOW_MICROCODE_PPI {
  48. EDKII_PEI_SHADOW_MICROCODE ShadowMicrocode;
  49. };
  50. extern EFI_GUID gEdkiiPeiShadowMicrocodePpiGuid;
  51. #endif