2010-07-13 05:08:54 +02:00
|
|
|
/** @file
|
|
|
|
Internal include file for the SMM CPU I/O Protocol.
|
|
|
|
|
2018-06-27 15:14:20 +02:00
|
|
|
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 01:07:22 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2010-07-13 05:08:54 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _CPU_IO2_SMM_H_
|
|
|
|
#define _CPU_IO2_SMM_H_
|
|
|
|
|
|
|
|
#include <PiSmm.h>
|
|
|
|
|
|
|
|
#include <Protocol/SmmCpuIo2.h>
|
|
|
|
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/IoLib.h>
|
|
|
|
#include <Library/SmmServicesTableLib.h>
|
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
|
|
|
|
#define MAX_IO_PORT_ADDRESS 0xFFFF
|
|
|
|
|
|
|
|
/**
|
|
|
|
Reads memory-mapped registers.
|
|
|
|
|
2018-06-27 15:14:20 +02:00
|
|
|
The I/O operations are carried out exactly as requested. The caller is
|
|
|
|
responsible for any alignment and I/O width issues that the bus, device,
|
2010-07-13 05:08:54 +02:00
|
|
|
platform, or type of I/O might require.
|
|
|
|
|
|
|
|
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
|
|
|
|
@param[in] Width Signifies the width of the I/O operations.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[in] Address The base address of the I/O operations. The caller is
|
|
|
|
responsible for aligning the Address if required.
|
2010-07-13 05:08:54 +02:00
|
|
|
@param[in] Count The number of I/O operations to perform.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[out] Buffer For read operations, the destination buffer to store
|
|
|
|
the results. For write operations, the source buffer
|
2010-07-13 05:08:54 +02:00
|
|
|
from which to write data.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The data was read from or written to the device.
|
|
|
|
@retval EFI_UNSUPPORTED The Address is not valid for this system.
|
|
|
|
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
|
2018-06-27 15:14:20 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
|
2010-07-13 05:08:54 +02:00
|
|
|
lack of resources
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
CpuMemoryServiceRead (
|
|
|
|
IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,
|
|
|
|
IN EFI_SMM_IO_WIDTH Width,
|
|
|
|
IN UINT64 Address,
|
|
|
|
IN UINTN Count,
|
|
|
|
OUT VOID *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Writes memory-mapped registers.
|
|
|
|
|
2018-06-27 15:14:20 +02:00
|
|
|
The I/O operations are carried out exactly as requested. The caller is
|
|
|
|
responsible for any alignment and I/O width issues that the bus, device,
|
2010-07-13 05:08:54 +02:00
|
|
|
platform, or type of I/O might require.
|
|
|
|
|
|
|
|
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
|
|
|
|
@param[in] Width Signifies the width of the I/O operations.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[in] Address The base address of the I/O operations. The caller is
|
|
|
|
responsible for aligning the Address if required.
|
2010-07-13 05:08:54 +02:00
|
|
|
@param[in] Count The number of I/O operations to perform.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[in] Buffer For read operations, the destination buffer to store
|
|
|
|
the results. For write operations, the source buffer
|
2010-07-13 05:08:54 +02:00
|
|
|
from which to write data.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The data was read from or written to the device.
|
|
|
|
@retval EFI_UNSUPPORTED The Address is not valid for this system.
|
|
|
|
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
|
2018-06-27 15:14:20 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
|
2010-07-13 05:08:54 +02:00
|
|
|
lack of resources
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
CpuMemoryServiceWrite (
|
|
|
|
IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,
|
|
|
|
IN EFI_SMM_IO_WIDTH Width,
|
|
|
|
IN UINT64 Address,
|
|
|
|
IN UINTN Count,
|
|
|
|
IN VOID *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Reads I/O registers.
|
|
|
|
|
2018-06-27 15:14:20 +02:00
|
|
|
The I/O operations are carried out exactly as requested. The caller is
|
|
|
|
responsible for any alignment and I/O width issues that the bus, device,
|
2010-07-13 05:08:54 +02:00
|
|
|
platform, or type of I/O might require.
|
|
|
|
|
|
|
|
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
|
|
|
|
@param[in] Width Signifies the width of the I/O operations.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[in] Address The base address of the I/O operations. The caller is
|
|
|
|
responsible for aligning the Address if required.
|
2010-07-13 05:08:54 +02:00
|
|
|
@param[in] Count The number of I/O operations to perform.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[out] Buffer For read operations, the destination buffer to store
|
|
|
|
the results. For write operations, the source buffer
|
2010-07-13 05:08:54 +02:00
|
|
|
from which to write data.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The data was read from or written to the device.
|
|
|
|
@retval EFI_UNSUPPORTED The Address is not valid for this system.
|
|
|
|
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
|
2018-06-27 15:14:20 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
|
2010-07-13 05:08:54 +02:00
|
|
|
lack of resources
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
CpuIoServiceRead (
|
|
|
|
IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,
|
|
|
|
IN EFI_SMM_IO_WIDTH Width,
|
|
|
|
IN UINT64 Address,
|
|
|
|
IN UINTN Count,
|
|
|
|
OUT VOID *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Write I/O registers.
|
|
|
|
|
2018-06-27 15:14:20 +02:00
|
|
|
The I/O operations are carried out exactly as requested. The caller is
|
|
|
|
responsible for any alignment and I/O width issues that the bus, device,
|
2010-07-13 05:08:54 +02:00
|
|
|
platform, or type of I/O might require.
|
|
|
|
|
|
|
|
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
|
|
|
|
@param[in] Width Signifies the width of the I/O operations.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[in] Address The base address of the I/O operations. The caller is
|
|
|
|
responsible for aligning the Address if required.
|
2010-07-13 05:08:54 +02:00
|
|
|
@param[in] Count The number of I/O operations to perform.
|
2018-06-27 15:14:20 +02:00
|
|
|
@param[in] Buffer For read operations, the destination buffer to store
|
|
|
|
the results. For write operations, the source buffer
|
2010-07-13 05:08:54 +02:00
|
|
|
from which to write data.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The data was read from or written to the device.
|
|
|
|
@retval EFI_UNSUPPORTED The Address is not valid for this system.
|
|
|
|
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
|
2018-06-27 15:14:20 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
|
2010-07-13 05:08:54 +02:00
|
|
|
lack of resources
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
CpuIoServiceWrite (
|
|
|
|
IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,
|
|
|
|
IN EFI_SMM_IO_WIDTH Width,
|
|
|
|
IN UINT64 Address,
|
|
|
|
IN UINTN Count,
|
|
|
|
IN VOID *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|