]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c
OvmfPkg/VirtioMmioDeviceLib: list "VirtioMmioDevice.h" in the INF file
[mirror_edk2.git] / OvmfPkg / Library / PlatformDebugLibIoPort / DebugLibDetect.c
CommitLineData
c9eb56e5 1/** @file\r
c09d9571
PB
2 Detection code for QEMU debug port.\r
3 Non-SEC instance, caches the result of detection.\r
c9eb56e5
PB
4\r
5 Copyright (c) 2017, Red Hat, Inc.<BR>\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include <Base.h>\r
c09d9571
PB
17#include "DebugLibDetect.h"\r
18\r
19//\r
20// Set to TRUE if the debug I/O port is enabled\r
21//\r
22STATIC BOOLEAN mDebugIoPortFound = FALSE;\r
c9eb56e5
PB
23\r
24/**\r
c09d9571
PB
25 This constructor function checks if the debug I/O port device is present,\r
26 caching the result for later use.\r
c9eb56e5
PB
27\r
28 @retval RETURN_SUCCESS The constructor always returns RETURN_SUCCESS.\r
29\r
30**/\r
31RETURN_STATUS\r
32EFIAPI\r
33PlatformDebugLibIoPortConstructor (\r
34 VOID\r
35 )\r
36{\r
c09d9571 37 mDebugIoPortFound = PlatformDebugLibIoPortDetect();\r
c9eb56e5
PB
38 return RETURN_SUCCESS;\r
39}\r
c09d9571
PB
40\r
41/**\r
42 Return the cached result of detecting the debug I/O port device.\r
43\r
44 @retval TRUE if the debug I/O port device was detected.\r
45 @retval FALSE otherwise\r
46\r
47**/\r
48BOOLEAN\r
49EFIAPI\r
50PlatformDebugLibIoPortFound (\r
51 VOID\r
52 )\r
53{\r
54 return mDebugIoPortFound;\r
55}\r