Implement hardware layer pool memory management

This commit is contained in:
2024-05-22 18:51:09 +02:00
parent 28903e0c10
commit 03727a61d3
8 changed files with 526 additions and 2 deletions

View File

@@ -69,4 +69,13 @@ EXTERN ULONG MmPageMapLevel;
/* Processor structures data (THIS IS A TEMPORARY HACK) */
EXTERN UCHAR MmProcessorStructuresData[MAXIMUM_PROCESSORS][KPROCESSOR_STRUCTURES_SIZE];
/* Allocation descriptors dedicated for HAL */
EXTERN LOADER_MEMORY_MAPPING MmpHalAllocationDescriptors[MM_HAL_ALLOCATION_DESCRIPTORS];
/* Live address of kernel HAL heap */
EXTERN PVOID MmpHalHeapStart;
/* Number of used HAL allocation descriptors */
EXTERN ULONG MmpUsedHalAllocationDescriptors;
#endif /* __XTOSKRNL_GLOBALS_H */

View File

@@ -13,6 +13,12 @@
/* Memory Manager routines forward references */
XTAPI
XTSTATUS
MmAllocateHalMemory(IN PFN_NUMBER PageCount,
IN BOOLEAN Aligned,
OUT PULONG_PTR Buffer);
XTAPI
XTSTATUS
MmAllocateKernelStack(IN PVOID *Stack,
@@ -24,6 +30,10 @@ XTSTATUS
MmAllocateProcessorStructures(IN ULONG CpuNumber,
OUT PVOID *StructuresData);
XTAPI
VOID
MmFlushTlb(VOID);
XTAPI
VOID
MmFreeKernelStack(IN PVOID Stack,
@@ -37,6 +47,30 @@ XTAPI
VOID
MmInitializeMemoryManager(VOID);
XTAPI
XTSTATUS
MmMapHalMemory(IN PHYSICAL_ADDRESS PhysicalAddress,
IN PFN_NUMBER PageCount,
IN BOOLEAN FlushTlb,
OUT PVOID *VirtualAddress);
XTAPI
VOID
MmMarkHalMemoryWriteThrough(IN PVOID VirtualAddress,
IN PFN_NUMBER PageCount);
XTAPI
VOID
MmRemapHalMemory(IN PVOID VirtualAddress,
IN PHYSICAL_ADDRESS PhysicalAddress,
IN BOOLEAN FlushTlb);
XTAPI
XTSTATUS
MmUnmapHalMemory(IN PVOID VirtualAddress,
IN PFN_NUMBER PageCount,
IN BOOLEAN FlushTlb);
XTAPI
VOID
MmpScanMemoryDescriptors(VOID);