TianoCore EDK2 master
|
#include "UefiShellDebug1CommandsLib.h"
#include <Library/ShellLib.h>
#include <Library/IoLib.h>
#include <Protocol/PciRootBridgeIo.h>
#include <Protocol/DeviceIo.h>
Go to the source code of this file.
Enumerations | |
enum | SHELL_MM_ACCESS_TYPE { ShellMmMemory , ShellMmMemoryMappedIo , ShellMmIo , ShellMmPci , ShellMmPciExpress } |
Functions | |
VOID | ShellMmDecodePciAddress (IN BOOLEAN PciFormat, IN UINT64 Address, OUT UINT32 *Segment, OUT UINT8 *Bus, OUT UINT8 *Device OPTIONAL, OUT UINT8 *Function OPTIONAL, OUT UINT32 *Register OPTIONAL) |
VOID | ShellMmAccess (IN SHELL_MM_ACCESS_TYPE AccessType, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo, IN EFI_CPU_IO2_PROTOCOL *CpuIo, IN BOOLEAN Read, IN UINT64 Address, IN UINTN Size, IN OUT VOID *Buffer) |
BOOLEAN | ShellMmLocateIoProtocol (IN SHELL_MM_ACCESS_TYPE AccessType, IN UINT64 Address, OUT EFI_CPU_IO2_PROTOCOL **CpuIo, OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **PciRootBridgeIo) |
SHELL_STATUS EFIAPI | ShellCommandRunMm (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
CONST UINT16 | mShellMmAccessTypeStr [] |
STATIC CONST SHELL_PARAM_ITEM | ParamList [] |
CONST UINT64 | mShellMmMaxNumber [] |
CONST EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH | mShellMmRootBridgeIoWidth [] |
CONST EFI_CPU_IO_PROTOCOL_WIDTH | mShellMmCpuIoWidth [] |
Main file for Mm shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Mm.c.
SHELL_STATUS EFIAPI ShellCommandRunMm | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
VOID ShellMmAccess | ( | IN SHELL_MM_ACCESS_TYPE | AccessType, |
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | PciRootBridgeIo, | ||
IN EFI_CPU_IO2_PROTOCOL * | CpuIo, | ||
IN BOOLEAN | Read, | ||
IN UINT64 | Address, | ||
IN UINTN | Size, | ||
IN OUT VOID * | Buffer | ||
) |
Read or write some data from or into the Address.
[in] | AccessType | Access type. |
[in] | PciRootBridgeIo | PciRootBridgeIo instance. |
[in] | CpuIo | CpuIo instance. |
[in] | Read | TRUE for read, FALSE for write. |
[in] | Addresss | The memory location to access. |
[in] | Size | The size of Buffer in Width sized units. |
[in,out] | Buffer | The buffer to read into or write from. |
VOID ShellMmDecodePciAddress | ( | IN BOOLEAN | PciFormat, |
IN UINT64 | Address, | ||
OUT UINT32 * | Segment, | ||
OUT UINT8 * | Bus, | ||
OUT UINT8 *Device | OPTIONAL, | ||
OUT UINT8 *Function | OPTIONAL, | ||
OUT UINT32 *Register | OPTIONAL | ||
) |
Extract the PCI segment, bus, device, function, register from from a PCI or PCIE format of address..
[in] | PciFormat | Whether the address is of PCI format of PCIE format. |
[in] | Address | PCI or PCIE address. |
[out] | Segment | PCI segment number. |
[out] | Bus | PCI bus number. |
[out] | Device | PCI device number. |
[out] | Function | PCI function number. |
[out] | Register | PCI register offset. |
BOOLEAN ShellMmLocateIoProtocol | ( | IN SHELL_MM_ACCESS_TYPE | AccessType, |
IN UINT64 | Address, | ||
OUT EFI_CPU_IO2_PROTOCOL ** | CpuIo, | ||
OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL ** | PciRootBridgeIo | ||
) |
Find the CpuIo instance and PciRootBridgeIo instance in the platform. If there are multiple PciRootBridgeIo instances, the instance which manages the Address is returned.
[in] | AccessType | Access type. |
[in] | Address | Address to access. |
[out] | CpuIo | Return the CpuIo instance. |
[out] | PciRootBridgeIo | Return the proper PciRootBridgeIo instance. |
TRUE | There are PciRootBridgeIo instances in the platform. |
FALSE | There isn't PciRootBridgeIo instance in the platform. |
CONST UINT16 mShellMmAccessTypeStr[] |
CONST EFI_CPU_IO_PROTOCOL_WIDTH mShellMmCpuIoWidth[] |
CONST UINT64 mShellMmMaxNumber[] |
CONST EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH mShellMmRootBridgeIoWidth[] |
STATIC CONST SHELL_PARAM_ITEM ParamList[] |