Commit in reactos/ntoskrnl on MAIN
cc/copy.c+3-31.21 -> 1.22
mm/mdl.c+22-631.63 -> 1.64
  /pagefile.c+4-41.45 -> 1.46
+29-70
3 modified files
- Store page numbers instead of physical address's within mdls.

reactos/ntoskrnl/cc
copy.c 1.21 -> 1.22
diff -u -r1.21 -r1.22
--- copy.c	22 May 2004 18:28:18 -0000	1.21
+++ copy.c	6 Jun 2004 07:52:22 -0000	1.22
@@ -1,4 +1,4 @@
-/* $Id: copy.c,v 1.21 2004/05/22 18:28:18 hbirr Exp $
+/* $Id: copy.c,v 1.22 2004/06/06 07:52:22 hbirr Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -136,7 +136,7 @@
 		  PHYSICAL_ADDRESS page;
 		  address = (char*)current2->BaseAddress + (i * PAGE_SIZE);
 		  page = MmGetPhysicalAddressForProcess(NULL, address);
-		  ((PULONG)(Mdl + 1))[offset] = page.u.LowPart;
+		  ((PULONG)(Mdl + 1))[offset] = page.QuadPart >> PAGE_SHIFT;
 		  offset++;
 		}
 	      current2 = current2->NextInChain;
@@ -553,7 +553,7 @@
 	  Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
 	  for (i = 0; i < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); i++)
 	    {
-	      ((PULONG)(Mdl + 1))[i] = CcZeroPage.u.LowPart;
+	      ((PULONG)(Mdl + 1))[i] = CcZeroPage.QuadPart >> PAGE_SHIFT;
 	    }
           KeInitializeEvent(&Event, NotificationEvent, FALSE);
 	  Status = IoPageWrite(FileObject, Mdl, &WriteOffset, &Event, &Iosb);

reactos/ntoskrnl/mm
mdl.c 1.63 -> 1.64
diff -u -r1.63 -r1.64
--- mdl.c	16 May 2004 22:27:57 -0000	1.63
+++ mdl.c	6 Jun 2004 07:52:22 -0000	1.64
@@ -1,4 +1,4 @@
-/* $Id: mdl.c,v 1.63 2004/05/16 22:27:57 navaraf Exp $
+/* $Id: mdl.c,v 1.64 2004/06/06 07:52:22 hbirr Exp $
  *
  * COPYRIGHT:    See COPYING in the top level directory
  * PROJECT:      ReactOS kernel
@@ -111,6 +111,7 @@
 {
    ULONG i;
    PULONG MdlPages;
+   PHYSICAL_ADDRESS Page;
 
    /* 
     * MmProbeAndLockPages MUST have been called to lock this mdl!
@@ -150,17 +151,9 @@
    MdlPages = (PULONG)(Mdl + 1);
    for (i=0; i<(PAGE_ROUND_UP(Mdl->ByteCount+Mdl->ByteOffset)/PAGE_SIZE); i++)
    {
-#if defined(__GNUC__)
-      MmUnlockPage((LARGE_INTEGER)(LONGLONG)MdlPages[i]);
-      MmDereferencePage((LARGE_INTEGER)(LONGLONG)MdlPages[i]);
-#else
-
-      PHYSICAL_ADDRESS dummyJunkNeeded;
-      dummyJunkNeeded.QuadPart = MdlPages[i];
-      MmUnlockPage(dummyJunkNeeded);
-      MmDereferencePage(dummyJunkNeeded);
-#endif
-
+      Page.QuadPart = MdlPages[i] << PAGE_SHIFT;
+      MmUnlockPage(Page);
+      MmDereferencePage(Page);
    }
    
    Mdl->MdlFlags &= ~MDL_PAGES_LOCKED;
@@ -193,6 +186,7 @@
    ULONG PageCount;
    ULONG StartingOffset;
    PEPROCESS CurrentProcess;
+   PHYSICAL_ADDRESS Page;
 
    DPRINT("MmMapLockedPages(Mdl %x, AccessMode %x)\n", Mdl, AccessMode);
 
@@ -283,20 +277,11 @@
    for (i = 0; i < PageCount; i++)
    {
       NTSTATUS Status;
-#if !defined(__GNUC__)
-
-      PHYSICAL_ADDRESS dummyJunkNeeded;
-      dummyJunkNeeded.QuadPart = MdlPages[i];
-#endif
-
+      Page.QuadPart = MdlPages[i] << PAGE_SHIFT;
       Status = MmCreateVirtualMapping(CurrentProcess,
                                       (PVOID)((ULONG)Base+(i*PAGE_SIZE)),
                                       PAGE_READWRITE,
-#if defined(__GNUC__)
-                                      (LARGE_INTEGER)(LONGLONG)MdlPages[i],
-#else
-                                      dummyJunkNeeded,
-#endif
+                                      Page,
                                       FALSE);
       if (!NT_SUCCESS(Status))
       {
@@ -427,7 +412,7 @@
 
    for (i=0;i<(PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGE_SIZE);i++)
    {
-      MdlPages[i] = Pages[i];
+      MdlPages[i] = Pages[i] >> PAGE_SHIFT;
    }
    
    //FIXME: this flag should be set by the caller perhaps?
@@ -460,6 +445,7 @@
    ULONG NrPages;
    NTSTATUS Status;
    KPROCESSOR_MODE Mode;
+   PHYSICAL_ADDRESS Page;
    PEPROCESS CurrentProcess = PsGetCurrentProcess();
 
    DPRINT("MmProbeAndLockPages(Mdl %x)\n", Mdl);
@@ -475,13 +461,13 @@
 
 
    if (Mdl->StartVa >= (PVOID)KERNEL_BASE && 
-       (MmGetPhysicalAddressForProcess(NULL, Mdl->StartVa).u.LowPart >> PAGE_SHIFT) > MmPageArraySize)
+       (MmGetPhysicalAddressForProcess(NULL, Mdl->StartVa).QuadPart >> PAGE_SHIFT) > MmPageArraySize)
    {
        /* phys addr is not phys memory so this must be io memory */
        
       for (i = 0; i < NrPages; i++)
       {
-         MdlPages[i] = MmGetPhysicalAddressForProcess(NULL, (char*)Mdl->StartVa + (i*PAGE_SIZE)).u.LowPart;
+         MdlPages[i] = MmGetPhysicalAddressForProcess(NULL, (char*)Mdl->StartVa + (i*PAGE_SIZE)).QuadPart >> PAGE_SHIFT;
       }
       
       Mdl->MdlFlags |= MDL_PAGES_LOCKED|MDL_IO_SPACE;
