Author: arty
Date: Mon Sep 8 18:59:45 2008
New Revision: 36072
URL:
http://svn.reactos.org/svn/reactos?rev=36072&view=rev
Log:
Some WIP and poking around in preparation for a merge from trunk.
Modified:
branches/arty-newcc/ntoskrnl/cache/cachesub.c
branches/arty-newcc/ntoskrnl/cache/fssup.c
branches/arty-newcc/ntoskrnl/mm/section.c
Modified: branches/arty-newcc/ntoskrnl/cache/cachesub.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/cache…
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] Mon Sep 8 18:59:45 2008
@@ -235,7 +235,6 @@
if (!Result)
{
- DPRINT("The requested section wasn't mapped, therefore doesn't need to be
flushed\n");
return;
}
@@ -243,7 +242,6 @@
* of the pages. Figured out how to do this right. */
if (Bcb->Pinned || !Bcb->Dirty)
{
- DPRINT("Bailing because the area is pinned or not dirty\n");
return;
}
Modified: branches/arty-newcc/ntoskrnl/cache/fssup.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/fssup…
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] Mon Sep 8 18:59:45 2008
@@ -56,7 +56,7 @@
if (!NT_SUCCESS(Status))
{
- KEBUGCHECK(0);
+ KeBugCheck(0);
}
Status = PsCreateSystemThread
@@ -70,7 +70,7 @@
if (!NT_SUCCESS(Status))
{
- KEBUGCHECK(0);
+ KeBugCheck(0);
}
return TRUE;
Modified: branches/arty-newcc/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/section.…
==============================================================================
--- branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] Mon Sep 8 18:59:45 2008
@@ -46,7 +46,7 @@
#include <ntoskrnl.h>
//#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include <reactos/exeformat.h>
#if defined (ALLOC_PRAGMA)
@@ -123,7 +123,7 @@
PMDL Mdl = Irp->MdlAddress;
while (Mdl)
{
- MmUnlockPages(Mdl);
+ MmUnlockPages(Mdl);
Mdl = Mdl->Next;
}
@@ -135,7 +135,7 @@
IoFreeMdl(Mdl);
}
- return STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -162,11 +162,13 @@
ASSERT(DeviceObject);
+#if 0
DPRINT1
("PAGING READ: FileObject %x Offset %x Length %d\n",
&FileObject,
FileOffset->LowPart,
Length);
+#endif
KeInitializeEvent(&ReadWait, NotificationEvent, FALSE);
@@ -473,6 +475,7 @@
NTAPI
MmLockSectionSegment(PMM_SECTION_SEGMENT Segment)
{
+ DPRINT("MmLockSectionSegment(%p)\n", Segment);
ExAcquireFastMutex(&Segment->Lock);
}
@@ -481,6 +484,7 @@
MmUnlockSectionSegment(PMM_SECTION_SEGMENT Segment)
{
ExReleaseFastMutex(&Segment->Lock);
+ DPRINT("MmUnlockSectionSegment(%p)\n", Segment);
}
VOID
@@ -540,7 +544,6 @@
{
DirectoryOffset = PAGE_TO_SECTION_PAGE_DIRECTORY_OFFSET(Offset);
Table = Segment->PageDirectory.PageTables[DirectoryOffset];
- DPRINT("Table %x\n", Table);
if (Table == NULL)
{
return(0);
@@ -548,6 +551,9 @@
}
TableOffset = PAGE_TO_SECTION_PAGE_TABLE_OFFSET(Offset);
Entry = Table->Entry[TableOffset];
+
+ DPRINT("MmGetPageEntrySection(%p,%x) -> %x\n", Segment, Offset, Entry);
+
return(Entry);
}
@@ -587,6 +593,8 @@
{
ULONG Entry;
BOOLEAN IsDirectMapped = FALSE;
+
+ DPRINT("MmUnsharePageEntrySectionSegment(%p,%x)\n", Segment, Offset);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
if (Entry == 0)
@@ -707,6 +715,7 @@
{
MmSetPageEntrySectionSegment(Segment, Offset, Entry);
}
+ DPRINT("MmUnsharePageEntrySectionSegment(%p,%x) -> Done\n", Segment,
Offset);
return(SHARE_COUNT_FROM_SSE(Entry) > 0);
}
@@ -730,6 +739,8 @@
PMM_REGION Region;
BOOLEAN HasSwapEntry;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+
+ DPRINT("Not Present: %p %p\n", AddressSpace, Address);
/*
* There is a window between taking the page fault and locking the
@@ -833,6 +844,8 @@
*/
if (!MmIsPagePresent(Process, Address))
{
+ DPRINT("!MmIsPagePresent(%p, %p)\n", Process, Address);
+
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
HasSwapEntry = MmIsPageSwapEntry(Process, (PVOID)PAddress);
@@ -1040,7 +1053,9 @@
/*
* Get the entry corresponding to the offset within the section
*/
+ DPRINT("MmNotPresentFaultSectionView -> MmGetPageEntrySectionSegment(%p,
%x)\n", Segment, Offset);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
+ DPRINT("Got entry %x\n", Entry);
if (Entry == 0)
{
@@ -1121,6 +1136,7 @@
* Check the entry. No one should change the status of a page
* that has a pending page-in.
*/
+ DPRINT("MmNotPresentFaultSectionView -> MmGetPageEntrySectionSegment(%p,
%x)\n", Segment, Offset);
Entry1 = MmGetPageEntrySectionSegment(Segment, Offset);
if (Entry != Entry1)
{
@@ -1192,6 +1208,7 @@
* Check the entry. No one should change the status of a page
* that has a pending page-in.
*/
+ DPRINT("MmNotPresentFaultSectionView -> MmGetPageEntrySectionSegment(%p,
%x)\n", Segment, Offset);
Entry1 = MmGetPageEntrySectionSegment(Segment, Offset);
if (Entry != Entry1)
{
@@ -1314,6 +1331,7 @@
MmLockSectionSegment(Segment);
OldPage = MmGetPfnForProcess(NULL, Address);
+ DPRINT("MmNotPresentFaultSectionView -> MmGetPageEntrySectionSegment(%p,
%x)\n", Segment, Offset);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
MmUnlockSectionSegment(Segment);
@@ -1550,6 +1568,7 @@
/*
* Get the section segment entry and the physical address.
*/
+ DPRINT("MmPageOutSectionView -> MmGetPageEntrySectionSegment(%p, %x)\n",
Context.Segment, Context.Offset);
Entry = MmGetPageEntrySectionSegment(Context.Segment, Context.Offset);
if (!MmIsPagePresent(Process, Address))
{
@@ -1582,6 +1601,7 @@
* If this wasn't a private page then we should have reduced the entry to
* zero by deleting all the rmaps.
*/
+ DPRINT("MmPageOutSectionView -> MmGetPageEntrySectionSegment(%p, %x)\n",
Context.Segment, Context.Offset);
if (!Context.Private && MmGetPageEntrySectionSegment(Context.Segment,
Context.Offset) != 0)
{
if (!(Context.Segment->Flags & MM_PAGEFILE_SEGMENT) &&
@@ -1894,6 +1914,7 @@
/*
* Get the section segment entry and the physical address.
*/
+ DPRINT("MmWritePageSectionView -> MmGetPageEntrySectionSegment(%p,
%x)\n", Segment, Offset);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
if (!MmIsPagePresent(Process, Address))
{
@@ -2022,6 +2043,7 @@
Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress
+ MemoryArea->Data.SectionData.ViewOffset;
+ DPRINT("MmAlterViewAttributes -> MmGetPageEntrySectionSegment(%p,
%x)\n", Segment, Offset);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
Page = MmGetPfnForProcess(Process, Address);
@@ -2134,6 +2156,7 @@
Length = PAGE_ROUND_UP(Segment->Length);
for (Offset = 0; Offset < Length; Offset += PAGE_SIZE)
{
+ DPRINT("MmAlterViewAttributes -> MmGetPageEntrySectionSegment(%p,
%x)\n", Segment, Offset);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
if (Entry)
{
@@ -3836,6 +3859,7 @@
PageOp = MmCheckForPageOp(MemoryArea, NULL, NULL, Segment, Offset);
}
+ DPRINT("MmFreeSectionPage -> MmGetPageEntrySectionSegment(%p, %x)\n",
Segment, Offset);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
/*
@@ -3984,6 +4008,7 @@
MemoryArea->DeleteInProgress)
{
MmUnlockAddressSpace(AddressSpace);
+ DPRINT("STATUS_NOT_MAPPED_VIEW\n");
return STATUS_NOT_MAPPED_VIEW;
}
@@ -4015,6 +4040,7 @@
MemoryArea->Type != MEMORY_AREA_SECTION_VIEW)
{
MmUnlockAddressSpace(AddressSpace);
+ DPRINT("STATUS_NOT_MAPPED_VIEW\n");
return STATUS_NOT_MAPPED_VIEW;
}
break;