Author: tkreuzer
Date: Mon Oct 19 17:39:16 2009
New Revision: 43602
URL:
http://svn.reactos.org/svn/reactos?rev=43602&view=rev
Log:
[FREELDR]
Round up to pages when updating LoaderPagesSpanned to avoid a bug when the last memory
region is not mapped.
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Mon Oct
19 17:39:16 2009
@@ -75,8 +75,8 @@
#endif // DBG
// Update LoaderPagesSpanned count
- if ((((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT) > LoaderPagesSpanned)
- LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT);
+ if ((((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT) >
LoaderPagesSpanned)
+ LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >>
PAGE_SHIFT);
// Now return the pointer
return MemPointer;
@@ -175,8 +175,8 @@
#endif // DBG
// Update LoaderPagesSpanned count
- if ((((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT) > LoaderPagesSpanned)
- LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT);
+ if ((((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT) >
LoaderPagesSpanned)
+ LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >>
PAGE_SHIFT);
// Now return the pointer
return MemPointer;