fix: [RPL-P] Build error when ENABLE_SOURCE_DEBUG=1.

On platforms where only serial console input is enabled, enabling
source debug will lead to an infinite loop in ConsoleRead(). Newer
compilers detect this and generate a build error.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
This commit is contained in:
Bejean Mosher
2023-03-07 14:24:21 -05:00
committed by Guo Dong
parent a9a4328890
commit 2c81ff2e71

View File

@@ -1,7 +1,7 @@
/** @file
Implementation for console input library
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -79,6 +79,11 @@ ConsoleRead (
Count += ReadCount;
}
}
// If only serial enabled, and Source Debug enabled, return
// error here to prevent infinite loop and build error.
else if (PcdGet32 (PcdConsoleInDeviceMask) == ConsoleInSerialPort) {
return 0;
}
}
if ((PcdGet32 (PcdConsoleInDeviceMask) & ConsoleInUsbKeyboard) != 0) {