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