SecFsp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /** @file
  2. Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef _SEC_FSP_H_
  6. #define _SEC_FSP_H_
  7. #include <PiPei.h>
  8. #include <FspEas.h>
  9. #include <Library/PcdLib.h>
  10. #include <Library/BaseLib.h>
  11. #include <Library/DebugLib.h>
  12. #include <Library/SerialPortLib.h>
  13. #include <Library/BaseMemoryLib.h>
  14. #include <Library/FspCommonLib.h>
  15. #include <Library/FspSecPlatformLib.h>
  16. #define FSP_MCUD_SIGNATURE SIGNATURE_32 ('M', 'C', 'U', 'D')
  17. #define FSP_PER0_SIGNATURE SIGNATURE_32 ('P', 'E', 'R', '0')
  18. /**
  19. Calculate the FSP IDT gate descriptor.
  20. @param[in] IdtEntryTemplate IDT gate descriptor template.
  21. @return FSP specific IDT gate descriptor.
  22. **/
  23. IA32_IDT_GATE_DESCRIPTOR
  24. FspGetExceptionHandler (
  25. IN UINT64 IdtEntryTemplate
  26. );
  27. /**
  28. Initialize the FSP global data region.
  29. It needs to be done as soon as possible after the stack is setup.
  30. @param[in,out] PeiFspData Pointer of the FSP global data.
  31. @param[in] BootLoaderStack BootLoader stack.
  32. @param[in] ApiIdx The index of the FSP API.
  33. **/
  34. VOID
  35. FspGlobalDataInit (
  36. IN OUT FSP_GLOBAL_DATA *PeiFspData,
  37. IN UINTN BootLoaderStack,
  38. IN UINT8 ApiIdx
  39. );
  40. /**
  41. Adjust the FSP data pointers after the stack is migrated to memory.
  42. @param[in] OffsetGap The offset gap between the old stack and the new stack.
  43. **/
  44. VOID
  45. FspDataPointerFixUp (
  46. IN UINTN OffsetGap
  47. );
  48. /**
  49. This interface returns the base address of FSP binary.
  50. @return FSP binary base address.
  51. **/
  52. UINTN
  53. EFIAPI
  54. AsmGetFspBaseAddress (
  55. VOID
  56. );
  57. /**
  58. This interface gets FspInfoHeader pointer
  59. @return FSP binary base address.
  60. **/
  61. UINTN
  62. EFIAPI
  63. AsmGetFspInfoHeader (
  64. VOID
  65. );
  66. #endif