]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Debug.c
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Pei / PeiLib / Debug.c
CommitLineData
3eb9473e 1/*++\r
2\r
4ea9375a
HT
3Copyright (c) 2004 - 2005, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 Debug.c\r
15\r
16Abstract:\r
17\r
18 Support for Debug primatives. \r
19\r
20--*/\r
21\r
22#include "Tiano.h"\r
23#include "Pei.h"\r
24#include "EfiPrintLib.h"\r
25#include "EfiStatusCode.h"\r
26#include "EfiCommonLib.h"\r
27#include EFI_GUID_DEFINITION (StatusCodeCallerId)\r
28#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)\r
29\r
30VOID\r
31PeiDebugAssert (\r
32 IN CONST EFI_PEI_SERVICES **PeiServices,\r
33 IN CHAR8 *FileName,\r
34 IN INTN LineNumber,\r
35 IN CHAR8 *Description\r
36 )\r
37/*++\r
38\r
39Routine Description:\r
40\r
41 Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT\r
42 information. If Error Logging hub is not loaded DEADLOOP ().\r
43 \r
44Arguments:\r
45\r
46 PeiServices - The PEI core services table.\r
47\r
48 FileName - File name of failing routine.\r
49\r
50 LineNumber - Line number of failing ASSERT().\r
51\r
52 Description - Description, usually the assertion,\r
53 \r
54Returns:\r
55 \r
56 None\r
57\r
58--*/\r
59{\r
60 UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
61\r
62 EfiDebugAssertWorker (FileName, LineNumber, Description, sizeof (Buffer), Buffer);\r
63\r
64 //\r
65 // We choose NOT to use PEI_REPORT_STATUS_CODE here, because when debug is enable,\r
66 // we want get enough information if assert.\r
67 //\r
68 (**PeiServices).PeiReportStatusCode (\r
69 (EFI_PEI_SERVICES**)PeiServices,\r
70 (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r
71 (EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),\r
72 0,\r
73 &gEfiCallerIdGuid,\r
74 (EFI_STATUS_CODE_DATA *) Buffer\r
75 );\r
76\r
77 EFI_DEADLOOP ();\r
78}\r
79\r
80\r
81VOID\r
82PeiDebugPrint (\r
83 IN CONST EFI_PEI_SERVICES **PeiServices,\r
84 IN UINTN ErrorLevel,\r
85 IN CHAR8 *Format,\r
86 ...\r
87 )\r
88/*++\r
89\r
90Routine Description:\r
91\r
92 Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT\r
93 information. If Error Logging hub is not loaded do nothing.\r
94 \r
95Arguments:\r
96\r
97 PeiServices - The PEI core services table.\r
98\r
99 ErrorLevel - If error level is set do the debug print.\r
100\r
101 Format - String to use for the print, followed by Print arguments.\r
102\r
103 ... - Print arguments\r
104 \r
105Returns:\r
106 \r
107 None\r
108\r
109--*/\r
110{\r
111 VA_LIST Marker;\r
112 UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
113\r
114 VA_START (Marker, Format);\r
115 EfiDebugVPrintWorker (ErrorLevel, Format, Marker, sizeof (Buffer), Buffer);\r
116\r
117 //\r
118 // We choose NOT to use PEI_REPORT_STATUS_CODE here, because when debug is enable,\r
119 // we want get enough information if assert.\r
120 //\r
121 (**PeiServices).PeiReportStatusCode (\r
122 (EFI_PEI_SERVICES**)PeiServices,\r
123 EFI_DEBUG_CODE,\r
124 (EFI_SOFTWARE_PEI_MODULE | EFI_DC_UNSPECIFIED),\r
125 0,\r
126 &gEfiCallerIdGuid,\r
127 (EFI_STATUS_CODE_DATA *) Buffer\r
128 );\r
129\r
130 return ;\r
131}\r