次の方法で共有


HalTranslateBusAddress (Windows Embedded CE 6.0)

1/6/2010

This function translates a physical bus address to a physical system address.

Syntax

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 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 and AddressSpace 0x1 indicates I/O space.
  • TranslatedAddress
    [out] Pointer to the translated address.

Return Value

Returns TRUE if successful. Otherwise, it returns FALSE.

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 might be involved. In addition, some hardware platforms can have more than one bus, or a bus can have more than one address space. Also, some hardware platforms have a separate memory address space and I/O address space. Device drivers call 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. The TransBusAddrToVirtual function takes the necessary steps to convert a bus-relative address or I/O port into a virtual address.

Requirements

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

See Also

Reference

CEDDK Dynamic-Link Library Bus Access Functions
HalGetBusData
HalGetBusDataByOffset
HalSetBusData
HalSetBusDataByOffset
INTERFACE_TYPE
MmMapIoSpace
TransBusAddrToVirtual