Author: ros-arm-bringup Date: Thu Feb 14 23:03:33 2008 New Revision: 32361
URL: http://svn.reactos.org/svn/reactos?rev=32361&view=rev Log: Stop lying that the PCR, KUSER_SHARED_DATA, and PDEs are "BIOS" pages, they're USED pages. Stop initializing fields to 0 if we've already cleared the entire array! Stop setting arbitrary values for MapCount and ReferenceCount -- both the KPCR, KUSER_SHARED_DATA and PDE are mapped! Stop saying Video ROM has a reference count, it's the same as BIOS memory, except the MiIsPfnRam function doesn't detect it and we have a hack for it.
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/mm/freelist.c (original) +++ trunk/reactos/ntoskrnl/mm/freelist.c Thu Feb 14 23:03:33 2008 @@ -363,37 +363,37 @@ if (i == 0) { /* Page 0 is reserved for the IVT */ - MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_BIOS; + MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED; MmPageArray[i].Flags.Consumer = MC_NPPOOL; - MmPageArray[i].Flags.Zero = 0; - MmPageArray[i].ReferenceCount = 0; + MmPageArray[i].ReferenceCount = 2; + MmPageArray[i].MapCount = 1; MmStats.NrReservedPages++; } else if (i == 1) { /* Page 1 is reserved for the PCR */ - MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_BIOS; + MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED; MmPageArray[i].Flags.Consumer = MC_NPPOOL; - MmPageArray[i].Flags.Zero = 0; - MmPageArray[i].ReferenceCount = 1; + MmPageArray[i].ReferenceCount = 2; + MmPageArray[i].MapCount = 1; MmStats.NrReservedPages++; } else if (i == 2) { /* Page 2 is reserved for the KUSER_SHARED_DATA */ - MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_BIOS; + MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED; MmPageArray[i].Flags.Consumer = MC_NPPOOL; - MmPageArray[i].Flags.Zero = 0; - MmPageArray[i].ReferenceCount = 1; + MmPageArray[i].ReferenceCount = 2; + MmPageArray[i].MapCount = 1; MmStats.NrReservedPages++; } else if ((i >= PdePageStart) && (i < PdePageEnd)) { /* These pages contain the initial FreeLDR PDEs */ - MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_BIOS; - MmPageArray[i].Flags.Zero = 0; + MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED; MmPageArray[i].Flags.Consumer = MC_NPPOOL; - MmPageArray[i].ReferenceCount = 1; + MmPageArray[i].ReferenceCount = 2; + MmPageArray[i].MapCount = 1; MmStats.NrReservedPages++; } else if ((i >= VideoPageStart) && (i < VideoPageEnd)) @@ -405,16 +405,13 @@ * (which we'll assume to be "free" a couple of lines below) */ MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_BIOS; - MmPageArray[i].Flags.Zero = 0; MmPageArray[i].Flags.Consumer = MC_NPPOOL; - MmPageArray[i].ReferenceCount = 1; MmStats.NrReservedPages++; } else if ((i >= KernelPageStart) && (i < KernelPageEnd)) { /* These are pages beloning to the kernel */ MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED; - MmPageArray[i].Flags.Zero = 0; MmPageArray[i].Flags.Consumer = MC_NPPOOL; MmPageArray[i].ReferenceCount = 2; MmPageArray[i].MapCount = 1; @@ -424,7 +421,6 @@ { /* These are pages we allocated above to hold the PFN DB */ MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED; - MmPageArray[i].Flags.Zero = 0; MmPageArray[i].Flags.Consumer = MC_NPPOOL; MmPageArray[i].ReferenceCount = 2; MmPageArray[i].MapCount = 1; @@ -439,8 +435,6 @@ * Descriptor List, why bother, right? */ MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_FREE; - MmPageArray[i].Flags.Zero = 0; - MmPageArray[i].ReferenceCount = 0; InsertTailList(&FreeUnzeroedPageListHead, &MmPageArray[i].ListEntry); UnzeroedPageCount++; @@ -452,8 +446,6 @@ /* These are pages reserved by the BIOS/ROMs */ MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_BIOS; MmPageArray[i].Flags.Consumer = MC_NPPOOL; - MmPageArray[i].Flags.Zero = 0; - MmPageArray[i].ReferenceCount = 0; MmStats.NrReservedPages++; } }