mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:32:57 +00:00
- Allocate enough space for the ARM3 PFN database, and fixup the calculation of the initial nonpaged pool.
- The ARM3 PFN database is more of a "shadow" database not to interfere with the real ReactOS PFN database. It starts at 0xB0000000, which is where the initial nonpaged pool started (which now starts somewhere after the ARM3 PFN database). - No new behavior has been introduced other than additional physical memory consumption for the PFN DB pages, and updated memory layout in the ARM3 world. svn path=/trunk/; revision=41634
This commit is contained in:
parent
2d20864907
commit
fdf4fe9afa
1 changed files with 40 additions and 10 deletions
|
@ -52,8 +52,8 @@ ULONG MmMaxAdditionNonPagedPoolPerMb = 400 * 1024;
|
|||
// immediately follows the PFN database, typically sharing the same PDE. It is
|
||||
// a very small resource (32MB on a 1GB system), and capped at 128MB.
|
||||
//
|
||||
// Right now, we call this the "ARM Pool" and it begins at 0xB0000000 since we
|
||||
// don't want to interefere with the ReactOS memory manager PFN database (yet).
|
||||
// Right now, we call this the "ARM Pool" and it begins somewhere after the ARM
|
||||
// PFN database (which starts at 0xB0000000).
|
||||
//
|
||||
// The expansion nonpaged pool, on the other hand, can grow much bigger (400MB
|
||||
// for a 1GB system). On ARM³ however, it is currently capped at 128MB.
|
||||
|
@ -102,6 +102,18 @@ PVOID MmNonPagedPoolEnd = (PVOID)0xFFBE0000;
|
|||
//
|
||||
ULONG MmNumberOfSystemPtes;
|
||||
|
||||
//
|
||||
// This is how many pages the PFN database will take up
|
||||
// In Windows, this includes the Quark Color Table, but not in ARM³
|
||||
//
|
||||
ULONG MxPfnAllocation;
|
||||
|
||||
|
||||
//
|
||||
// The ARM³ PFN Database
|
||||
//
|
||||
PMMPFN MmArmPfnDatabase;
|
||||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
//
|
||||
|
@ -275,6 +287,12 @@ MmArmInitSystem(IN ULONG Phase,
|
|||
MmMaximumNonPagedPoolInBytes = MI_MAX_NONPAGED_POOL_SIZE;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate the number of bytes, and then convert to pages
|
||||
//
|
||||
MxPfnAllocation = (MmHighestPhysicalPage + 1) * sizeof(MMPFN);
|
||||
MxPfnAllocation >>= PAGE_SHIFT;
|
||||
|
||||
//
|
||||
// Now calculate the nonpaged pool expansion VA region
|
||||
//
|
||||
|
@ -317,30 +335,42 @@ MmArmInitSystem(IN ULONG Phase,
|
|||
}
|
||||
|
||||
//
|
||||
// Non paged pool should come after the PFN database, but since we are
|
||||
// co-existing with the ReactOS NP pool, our "ARM Pool" will instead
|
||||
// start at this arbitrarly chosen base address.
|
||||
// When ARM pool becomes non paged pool, this needs to be changed.
|
||||
// Normally, the PFN database should start after the loader images.
|
||||
// This is already the case in ReactOS, but for now we want to co-exist
|
||||
// with the old memory manager, so we'll create a "Shadow PFN Database"
|
||||
// instead, and arbitrarly start it at 0xB0000000.
|
||||
//
|
||||
MmArmPfnDatabase = (PVOID)0xB0000000;
|
||||
ASSERT(((ULONG_PTR)MmArmPfnDatabase & ((4 * 1024 * 1024) - 1)) == 0);
|
||||
|
||||
//
|
||||
// Non paged pool comes after the PFN database
|
||||
//
|
||||
DPRINT1("System PTE VA starts at: %p\n", MmNonPagedSystemStart);
|
||||
DPRINT1("NP Expansion VA begins at: %p and ends at: %p\n",
|
||||
MmNonPagedPoolStart, MmNonPagedPoolEnd);
|
||||
MmNonPagedPoolStart = (PVOID)0xB0000000;
|
||||
MmNonPagedPoolStart = (PVOID)((ULONG_PTR)MmArmPfnDatabase +
|
||||
(MxPfnAllocation << PAGE_SHIFT));
|
||||
|
||||
//
|
||||
// Now we actually need to get these many physical pages. Nonpaged pool
|
||||
// is actually also physically contiguous (but not the expansion)
|
||||
//
|
||||
PageFrameIndex = MmGetContinuousPages(MmSizeOfNonPagedPoolInBytes,
|
||||
PageFrameIndex = MmGetContinuousPages(MmSizeOfNonPagedPoolInBytes +
|
||||
(MxPfnAllocation << PAGE_SHIFT),
|
||||
Low,
|
||||
High,
|
||||
BoundaryAddressMultiple,
|
||||
FALSE);
|
||||
ASSERT(PageFrameIndex != 0);
|
||||
DPRINT1("PFN DB VA begins at: %p and ends at: %p\n",
|
||||
MmArmPfnDatabase,
|
||||
(ULONG_PTR)MmArmPfnDatabase + (MxPfnAllocation << PAGE_SHIFT));
|
||||
DPRINT1("PFN DB PA PFN begins at: %lx\n", PageFrameIndex);
|
||||
DPRINT1("NP VA begins at: %p and ends at: %p\n",
|
||||
MmNonPagedPoolStart,
|
||||
(ULONG_PTR)MmNonPagedPoolStart + MmSizeOfNonPagedPoolInBytes);
|
||||
DPRINT1("NP PA PFN begins at: %lx\n", PageFrameIndex);
|
||||
DPRINT1("NP PA PFN begins at: %lx\n", PageFrameIndex + MxPfnAllocation);
|
||||
|
||||
//
|
||||
// Now we need some pages to create the page tables for the NP system VA
|
||||
|
@ -377,7 +407,7 @@ MmArmInitSystem(IN ULONG Phase,
|
|||
//
|
||||
// Now we need pages for the page tables which will map initial NP
|
||||
//
|
||||
StartPde = MiAddressToPde(MmNonPagedPoolStart);
|
||||
StartPde = MiAddressToPde(MmArmPfnDatabase);
|
||||
EndPde = MiAddressToPde((PVOID)((ULONG_PTR)MmNonPagedPoolStart +
|
||||
MmSizeOfNonPagedPoolInBytes - 1));
|
||||
while (StartPde <= EndPde)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue