4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/** @file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O and MMIO Library Services that do I/O and also enable the I/O operatation
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed during an S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are licensed and made available under the terms and conditions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of the BSD License which accompanies this distribution. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync http://opensource.org/licenses/bsd-license.php
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Base.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/S3IoLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/DebugLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/IoLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/S3BootScriptLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves an I/O port value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves an I/O port value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Width The width of I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer The buffer containing value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncVOID
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveIoWriteValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN VOID *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveIoWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Width,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 1,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves an 8-bit I/O port value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves an 8-bit I/O port value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveIoWrite8ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveIoWriteValueToBootScript (S3BootScriptWidthUint8, Port, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all I/O read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoRead8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoRead8 (Port));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes an 8-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 8-bit I/O port specified by Port with the value specified by Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and returns Value. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoWrite8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoWrite8 (Port, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit I/O port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 8-bit I/O port and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 8-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoOr8 (Port, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to the 8-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 8-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAnd8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoAnd8 (Port, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 8-bit I/O port and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the result of the AND operation and the value specified by OrData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and writes the result to the 8-bit I/O port specified by Port. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the I/O port is returned. This function must guarantee that all
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAndThenOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoAndThenOr8 (Port, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of an I/O register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in an 8-bit I/O register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldRead8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoBitFieldRead8 (Port, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to an I/O register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the I/O register. The bit field is specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by the StartBit and the EndBit. All other bits in the destination I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync register are preserved. The value written to the I/O port is returned. Extra
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync left bits in Value are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldWrite8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoBitFieldWrite8 (Port, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 8-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 8-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized. Extra left bits in OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoBitFieldOr8 (Port, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 8-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 8-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized. Extra left bits in AndData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAnd8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoBitFieldAnd8 (Port, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 8-bit port and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR between the read result and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData, and writes the result to the 8-bit I/O port specified by Port. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync value written to the I/O port is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all I/O read and write operations are serialized. Extra left bits in both
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAndThenOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite8ValueToBootScript (Port, IoBitFieldAndThenOr8 (Port, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves a 16-bit I/O port value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves a 16-bit I/O port value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveIoWrite16ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveIoWriteValueToBootScript (S3BootScriptWidthUint16, Port, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all I/O read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoRead16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoRead16 (Port));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a 16-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 16-bit I/O port specified by Port with the value specified by Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and returns Value. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoWrite16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoWrite16 (Port, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit I/O port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 16-bit I/O port and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 16-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoOr16 (Port, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to the 16-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 16-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAnd16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoAnd16 (Port, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 16-bit I/O port and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the result of the AND operation and the value specified by OrData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and writes the result to the 16-bit I/O port specified by Port. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the I/O port is returned. This function must guarantee that all
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAndThenOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoAndThenOr16 (Port, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of an I/O register saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in a 16-bit I/O register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldRead16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoBitFieldRead16 (Port, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to an I/O register and saves the value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the I/O register. The bit field is specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by the StartBit and the EndBit. All other bits in the destination I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync register are preserved. The value written to the I/O port is returned. Extra
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync left bits in Value are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldWrite16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoBitFieldWrite16 (Port, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 16-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 16-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized. Extra left bits in OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoBitFieldOr16 (Port, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 16-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 16-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized. Extra left bits in AndData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAnd16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoBitFieldAnd16 (Port, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 16-bit port and saves the value in the S3 script to be replayed on S3
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR between the read result and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData, and writes the result to the 16-bit I/O port specified by Port. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync value written to the I/O port is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all I/O read and write operations are serialized. Extra left bits in both
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAndThenOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite16ValueToBootScript (Port, IoBitFieldAndThenOr16 (Port, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves a 32-bit I/O port value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves a 32-bit I/O port value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveIoWrite32ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveIoWriteValueToBootScript (S3BootScriptWidthUint32, Port, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all I/O read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoRead32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoRead32 (Port));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a 32-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 32-bit I/O port specified by Port with the value specified by Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and returns Value. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoWrite32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoWrite32 (Port, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit I/O port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 32-bit I/O port and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 32-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoOr32 (Port, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to the 32-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 32-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAnd32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoAnd32 (Port, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 32-bit I/O port and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the result of the AND operation and the value specified by OrData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and writes the result to the 32-bit I/O port specified by Port. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the I/O port is returned. This function must guarantee that all
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAndThenOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoAndThenOr32 (Port, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of an I/O register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in a 32-bit I/O register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldRead32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoBitFieldRead32 (Port, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to an I/O register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the I/O register. The bit field is specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by the StartBit and the EndBit. All other bits in the destination I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync register are preserved. The value written to the I/O port is returned. Extra
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync left bits in Value are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldWrite32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoBitFieldWrite32 (Port, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 32-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 32-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized. Extra left bits in OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoBitFieldOr32 (Port, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 32-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 32-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized. Extra left bits in AndData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAnd32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoBitFieldAnd32 (Port, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 32-bit port and saves the value in the S3 script to be replayed on S3
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR between the read result and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData, and writes the result to the 32-bit I/O port specified by Port. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync value written to the I/O port is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all I/O read and write operations are serialized. Extra left bits in both
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAndThenOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite32ValueToBootScript (Port, IoBitFieldAndThenOr32 (Port, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves a 64-bit I/O port value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves a 64-bit I/O port value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveIoWrite64ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveIoWriteValueToBootScript (S3BootScriptWidthUint64, Port, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all I/O read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoRead64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoRead64 (Port));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a 64-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 64-bit I/O port specified by Port with the value specified by Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and returns Value. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoWrite64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoWrite64 (Port, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit I/O port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 64-bit I/O port and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 64-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoOr64 (Port, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to the 64-bit I/O port and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 64-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAnd64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoAnd64 (Port, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 64-bit I/O port and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the result of the AND operation and the value specified by OrData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and writes the result to the 64-bit I/O port specified by Port. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the I/O port is returned. This function must guarantee that all
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoAndThenOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoAndThenOr64 (Port, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of an I/O register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in a 64-bit I/O register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldRead64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoBitFieldRead64 (Port, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to an I/O register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the I/O register. The bit field is specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by the StartBit and the EndBit. All other bits in the destination I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync register are preserved. The value written to the I/O port is returned. Extra
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync left bits in Value are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldWrite64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoBitFieldWrite64 (Port, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 64-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit I/O port specified by Port, performs a bitwise OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by OrData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 64-bit I/O port specified by Port. The value written to the I/O
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port is returned. This function must guarantee that all I/O read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized. Extra left bits in OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoBitFieldOr64 (Port, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the bit field in the 64-bit port and saves the value in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the read result and the value specified by AndData, and writes the result to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the 64-bit I/O port specified by Port. The value written to the I/O port is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all I/O read and write operations
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are serialized. Extra left bits in AndData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAnd64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoBitFieldAnd64 (Port, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 64-bit port and saves the value in the S3 script to be replayed on S3
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR between the read result and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData, and writes the result to the 64-bit I/O port specified by Port. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync value written to the I/O port is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all I/O read and write operations are serialized. Extra left bits in both
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit I/O port operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Port The I/O port to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the I/O port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3IoBitFieldAndThenOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Port,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveIoWrite64ValueToBootScript (Port, IoBitFieldAndThenOr64 (Port, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves an MMIO register value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves an MMIO register value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Width The width of MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer The buffer containing value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncVOID
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveMmioWriteValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN VOID *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Width,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 1,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves an 8-bit MMIO register value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves an 8-bit MMIO register value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveMmioWrite8ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveMmioWriteValueToBootScript (S3BootScriptWidthUint8, Address, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all MMIO read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioRead8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioRead8 (Address));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes an 8-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 8-bit MMIO register specified by Address with the value specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by Value and returns Value. This function must guarantee that all MMIO read
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWrite8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioWrite8 (Address, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 8-bit MMIO register and saves the value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 8-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioOr8 (Address, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync back to the 8-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 8-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAnd8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioAnd8 (Address, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 8-bit MMIO register and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, performs a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR between the result of the AND operation and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OrData, and writes the result to the 8-bit MMIO register specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Address. The value written to the MMIO register is returned. This function
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync must guarantee that all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAndThenOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioAndThenOr8 (Address, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of a MMIO register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in an 8-bit MMIO register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldRead8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioBitFieldRead8 (Address, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to an MMIO register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the MMIO register. The bit field is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by the StartBit and the EndBit. All other bits in the destination
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MMIO register are preserved. The new value of the 8-bit register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldWrite8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioBitFieldWrite8 (Address, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 8-bit MMIO register and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 8-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized. Extra left bits in OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioBitFieldOr8 (Address, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 8-bit MMIO register and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 8-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized. Extra left bits in AndData are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAnd8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioBitFieldAnd8 (Address, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 8-bit MMIO register and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync followed by a bitwise OR between the read result and the value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by AndData, and writes the result to the 8-bit MMIO register
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by Address. The value written to the MMIO register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all MMIO read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized. Extra left bits in both AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 8-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 7, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..7.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAndThenOr8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT8 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite8ValueToBootScript (Address, MmioBitFieldAndThenOr8 (Address, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves a 16-bit MMIO register value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves a 16-bit MMIO register value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveMmioWrite16ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveMmioWriteValueToBootScript (S3BootScriptWidthUint16, Address, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit MMIO register and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all MMIO read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioRead16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioRead16 (Address));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a 16-bit MMIO register and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 16-bit MMIO register specified by Address with the value specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by Value and returns Value. This function must guarantee that all MMIO read
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and write operations are serialized and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWrite16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioWrite16 (Address, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 16-bit MMIO register and saves the value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 16-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioOr16 (Address, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync back to the 16-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 16-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAnd16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioAnd16 (Address, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 16-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, performs a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR between the result of the AND operation and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OrData, and writes the result to the 16-bit MMIO register specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Address. The value written to the MMIO register is returned. This function
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync must guarantee that all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAndThenOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioAndThenOr16 (Address, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of a MMIO register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in a 16-bit MMIO register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldRead16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioBitFieldRead16 (Address, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to a MMIO register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the MMIO register. The bit field is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by the StartBit and the EndBit. All other bits in the destination
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MMIO register are preserved. The new value of the 16-bit register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldWrite16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioBitFieldWrite16 (Address, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 16-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 16-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized. Extra left bits in OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioBitFieldOr16 (Address, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 16-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 16-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized. Extra left bits in AndData are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAnd16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioBitFieldAnd16 (Address, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 16-bit MMIO register and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync followed by a bitwise OR between the read result and the value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by AndData, and writes the result to the 16-bit MMIO register
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by Address. The value written to the MMIO register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all MMIO read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized. Extra left bits in both AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 16-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 15, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..15.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAndThenOr16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT16 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite16ValueToBootScript (Address, MmioBitFieldAndThenOr16 (Address, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves a 32-bit MMIO register value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves a 32-bit MMIO register value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveMmioWrite32ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveMmioWriteValueToBootScript (S3BootScriptWidthUint32, Address, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit MMIO register saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all MMIO read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioRead32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioRead32 (Address));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a 32-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 32-bit MMIO register specified by Address with the value specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by Value and returns Value. This function must guarantee that all MMIO read
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWrite32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioWrite32 (Address, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 32-bit MMIO register and saves the value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 32-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioOr32 (Address, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync back to the 32-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 32-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAnd32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioAnd32 (Address, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 32-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, performs a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR between the result of the AND operation and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OrData, and writes the result to the 32-bit MMIO register specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Address. The value written to the MMIO register is returned. This function
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync must guarantee that all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAndThenOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioAndThenOr32 (Address, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of a MMIO register and saves the value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in a 32-bit MMIO register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldRead32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioBitFieldRead32 (Address, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to a MMIO register and saves the value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the MMIO register. The bit field is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by the StartBit and the EndBit. All other bits in the destination
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MMIO register are preserved. The new value of the 32-bit register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldWrite32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioBitFieldWrite32 (Address, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 32-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 32-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized. Extra left bits in OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioBitFieldOr32 (Address, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 32-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 32-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized. Extra left bits in AndData are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAnd32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioBitFieldAnd32 (Address, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 32-bit MMIO register and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync followed by a bitwise OR between the read result and the value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by AndData, and writes the result to the 32-bit MMIO register
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by Address. The value written to the MMIO register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all MMIO read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized. Extra left bits in both AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 32-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 31, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..31.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAndThenOr32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite32ValueToBootScript (Address, MmioBitFieldAndThenOr32 (Address, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Saves a 64-bit MMIO register value to the boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This internal worker function saves a 64-bit MMIO register value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the saving process fails, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value saved to boot script.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncInternalSaveMmioWrite64ValueToBootScript (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync InternalSaveMmioWriteValueToBootScript (S3BootScriptWidthUint64, Address, &Value);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Value;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned. This function must guarantee that all MMIO read and write
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioRead64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioRead64 (Address));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a 64-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes the 64-bit MMIO register specified by Address with the value specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by Value and returns Value. This function must guarantee that all MMIO read
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value The value to write to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWrite64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioWrite64 (Address, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result back to the 64-bit MMIO register and saves the value in the S3 script
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 64-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioOr64 (Address, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync back to the 64-bit MMIO register and saves the value in the S3 script to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 64-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAnd64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioAnd64 (Address, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR, and writes the result back to the 64-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, performs a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bitwise OR between the result of the AND operation and the value specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OrData, and writes the result to the 64-bit MMIO register specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Address. The value written to the MMIO register is returned. This function
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync must guarantee that all MMIO read and write operations are serialized.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioAndThenOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioAndThenOr64 (Address, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field of a MMIO register saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the bit field in a 64-bit MMIO register. The bit field is specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the StartBit and the EndBit. The value of the bit field is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address MMIO register to read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldRead64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioBitFieldRead64 (Address, StartBit, EndBit));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a bit field to a MMIO register and saves the value in the S3 script to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes Value to the bit field of the MMIO register. The bit field is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by the StartBit and the EndBit. All other bits in the destination
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MMIO register are preserved. The new value of the 64-bit register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Value New value of the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldWrite64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 Value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioBitFieldWrite64 (Address, StartBit, EndBit, Value));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 64-bit MMIO register and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit MMIO register specified by Address, performs a bitwise
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync inclusive OR between the read result and the value specified by OrData, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result to the 64-bit MMIO register specified by Address. The value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync written to the MMIO register is returned. This function must guarantee that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync all MMIO read and write operations are serialized. Extra left bits in OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioBitFieldOr64 (Address, StartBit, EndBit, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync writes the result back to the bit field in the 64-bit MMIO register and saves
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync between the read result and the value specified by AndData, and writes the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync result to the 64-bit MMIO register specified by Address. The value written to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the MMIO register is returned. This function must guarantee that all MMIO
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync read and write operations are serialized. Extra left bits in AndData are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAnd64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioBitFieldAnd64 (Address, StartBit, EndBit, AndData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by a bitwise OR, and writes the result back to the bit field in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 64-bit MMIO register and saves the value in the S3 script to be replayed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync followed by a bitwise OR between the read result and the value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by AndData, and writes the result to the 64-bit MMIO register
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by Address. The value written to the MMIO register is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must guarantee that all MMIO read and write operations are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync serialized. Extra left bits in both AndData and OrData are stripped.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If 64-bit MMIO register operations are not supported, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is greater than 63, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If EndBit is less than StartBit, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The MMIO register to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartBit The ordinal of the least significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EndBit The ordinal of the most significant bit in the bit field.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Range 0..63.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AndData The value to AND with the read value from the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OrData The value to OR with the result of the AND operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The value written back to the MMIO register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioBitFieldAndThenOr64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN EndBit,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 AndData,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT64 OrData
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalSaveMmioWrite64ValueToBootScript (Address, MmioBitFieldAndThenOr64 (Address, StartBit, EndBit, AndData, OrData));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region to system memory by using 8-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region specified by starting address StartAddress
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to system memory specified by Buffer by using 8-bit access. The total
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer receiving the data read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioReadBuffer8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT8 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioReadBuffer8 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint8,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT8),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region to system memory by using 16-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region specified by starting address StartAddress
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to system memory specified by Buffer by using 16-bit access. The total
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is not aligned on a 16-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is not aligned on a 16-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer receiving the data read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioReadBuffer16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT16 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT16 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioReadBuffer16 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint16,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT16),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region to system memory by using 32-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region specified by starting address StartAddress
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to system memory specified by Buffer by using 32-bit access. The total
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is not aligned on a 32-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is not aligned on a 32-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer receiving the data read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioReadBuffer32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT32 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT32 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioReadBuffer32 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint32,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT32),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region to system memory by using 64-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from MMIO region specified by starting address StartAddress
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to system memory specified by Buffer by using 64-bit access. The total
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is not aligned on a 64-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is not aligned on a 64-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer receiving the data read.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioReadBuffer64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT64 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT64 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioReadBuffer64 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint64,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT64),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory to MMIO region by using 8-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory specified by Buffer to MMIO region specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by starting address StartAddress by using 8-bit access. The total number
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied to.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer containing the data to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWriteBuffer8 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST UINT8 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioWriteBuffer8 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint8,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT8),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory to MMIO region by using 16-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory specified by Buffer to MMIO region specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by starting address StartAddress by using 16-bit access. The total number
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is not aligned on a 16-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is not aligned on a 16-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied to.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer containing the data to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT16 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWriteBuffer16 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST UINT16 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT16 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioWriteBuffer16 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint16,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT16),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory to MMIO region by using 32-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory specified by Buffer to MMIO region specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by starting address StartAddress by using 32-bit access. The total number
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is not aligned on a 32-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is not aligned on a 32-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied to.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer containing the data to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT32 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWriteBuffer32 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST UINT32 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT32 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioWriteBuffer32 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint32,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT32),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory to MMIO region by using 64-bit access
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and saves the value in the S3 script to be replayed on S3 resume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copy data from system memory specified by Buffer to MMIO region specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by starting address StartAddress by using 64-bit access. The total number
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of byte to be copied is specified by Length. Buffer is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is not aligned on a 64-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is not aligned on a 64-bit boundary, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param StartAddress Starting address for the MMIO region to be copied to.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length Size in bytes of the copy.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to a system memory buffer containing the data to write.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT64 *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncS3MmioWriteBuffer64 (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST UINT64 *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT64 *ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RETURN_STATUS Status;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer = MmioWriteBuffer64 (StartAddress, Length, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = S3BootScriptSaveMemWrite (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync S3BootScriptWidthUint64,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync StartAddress,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length / sizeof (UINT64),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ReturnBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Status == RETURN_SUCCESS);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return ReturnBuffer;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync