Author: arm-WinCE
The address ing function is provided in ceddk/ddk_map/ddk_map.c. This module mainly provides two functions for ing physical addresses to virtual addresses and un ing:
1. pvoid mmmapiospace (physical_address physicaladdress, ulong numberofbytes, Boolean cacheenable)
Physicaladdress: The physical start address to be mapped.
Numberofbytes: number of bytes to be mapped
Cacheenable: Indicates whether to enable cache. If it is a register mapped to a device, it should be false.
This function is often used in drivers. during initialization, virtual addresses are mapped from physical addresses and operated on devices through virtual addresses. This function actually calls the virtualalloc and virtualcopy functions to map physical addresses to virtual addresses. The return value of the function is the mapped virtual address.
2. Void mmunmapiospace (in pvoid baseaddress, in ulong numberofbytes)
Baseaddress: point to the mapped virtual address
Numberofbytes: number of bytes mapped
This function is used to cancel the ing by calling the virtualfree function.
You can also see the transbusaddrtovirtual and transbusaddrtostatic functions in this module. These two functions have been replaced by the bustransbusaddrtovirtual and bustransbusaddrtostatic functions in the bus module of ceddk, we will not repeat it here.