]>
Commit | Line | Data |
---|---|---|
52f01212 AP |
1 | /** @file\r |
2 | Detection code for QEMU debug port.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r | |
5 | Copyright (c) 2012, Red Hat, Inc.<BR>\r | |
6 | Copyright (c) 2020, Citrix Systems, Inc.\r | |
7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
8 | \r | |
9 | **/\r | |
10 | \r | |
11 | #include <Library/IoLib.h>\r | |
12 | #include <Library/PcdLib.h>\r | |
13 | #include "DebugLibDetect.h"\r | |
14 | \r | |
15 | //\r | |
16 | // The constant value that is read from the debug I/O port\r | |
17 | //\r | |
ac0a286f | 18 | #define BOCHS_DEBUG_PORT_MAGIC 0xE9\r |
52f01212 AP |
19 | \r |
20 | /**\r | |
21 | Return the result of detecting the debug I/O port device.\r | |
22 | \r | |
23 | @retval TRUE if the debug I/O port device was detected.\r | |
24 | @retval FALSE otherwise\r | |
25 | \r | |
26 | **/\r | |
27 | BOOLEAN\r | |
28 | EFIAPI\r | |
29 | PlatformDebugLibIoPortDetect (\r | |
30 | VOID\r | |
31 | )\r | |
32 | {\r | |
33 | return IoRead8 (PcdGet16 (PcdDebugIoPort)) == BOCHS_DEBUG_PORT_MAGIC;\r | |
34 | }\r |