2010-12-30 15:12:46 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "hardware.h"
|
|
|
|
|
2011-04-13 01:37:14 +00:00
|
|
|
/* destroys memory allocator */
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
DmaMemAllocator_Destroy(
|
|
|
|
IN LPDMA_MEMORY_ALLOCATOR Allocator);
|
2010-12-30 15:12:46 +00:00
|
|
|
|
2011-04-13 01:37:14 +00:00
|
|
|
/* create memory allocator */
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DmaMemAllocator_Create(
|
|
|
|
IN LPDMA_MEMORY_ALLOCATOR *OutMemoryAllocator);
|
2010-12-30 15:12:46 +00:00
|
|
|
|
2011-04-13 01:37:14 +00:00
|
|
|
/* initializes memory allocator */
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DmaMemAllocator_Initialize(
|
|
|
|
IN OUT LPDMA_MEMORY_ALLOCATOR Allocator,
|
|
|
|
IN ULONG DefaultBlockSize,
|
|
|
|
IN PKSPIN_LOCK Lock,
|
|
|
|
IN PHYSICAL_ADDRESS PhysicalBase,
|
|
|
|
IN PVOID VirtualBase,
|
|
|
|
IN ULONG Length);
|
2010-12-30 15:12:46 +00:00
|
|
|
|
2011-04-13 01:37:14 +00:00
|
|
|
/* allocates memory from allocator */
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DmaMemAllocator_Allocate(
|
|
|
|
IN LPDMA_MEMORY_ALLOCATOR Allocator,
|
|
|
|
IN ULONG Size,
|
|
|
|
OUT PVOID *OutVirtualAddress,
|
|
|
|
OUT PPHYSICAL_ADDRESS OutPhysicalAddress);
|
2010-12-30 15:12:46 +00:00
|
|
|
|
2011-04-13 01:37:14 +00:00
|
|
|
/* frees memory block from allocator */
|
2010-12-30 15:12:46 +00:00
|
|
|
VOID
|
2011-04-13 01:37:14 +00:00
|
|
|
NTAPI
|
|
|
|
DmaMemAllocator_Free(
|
|
|
|
IN LPDMA_MEMORY_ALLOCATOR Allocator,
|
|
|
|
IN PVOID VirtualAddress,
|
|
|
|
IN ULONG Size);
|