From 2a0160473e75af278ba1a031cf8cd0ba982efa0f Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Thu, 21 Sep 2006 17:25:41 +0000 Subject: [PATCH] Add an MM api to get the memory map from Freeldr's memory manager (as opposed to MachGetMemoryMap which gets architecture-specfic memory map returned by BIOS/firmware/etc). Currently this api is unused, it's going to be used by windows/reactos bootloader in future. svn path=/trunk/; revision=24224 --- reactos/boot/freeldr/freeldr/include/mm.h | 1 + reactos/boot/freeldr/freeldr/mm/mm.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/reactos/boot/freeldr/freeldr/include/mm.h b/reactos/boot/freeldr/freeldr/include/mm.h index d3b4369762a..24fce2d4b33 100644 --- a/reactos/boot/freeldr/freeldr/include/mm.h +++ b/reactos/boot/freeldr/freeldr/include/mm.h @@ -86,6 +86,7 @@ VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, ULONG TotalPageCount); // S BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE ULONG GetSystemMemorySize(VOID); // Returns the amount of total memory in the system +PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries); // Returns a pointer to the memory mapping table and a number of entries in it //BOOLEAN MmInitializeMemoryManager(ULONG LowMemoryStart, ULONG LowMemoryLength); diff --git a/reactos/boot/freeldr/freeldr/mm/mm.c b/reactos/boot/freeldr/freeldr/mm/mm.c index 928fe94e566..d5ad60f0c26 100644 --- a/reactos/boot/freeldr/freeldr/mm/mm.c +++ b/reactos/boot/freeldr/freeldr/mm/mm.c @@ -456,3 +456,12 @@ ULONG GetSystemMemorySize(VOID) { return (TotalPagesInLookupTable * MM_PAGE_SIZE); } + +PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries) +{ + PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTableAddress; + + *NoEntries = TotalPagesInLookupTable; + + return RealPageLookupTable; +} -- 2.17.1