在写一个驱动程序的时候用到ceddk.lib一个函数MmMapIoSpace(),编译后连接出现错误:
GIO.obj : error LNK2019: unresolved external symbol _MmMapIoSpace referenced in function "unsigned long __cdecl GIO_Init(unsigned short const *,void const *)" (?GIO_Init@@YAKPBGPBX@Z)
GIO.obj : error LNK2019: unresolved external symbol _MmUnmapIoSpace referenced in function "int __cdecl GIO_Deinit(unsigned long)" (?GIO_Deinit@@YAHK@Z)
转贴:
This procedure is fairly straightforward, and allows easy access to the hardware registers of many types of CPUs and peripherals in a Windows CE system. Usually this is accomplished via one of two mechanisms:
1) VirtualAlloc() + VirtualCopy() / VirtualFree()
a. A range of virtual address space is allocated that can map the physical space needed.
b. The virtual to physical mapping is set up for those pages
c. When necessary, the range of virtual pages is released and the mapping destroyed.
-OR-
2) MmMapIoSpace() / MmUnmapIoSpace()
a. This effectively does both of the (a) and (b) steps above in one function call, with fixups on the address if it is not page-aligned.
The functions in (1) are exported to all drivers and applications. The functions in (2) are implemented as part of the CEDDK (CE Driver Development Kit), and are customizable for any particular platform.