HalTranslateBusAddress

This function translates a bus-relative physical address into the corresponding system physical address.

BOOL HalTranslateBusAddress( 
  INTERFACE_TYPE InterfaceType, 
  ULONG BusNumber, 
  PHYSICAL_ADDRESS BusAddress, 
  PULONG AddressSpace, 
  PPHYSICAL_ADDRESS TranslatedAddress 
);

Parameters

  • InterfaceType
    [in] Bus interface type. The upper bound on the types of buses supported is always MaximumInterfaceType.
  • BusNumber
    [in] Zero-based and system-assigned bus number for the device, used together with InterfaceType to identify the bus for systems with more than one bus of the same type.
  • BusAddress
    [in] Bus-relative address.
  • AddressSpace
    [in, out] On input, an initialized PULONG. On output, a port number or a memory address. AddressSpace 0x0 indicates memory, 0x1 is I/O space.
  • TranslatedAddress
    [out] Pointer to the translated address.

Return Values

TRUE indicates that TranslatedAddress now has the system logical address corresponding to the specified BusNumber and BusAddress.

Remarks

You must use the value returned for TranslatedAddress in a subsequent call to MmMapIoSpace if the AddressSpace value returns 0, which indicates that it is a memory address.

You have many choices for connecting a peripheral bus into a system. The memory address space of the bus, or the logical address space, can directly merge with the physical address space of the host, or some mapping may be involved. In addition, some machines can have more than one bus, or a bus can have more than one address space, as in having separate memory and I/O addresses.

A device driver calls HalTranslateBusAddress to perform this translation. The parameters to this function include a bus number to support platforms with more than one bus of the same InterfaceType, the bus address to translate, and an AddressSpace value typically used to differentiate between memory and I/O space, if these are separate.

The TransBusAddrToVirtual function can be used instead of calling HalTranslateBusAddress and MmMapIoSpace; TransBusAddrToVirtual takes care of the necessary steps to convert a bus-relative address or I/O port into a virtual address.

Requirements

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

See Also

HalGetBusData | HalGetBusDataByOffset | HalSetBusData | HalSetBusDataByOffset | INTERFACE_TYPE | MmMapIoSpace | TransBusAddrToVirtual | Implementing CEDDK.dll

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.