阅读:923回复:2
如何分配物理上连续的内存?
在内核模式下如何才能分配到在物理页面上连续的内存块?
用什么函数可以把虚地址转换为物理地址? |
|
最新喜欢:![]() |
沙发#
发布于:2004-05-13 10:53
MmGetPhysicalAddress returns the physical address that corresponds to the given virtual address.
Do not use this routine to obtain physical addresses for use with DMA operations. For information about the proper techniques for performing DMA operations, see Adapter Objects and DMA. |
|
|
板凳#
发布于:2004-05-13 10:52
MmAllocateContiguousMemory can be called to allocate a contiguous block of physical memory for a long-term internal buffer, usually from the DriverEntry routine.
A device driver that must use contiguous memory should allocate only what it needs during driver initialization because nonpaged pool is likely to become fragmented as the system runs. Such a driver must deallocate the memory if it is unloaded. Contiguous allocations are aligned on an integral multiple of the processor\'s data-cache-line size to prevent cache and coherency problems. |
|
|