@@ -526,17 +512,9 @@
          {
             for (j = 0; j < i; j++)
             {
-#if defined(__GNUC__)
-               MmUnlockPage((LARGE_INTEGER)(LONGLONG)MdlPages[j]);
-               MmDereferencePage((LARGE_INTEGER)(LONGLONG)MdlPages[j]);
-#else
-
-               PHYSICAL_ADDRESS dummyJunkNeeded;
-               dummyJunkNeeded.QuadPart = MdlPages[j];
-               MmUnlockPage(dummyJunkNeeded);
-               MmDereferencePage(dummyJunkNeeded);
-#endif
-
+	       Page.QuadPart = MdlPages[j] << PAGE_SHIFT;
+               MmUnlockPage(Page);
+               MmDereferencePage(Page);
             }
             ExRaiseStatus(Status);
          }
@@ -554,35 +532,16 @@
          {
             for (j = 0; j < i; j++)
             {
-#if defined(__GNUC__)
-               MmUnlockPage((LARGE_INTEGER)(LONGLONG)MdlPages[j]);
-               MmDereferencePage(
-                  (LARGE_INTEGER)(LONGLONG)MdlPages[j]);
-#else
-
-               PHYSICAL_ADDRESS dummyJunkNeeded;
-               dummyJunkNeeded.QuadPart = MdlPages[j];
-               MmUnlockPage(dummyJunkNeeded);
-               MmDereferencePage(dummyJunkNeeded);
-#endif
-
+	       Page.QuadPart = (ULONGLONG)MdlPages[j] << PAGE_SHIFT;
+               MmUnlockPage(Page);
+               MmDereferencePage(Page);
             }
             ExRaiseStatus(Status);
          }
       }
