forked from tianocore/edk2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/tianocore/master' into Oth…
…erOS
- Loading branch information
Showing
19 changed files
with
299 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** @file | ||
Detection code for QEMU debug port. | ||
Non-SEC instance, caches the result of detection. | ||
Copyright (c) 2017, Red Hat, Inc.<BR> | ||
This program and the accompanying materials | ||
are licensed and made available under the terms and conditions of the BSD License | ||
which accompanies this distribution. The full text of the license may be found at | ||
http://opensource.org/licenses/bsd-license.php. | ||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||
**/ | ||
|
||
#include <Base.h> | ||
#include "DebugLibDetect.h" | ||
|
||
// | ||
// Set to TRUE if the debug I/O port is enabled | ||
// | ||
STATIC BOOLEAN mDebugIoPortFound = FALSE; | ||
|
||
/** | ||
This constructor function checks if the debug I/O port device is present, | ||
caching the result for later use. | ||
@retval RETURN_SUCCESS The constructor always returns RETURN_SUCCESS. | ||
**/ | ||
RETURN_STATUS | ||
EFIAPI | ||
PlatformDebugLibIoPortConstructor ( | ||
VOID | ||
) | ||
{ | ||
mDebugIoPortFound = PlatformDebugLibIoPortDetect(); | ||
return RETURN_SUCCESS; | ||
} | ||
|
||
/** | ||
Return the cached 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 | ||
PlatformDebugLibIoPortFound ( | ||
VOID | ||
) | ||
{ | ||
return mDebugIoPortFound; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** @file | ||
Base Debug library instance for QEMU debug port. | ||
It uses PrintLib to send debug messages to a fixed I/O port. | ||
Copyright (c) 2017, Red Hat, Inc.<BR> | ||
This program and the accompanying materials | ||
are licensed and made available under the terms and conditions of the BSD License | ||
which accompanies this distribution. The full text of the license may be found at | ||
http://opensource.org/licenses/bsd-license.php. | ||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||
**/ | ||
|
||
#ifndef __DEBUG_IO_PORT_DETECT_H__ | ||
#define __DEBUG_IO_PORT_DETECT_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. | ||
PlatformDebugLibIoPortFound can call this function directly or cache the | ||
result. | ||
@retval TRUE if the debug I/O port device was detected. | ||
@retval FALSE otherwise | ||
**/ | ||
BOOLEAN | ||
EFIAPI | ||
PlatformDebugLibIoPortDetect ( | ||
VOID | ||
); | ||
|
||
/** | ||
Return whether the virtual machine has a debug I/O port. DebugLib.c | ||
calls this function instead of PlatformDebugLibIoPortDetect, to allow | ||
caching if possible. | ||
@retval TRUE if the debug I/O port device was detected. | ||
@retval FALSE otherwise | ||
**/ | ||
BOOLEAN | ||
EFIAPI | ||
PlatformDebugLibIoPortFound ( | ||
VOID | ||
); | ||
|
||
#endif |
48 changes: 48 additions & 0 deletions
48
OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetectRom.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** @file | ||
Detection code for QEMU debug port. | ||
SEC instance, cannot cache the result of detection. | ||
Copyright (c) 2017, Red Hat, Inc.<BR> | ||
This program and the accompanying materials | ||
are licensed and made available under the terms and conditions of the BSD License | ||
which accompanies this distribution. The full text of the license may be found at | ||
http://opensource.org/licenses/bsd-license.php. | ||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||
**/ | ||
|
||
#include <Base.h> | ||
#include "DebugLibDetect.h" | ||
|
||
/** | ||
This constructor function does not have anything to do. | ||
@retval RETURN_SUCCESS The constructor always returns RETURN_SUCCESS. | ||
**/ | ||
RETURN_STATUS | ||
EFIAPI | ||
PlatformRomDebugLibIoPortConstructor ( | ||
VOID | ||
) | ||
{ | ||
return RETURN_SUCCESS; | ||
} | ||
|
||
/** | ||
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 | ||
PlatformDebugLibIoPortFound ( | ||
VOID | ||
) | ||
{ | ||
return PlatformDebugLibIoPortDetect (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
## @file | ||
# Instance of Debug Library for the QEMU debug console port. | ||
# It uses Print Library to produce formatted output strings. | ||
# | ||
# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> | ||
# Copyright (c) 2017, Red Hat, Inc.<BR> | ||
# | ||
# This program and the accompanying materials | ||
# are licensed and made available under the terms and conditions of the BSD License | ||
# which accompanies this distribution. The full text of the license may be found at | ||
# http://opensource.org/licenses/bsd-license.php. | ||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||
# | ||
# | ||
## | ||
|
||
[Defines] | ||
INF_VERSION = 0x00010005 | ||
BASE_NAME = PlatformRomDebugLibIoPort | ||
FILE_GUID = CEB0D9D3-328F-4C24-8C02-28FA1986AE1B | ||
MODULE_TYPE = BASE | ||
VERSION_STRING = 1.0 | ||
LIBRARY_CLASS = DebugLib|SEC | ||
CONSTRUCTOR = PlatformRomDebugLibIoPortConstructor | ||
|
||
# | ||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC | ||
# | ||
|
||
[Sources] | ||
DebugLib.c | ||
DebugLibDetectRom.c | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
OvmfPkg/OvmfPkg.dec | ||
|
||
[LibraryClasses] | ||
BaseMemoryLib | ||
IoLib | ||
PcdLib | ||
PrintLib | ||
BaseLib | ||
DebugPrintErrorLevelLib | ||
|
||
[Pcd] | ||
gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES | ||
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## CONSUMES | ||
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES | ||
gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.