// Use atom operation to avoid the reentant of report.\r
// If current status is not zero, then the function is reentrancy.\r
//\r
- if (InterlockedCompareExchange32 (&gDxeStatusCode.StatusCodeNestStatus, 0, 1)) {\r
+ if (1 == InterlockedCompareExchange32 (&gDxeStatusCode.StatusCodeNestStatus, 0, 1)) {\r
return EFI_DEVICE_ERROR;\r
}\r
\r
@param Data This optional parameter may be used to pass additional data\r
\r
@retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.\r
+ @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .\r
@retval EFI_SUCCESS Success to cache status code and signal log data event.\r
\r
**/\r
// See whether in runtime phase or not.\r
//\r
if (EfiAtRuntime ()) {\r
- return EFI_SUCCESS;\r
+ return EFI_DEVICE_ERROR;\r
}\r
\r
- Record = (DATAHUB_STATUSCODE_RECORD *) AcquireRecordBuffer ();\r
+ Record = AcquireRecordBuffer ();\r
if (Record == NULL) {\r
//\r
// There are no empty record buffer in private buffers\r