PlatformStatusCode.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*++
  2. Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. Module Name:
  5. PlatformStatusCode.h
  6. Abstract:
  7. Contains Platform specific implementations required to use status codes.
  8. --*/
  9. #ifndef _PLATFORM_STATUS_CODE_H_
  10. #define _PLATFORM_STATUS_CODE_H_
  11. #define CONFIG_PORT0 0x4E
  12. #define INDEX_PORT0 0x4E
  13. #define DATA_PORT0 0x4F
  14. #define PCI_IDX 0xCF8
  15. #define PCI_DAT 0xCFC
  16. #include "MonoStatusCode.h"
  17. #ifndef _PEI_PORT_80_STATUS_CODE_H_
  18. #define _PEI_PORT_80_STATUS_CODE_H_
  19. //
  20. // Status code reporting function
  21. //
  22. EFI_STATUS
  23. Port80ReportStatusCode (
  24. IN CONST EFI_PEI_SERVICES **PeiServices,
  25. IN EFI_STATUS_CODE_TYPE CodeType,
  26. IN EFI_STATUS_CODE_VALUE Value,
  27. IN UINT32 Instance,
  28. IN CONST EFI_GUID * CallerId,
  29. IN CONST EFI_STATUS_CODE_DATA * Data OPTIONAL
  30. );
  31. #endif
  32. #ifndef _PEI_SERIAL_STATUS_CODE_LIB_H_
  33. #define _PEI_SERIAL_STATUS_CODE_LIB_H_
  34. #include <Guid/StatusCodeDataTypeId.h>
  35. #include <Guid/StatusCodeDataTypeDebug.h>
  36. #include <Library/ReportStatusCodeLib.h>
  37. #include <Library/PrintLib.h>
  38. #include <Library/BaseMemoryLib.h>
  39. //
  40. // Initialization function
  41. //
  42. VOID
  43. SerialInitializeStatusCode (
  44. VOID
  45. );
  46. //
  47. // Status code reporting function
  48. //
  49. EFI_STATUS
  50. SerialReportStatusCode (
  51. IN CONST EFI_PEI_SERVICES **PeiServices,
  52. IN EFI_STATUS_CODE_TYPE CodeType,
  53. IN EFI_STATUS_CODE_VALUE Value,
  54. IN UINT32 Instance,
  55. IN CONST EFI_GUID * CallerId,
  56. IN CONST EFI_STATUS_CODE_DATA * Data OPTIONAL
  57. );
  58. #endif
  59. extern EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi;
  60. extern EFI_PEI_PPI_DESCRIPTOR mPpiListStatusCode;
  61. #define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
  62. #define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
  63. #define STATUSCODE_PEIM_SIGNATURE EFI_SIGNATURE_32 ('p', 's', 't', 'c')
  64. typedef struct {
  65. UINT32 Signature;
  66. EFI_FFS_FILE_HEADER *FfsHeader;
  67. EFI_PEI_NOTIFY_DESCRIPTOR StatusCodeNotify;
  68. } STATUSCODE_CALLBACK_STATE_INFORMATION;
  69. #pragma pack(1)
  70. typedef struct {
  71. UINT16 Limit;
  72. UINT32 Base;
  73. } GDT_DSCRIPTOR;
  74. #pragma pack()
  75. #define STATUSCODE_PEIM_FROM_THIS(a) \
  76. BASE_CR ( \
  77. a, \
  78. STATUSCODE_CALLBACK_STATE_INFORMATION, \
  79. StatusCodeNotify \
  80. )
  81. VOID
  82. EFIAPI
  83. PlatformInitializeStatusCode (
  84. IN EFI_FFS_FILE_HEADER *FfsHeader,
  85. IN CONST EFI_PEI_SERVICES **PeiServices
  86. );
  87. //
  88. // Function declarations
  89. //
  90. /**
  91. Install Firmware Volume Hob's once there is main memory
  92. @param PeiServices General purpose services available to every PEIM.
  93. @param NotifyDescriptor Not Used
  94. @param Ppi Not Used
  95. @retval Status EFI_SUCCESS if the interface could be successfully
  96. installed
  97. **/
  98. EFI_STATUS
  99. EFIAPI
  100. MemoryDiscoveredPpiNotifyCallback (
  101. IN EFI_PEI_SERVICES **PeiServices,
  102. IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
  103. IN VOID *Ppi
  104. );
  105. #endif