Share via


TransBusAddrToVirtual

This function translates a bus-relative address to a system virtual address.

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 indicates whether what this function maps lives in I/O space or memory space. On input, this is an initialized variable. On output, this is the flag.
  • MappedAddress
    [out] Virtual address where this function mapped the physical address.

Return Values

Returns TRUE if successful. Returns FALSE if failure.

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

OS Versions: Windows CE .NET 4.0 and later.
Header: CEDDK.h.
Link Library: CEDDK.lib.

See Also

INTERFACE_TYPE | MmUnmapIoSpace | TransBusAddrToStatic | Implementing CEDDK.dll

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.