mirror of https://github.com/acidanthera/audk.git
ArmVirtPkg/QemuFwCfgLib: remove superfluous InternalQemuFwCfgIsAvailable()
InternalQemuFwCfgIsAvailable() is an API that is incorrectly exposed by the "OvmfPkg/Include/Library/QemuFwCfgLib.h" library class header; the API is meant to be used internally to library instances (if it's needed at all). ArmVirtPkg's instance has no use for it actually, so simplify the code and remove the function definition. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
parent
209b8f3c27
commit
1cb33be961
|
@ -74,25 +74,6 @@ typedef struct {
|
||||||
#define FW_CFG_DMA_CTL_SELECT BIT3
|
#define FW_CFG_DMA_CTL_SELECT BIT3
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Returns a boolean indicating if the firmware configuration interface is
|
|
||||||
available for library-internal purposes.
|
|
||||||
|
|
||||||
This function never changes fw_cfg state.
|
|
||||||
|
|
||||||
@retval TRUE The interface is available internally.
|
|
||||||
@retval FALSE The interface is not available internally.
|
|
||||||
**/
|
|
||||||
BOOLEAN
|
|
||||||
EFIAPI
|
|
||||||
InternalQemuFwCfgIsAvailable (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return (BOOLEAN)(mFwCfgSelectorAddress != 0 && mFwCfgDataAddress != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns a boolean indicating if the firmware configuration interface
|
Returns a boolean indicating if the firmware configuration interface
|
||||||
is available or not.
|
is available or not.
|
||||||
|
@ -109,7 +90,7 @@ QemuFwCfgIsAvailable (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return InternalQemuFwCfgIsAvailable ();
|
return (BOOLEAN)(mFwCfgSelectorAddress != 0 && mFwCfgDataAddress != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,7 +168,7 @@ QemuFwCfgInitialize (
|
||||||
FwCfgDmaAddress = 0;
|
FwCfgDmaAddress = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InternalQemuFwCfgIsAvailable ()) {
|
if (QemuFwCfgIsAvailable ()) {
|
||||||
UINT32 Signature;
|
UINT32 Signature;
|
||||||
|
|
||||||
QemuFwCfgSelectItem (QemuFwCfgItemSignature);
|
QemuFwCfgSelectItem (QemuFwCfgItemSignature);
|
||||||
|
@ -231,7 +212,7 @@ QemuFwCfgSelectItem (
|
||||||
IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem
|
IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (InternalQemuFwCfgIsAvailable ()) {
|
if (QemuFwCfgIsAvailable ()) {
|
||||||
MmioWrite16 (mFwCfgSelectorAddress, SwapBytes16 ((UINT16)QemuFwCfgItem));
|
MmioWrite16 (mFwCfgSelectorAddress, SwapBytes16 ((UINT16)QemuFwCfgItem));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -360,7 +341,7 @@ QemuFwCfgReadBytes (
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (InternalQemuFwCfgIsAvailable ()) {
|
if (QemuFwCfgIsAvailable ()) {
|
||||||
InternalQemuFwCfgReadBytes (Size, Buffer);
|
InternalQemuFwCfgReadBytes (Size, Buffer);
|
||||||
} else {
|
} else {
|
||||||
ZeroMem (Buffer, Size);
|
ZeroMem (Buffer, Size);
|
||||||
|
@ -384,7 +365,7 @@ QemuFwCfgWriteBytes (
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (InternalQemuFwCfgIsAvailable ()) {
|
if (QemuFwCfgIsAvailable ()) {
|
||||||
UINTN Idx;
|
UINTN Idx;
|
||||||
|
|
||||||
for (Idx = 0; Idx < Size; ++Idx) {
|
for (Idx = 0; Idx < Size; ++Idx) {
|
||||||
|
@ -494,7 +475,7 @@ QemuFwCfgFindFile (
|
||||||
UINT32 Count;
|
UINT32 Count;
|
||||||
UINT32 Idx;
|
UINT32 Idx;
|
||||||
|
|
||||||
if (!InternalQemuFwCfgIsAvailable ()) {
|
if (!QemuFwCfgIsAvailable ()) {
|
||||||
return RETURN_UNSUPPORTED;
|
return RETURN_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue