次の方法で共有


TransBusAddrToVirtual (Windows Embedded CE 6.0)

1/6/2010

This function is deprecated. Use BusTransBusAddrToVirtual instead. This function translates a bus address to a virtual system address.

Syntax

BOOL TransBusAddrToVirtual(
  INTERFACE_TYPE InterfaceType,
  ULONG BusNumber,
  PHYSICAL_ADDRESS BusAddress,
  ULONG Length,
  PULONG AddressSpace,
  PPVOID MappedAddress
);

Parameters

  • InterfaceType
    [in] Element of INTERFACE_TYPE. Any bus type in the INTERFACE_TYPE enumeration is supported. You must implement that support in your CEDDK.dll file. Microsoft provides support for the PCI bus on some of the sample BSPs.
  • BusNumber
    [in] Bus number where the device resides.
  • BusAddress
    [in] Bus-relative address of registers and ports on the device.
  • Length
    [in] Number of bytes to map on the device.
  • AddressSpace
    [in, out] Flag to indicate whether what this function maps to is in I/O space or memory space. On input, this is an initialized variable. On output, this is the flag. AddressSpace 0x0 indicates memory, and AddressSpace 0x1 indicates I/O space.
  • MappedAddress
    [out] Virtual address where this function mapped the physical address.

Return Value

Returns TRUE if successful. Returns FALSE if not successful.

Remarks

The difference between TransBusAddrToVirtual and TransBusAddrToStatic is that TransBusAddrToVirtual does not create a static mapping.

This function combines the functionality of HalTranslateBusAddress and MmMapIoSpace to simplify the work needed to translate a bus-relative address to a system virtual address needed by a driver to access a device.

If the MappedAddress pointer is in memory space and AddressSpace is 0 after the call to TransBusAddrToVirtual returns, you can unmap the MappedAddress pointer with a call to the MmUnmapIoSpace function.

Requirements

Header ceddk.h
Library CEDDK.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

CEDDK Dynamic-Link Library Address Mapping Functions
BusTransBusAddrToVirtual
HalTranslateBusAddress
INTERFACE_TYPE
MmUnmapIoSpace
TransBusAddrToStatic