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