mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
OvmfPkg/PlatformDebugLibIoPort: factor out debug port detection
Factor out debug port detection in PlatformDebugLibIoPort. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Message-Id: <20200423095358.2518197-4-anthony.perard@citrix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
61ac4fc70d
commit
52f012129a
34
OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c
Normal file
34
OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/** @file
|
||||||
|
Detection code for QEMU debug port.
|
||||||
|
|
||||||
|
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2012, Red Hat, Inc.<BR>
|
||||||
|
Copyright (c) 2020, Citrix Systems, Inc.
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include <Library/IoLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
#include "DebugLibDetect.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// The constant value that is read from the debug I/O port
|
||||||
|
//
|
||||||
|
#define BOCHS_DEBUG_PORT_MAGIC 0xE9
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return the result of detecting the debug I/O port device.
|
||||||
|
|
||||||
|
@retval TRUE if the debug I/O port device was detected.
|
||||||
|
@retval FALSE otherwise
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
PlatformDebugLibIoPortDetect (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return IoRead8 (PcdGet16 (PcdDebugIoPort)) == BOCHS_DEBUG_PORT_MAGIC;
|
||||||
|
}
|
@ -359,19 +359,3 @@ DebugPrintLevelEnabled (
|
|||||||
{
|
{
|
||||||
return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
|
return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Return the result of detecting the debug I/O port device.
|
|
||||||
|
|
||||||
@retval TRUE if the debug I/O port device was detected.
|
|
||||||
@retval FALSE otherwise
|
|
||||||
|
|
||||||
**/
|
|
||||||
BOOLEAN
|
|
||||||
EFIAPI
|
|
||||||
PlatformDebugLibIoPortDetect (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return IoRead8 (PcdGet16 (PcdDebugIoPort)) == BOCHS_DEBUG_PORT_MAGIC;
|
|
||||||
}
|
|
||||||
|
@ -12,12 +12,6 @@
|
|||||||
|
|
||||||
#include <Base.h>
|
#include <Base.h>
|
||||||
|
|
||||||
//
|
|
||||||
// The constant value that is read from the debug I/O port
|
|
||||||
//
|
|
||||||
#define BOCHS_DEBUG_PORT_MAGIC 0xE9
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Helper function to return whether the virtual machine has a debug I/O port.
|
Helper function to return whether the virtual machine has a debug I/O port.
|
||||||
PlatformDebugLibIoPortFound can call this function directly or cache the
|
PlatformDebugLibIoPortFound can call this function directly or cache the
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
|
DebugIoPortQemu.c
|
||||||
DebugLib.c
|
DebugLib.c
|
||||||
DebugLibDetect.c
|
DebugLibDetect.c
|
||||||
DebugLibDetect.h
|
DebugLibDetect.h
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
|
DebugIoPortQemu.c
|
||||||
DebugLib.c
|
DebugLib.c
|
||||||
DebugLibDetect.h
|
DebugLibDetect.h
|
||||||
DebugLibDetectRom.c
|
DebugLibDetectRom.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user