-      MdlPages[i] = MmGetPhysicalAddressForProcess(NULL, Address).u.LowPart;
-#if defined(__GNUC__)
-
-      MmReferencePage((LARGE_INTEGER)(LONGLONG)MdlPages[i]);
-#else
-
-      {
-         PHYSICAL_ADDRESS dummyJunkNeeded;
-         dummyJunkNeeded.QuadPart = MdlPages[i];
-         MmReferencePage(dummyJunkNeeded);
-      }
-#endif
-
+      Page = MmGetPhysicalAddressForProcess(NULL, Address);
+      MdlPages[i] = Page.QuadPart >> PAGE_SHIFT;
+      MmReferencePage(Page);
    }
    
    MmUnlockAddressSpace(&CurrentProcess->AddressSpace);
@@ -644,7 +603,7 @@
    for (i=0; i < PageCount; i++)
    {
       ((PULONG)(Mdl + 1))[i] =
-         (MmGetPhysicalAddress((char*)Mdl->StartVa + (i * PAGE_SIZE))).u.LowPart;
+         (MmGetPhysicalAddress((char*)Mdl->StartVa + (i * PAGE_SIZE))).QuadPart >> PAGE_SHIFT;
    }
    
    Mdl->MdlFlags |= MDL_SOURCE_IS_NONPAGED_POOL;

reactos/ntoskrnl/mm
pagefile.c 1.45 -> 1.46
diff -u -r1.45 -r1.46
--- pagefile.c	20 May 2004 08:37:20 -0000	1.45
+++ pagefile.c	6 Jun 2004 07:52:22 -0000	1.46
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: pagefile.c,v 1.45 2004/05/20 08:37:20 hbirr Exp $
+/* $Id: pagefile.c,v 1.46 2004/06/06 07:52:22 hbirr Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/mm/pagefile.c
@@ -485,7 +485,7 @@
 {
    PMM_CORE_DUMP_HEADER Headers;
    NTSTATUS Status;
-   UCHAR MdlBase[sizeof(MDL) + sizeof(PVOID)];
+   UCHAR MdlBase[sizeof(MDL) + sizeof(ULONG)];
    PMDL Mdl = (PMDL)MdlBase;
    PETHREAD Thread = PsGetCurrentThread();
    ULONG StackSize;
@@ -553,7 +553,7 @@
    RetrievalPointers = PagingFileList[MmCoreDumpPageFile]->RetrievalPointers;
 
    /* Dump the header. */
-   MdlMap[0] = MmGetPhysicalAddress(MmCoreDumpPageFrame).u.LowPart;
+   MdlMap[0] = MmGetPhysicalAddress(MmCoreDumpPageFrame).QuadPart >> PAGE_SHIFT;
 #if defined(__GNUC__)
 
    DiskOffset = MmGetOffsetPageFile(RetrievalPointers, (LARGE_INTEGER)0LL);
@@ -586,7 +586,7 @@
       {
          LARGE_INTEGER PhysicalAddress;
          PhysicalAddress.QuadPart = i * PAGE_SIZE;
-         MdlMap[0] = i * PAGE_SIZE;
+         MdlMap[0] = i;
          MmCreateVirtualMappingForKernel(MmCoreDumpPageFrame, 
 	                                 PAGE_READWRITE,
                                          PhysicalAddress);
CVSspam 0.2.8