CreateStaticMapping (Compact 2013)

3/28/2014

This function creates a static virtual memory address that maps to a physical address. This function is callable from the user code, but not the OEM adaptation layer (OAL). This function is callable from kernel-mode drivers and user-mode drivers.

Syntax

LPVOID CreateStaticMapping(
  DWORD dwPhysBase,
  DWORD dwSize
);

Parameters

  • dwPhysBase
    [in] Starting physical address to map. The address passed in must be right-shifted by 8.
  • dwSize
    [in] Number of bytes to map, starting from dwPhysBase.

Return Value

If the memory can be mapped, a valid static virtual memory pointer is returned. The virtual memory address returned is for an uncached memory region.

Remarks

CreateStaticMapping enables an application to map any physical address to a static virtual memory address that can then be used in an interrupt service routine (ISR). An ISR can access only a static mapped virtual address. In previous releases, a static mapping could be created only at boot time, and not dynamically.

Once the static mapping is created, it is active until the device reboots or DeleteStaticMapping is called.

The same functionality can be obtained from the OAL by calling the OAL version of the function, NKCreateStaticMapping.

Requirements

Header

pkfuncs.h

Library

Nkstub.lib

See Also

Reference

Kernel Functions

Other Resources

User Mode Driver Framework
NKCreateStaticMapping
OEMAddressTable