3 Copyright (c) 2004 - 2005, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Support for Debug primatives.
24 #include "EfiPrintLib.h"
25 #include "EfiStatusCode.h"
26 #include "EfiCommonLib.h"
27 #include EFI_GUID_DEFINITION (StatusCodeCallerId)
28 #include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
32 IN CONST EFI_PEI_SERVICES
**PeiServices
,
41 Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT
42 information. If Error Logging hub is not loaded DEADLOOP ().
46 PeiServices - The PEI core services table.
48 FileName - File name of failing routine.
50 LineNumber - Line number of failing ASSERT().
52 Description - Description, usually the assertion,
60 UINT64 Buffer
[EFI_STATUS_CODE_DATA_MAX_SIZE
];
62 EfiDebugAssertWorker (FileName
, LineNumber
, Description
, sizeof (Buffer
), Buffer
);
65 // We choose NOT to use PEI_REPORT_STATUS_CODE here, because when debug is enable,
66 // we want get enough information if assert.
68 (**PeiServices
).PeiReportStatusCode (
69 (EFI_PEI_SERVICES
**)PeiServices
,
70 (EFI_ERROR_CODE
| EFI_ERROR_UNRECOVERED
),
71 (EFI_SOFTWARE_PEI_MODULE
| EFI_SW_EC_ILLEGAL_SOFTWARE_STATE
),
74 (EFI_STATUS_CODE_DATA
*) Buffer
83 IN CONST EFI_PEI_SERVICES
**PeiServices
,
92 Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
93 information. If Error Logging hub is not loaded do nothing.
97 PeiServices - The PEI core services table.
99 ErrorLevel - If error level is set do the debug print.
101 Format - String to use for the print, followed by Print arguments.
103 ... - Print arguments
112 UINT64 Buffer
[EFI_STATUS_CODE_DATA_MAX_SIZE
];
114 VA_START (Marker
, Format
);
115 EfiDebugVPrintWorker (ErrorLevel
, Format
, Marker
, sizeof (Buffer
), Buffer
);
118 // We choose NOT to use PEI_REPORT_STATUS_CODE here, because when debug is enable,
119 // we want get enough information if assert.
121 (**PeiServices
).PeiReportStatusCode (
122 (EFI_PEI_SERVICES
**)PeiServices
,
124 (EFI_SOFTWARE_PEI_MODULE
| EFI_DC_UNSPECIFIED
),
127 (EFI_STATUS_CODE_DATA
*) Buffer