mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 17:00:31 +00:00
[NTOS:MM]
- Make PFN tracing work... somewhat svn path=/trunk/; revision=74626
This commit is contained in:
parent
b0da8bcfdf
commit
d855861c41
6 changed files with 42 additions and 17 deletions
|
@ -607,6 +607,7 @@ CcRosMapVacb(
|
||||||
{
|
{
|
||||||
PFN_NUMBER PageFrameNumber;
|
PFN_NUMBER PageFrameNumber;
|
||||||
|
|
||||||
|
MI_SET_USAGE(MI_USAGE_CACHE);
|
||||||
Status = MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &PageFrameNumber);
|
Status = MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &PageFrameNumber);
|
||||||
if (PageFrameNumber == 0)
|
if (PageFrameNumber == 0)
|
||||||
{
|
{
|
||||||
|
@ -741,8 +742,15 @@ CcRosCreateVacb (
|
||||||
PWCHAR pos = NULL;
|
PWCHAR pos = NULL;
|
||||||
ULONG len = 0;
|
ULONG len = 0;
|
||||||
pos = wcsrchr(SharedCacheMap->FileObject->FileName.Buffer, '\\');
|
pos = wcsrchr(SharedCacheMap->FileObject->FileName.Buffer, '\\');
|
||||||
|
if (pos)
|
||||||
|
{
|
||||||
len = wcslen(pos) * sizeof(WCHAR);
|
len = wcslen(pos) * sizeof(WCHAR);
|
||||||
if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S", pos);
|
snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S", pos);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%wZ", &SharedCacheMap->FileObject->FileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -653,8 +653,9 @@ MiResolveDemandZeroFault(IN PVOID Address,
|
||||||
if (UserPdeFault) MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
|
if (UserPdeFault) MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
|
||||||
if (!UserPdeFault) MI_SET_USAGE(MI_USAGE_DEMAND_ZERO);
|
if (!UserPdeFault) MI_SET_USAGE(MI_USAGE_DEMAND_ZERO);
|
||||||
#endif
|
#endif
|
||||||
if (Process) MI_SET_PROCESS2(Process->ImageFileName);
|
if (Process == HYDRA_PROCESS) MI_SET_PROCESS2("Hydra");
|
||||||
if (!Process) MI_SET_PROCESS2("Kernel Demand 0");
|
else if (Process) MI_SET_PROCESS2(Process->ImageFileName);
|
||||||
|
else MI_SET_PROCESS2("Kernel Demand 0");
|
||||||
|
|
||||||
/* Do we need a zero page? */
|
/* Do we need a zero page? */
|
||||||
if (Color != 0xFFFFFFFF)
|
if (Color != 0xFFFFFFFF)
|
||||||
|
|
|
@ -994,6 +994,8 @@ _WARN("MiSessionCommitPageTables halfplemented for amd64")
|
||||||
|
|
||||||
/* Acquire the PFN lock and grab a zero page */
|
/* Acquire the PFN lock and grab a zero page */
|
||||||
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
||||||
|
MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
|
||||||
|
MI_SET_PROCESS2(PsGetCurrentProcess()->ImageFileName);
|
||||||
Color = (++MmSessionSpace->Color) & MmSecondaryColorMask;
|
Color = (++MmSessionSpace->Color) & MmSecondaryColorMask;
|
||||||
PageFrameNumber = MiRemoveZeroPage(Color);
|
PageFrameNumber = MiRemoveZeroPage(Color);
|
||||||
TempPde.u.Hard.PageFrameNumber = PageFrameNumber;
|
TempPde.u.Hard.PageFrameNumber = PageFrameNumber;
|
||||||
|
|
|
@ -511,6 +511,7 @@ MiSessionInitializeWorkingSetList(VOID)
|
||||||
if (AllocatedPageTable != FALSE)
|
if (AllocatedPageTable != FALSE)
|
||||||
{
|
{
|
||||||
/* Get a zeroed colored zero page */
|
/* Get a zeroed colored zero page */
|
||||||
|
MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
|
||||||
Color = MI_GET_NEXT_COLOR();
|
Color = MI_GET_NEXT_COLOR();
|
||||||
PageFrameIndex = MiRemoveZeroPageSafe(Color);
|
PageFrameIndex = MiRemoveZeroPageSafe(Color);
|
||||||
if (!PageFrameIndex)
|
if (!PageFrameIndex)
|
||||||
|
@ -542,6 +543,7 @@ MiSessionInitializeWorkingSetList(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get a zeroed colored zero page */
|
/* Get a zeroed colored zero page */
|
||||||
|
MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
|
||||||
Color = MI_GET_NEXT_COLOR();
|
Color = MI_GET_NEXT_COLOR();
|
||||||
PageFrameIndex = MiRemoveZeroPageSafe(Color);
|
PageFrameIndex = MiRemoveZeroPageSafe(Color);
|
||||||
if (!PageFrameIndex)
|
if (!PageFrameIndex)
|
||||||
|
@ -679,6 +681,7 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
||||||
for (i = 0; i < MiSessionDataPages; i++)
|
for (i = 0; i < MiSessionDataPages; i++)
|
||||||
{
|
{
|
||||||
/* Get a zeroed colored zero page */
|
/* Get a zeroed colored zero page */
|
||||||
|
MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
|
||||||
Color = MI_GET_NEXT_COLOR();
|
Color = MI_GET_NEXT_COLOR();
|
||||||
DataPage[i] = MiRemoveZeroPageSafe(Color);
|
DataPage[i] = MiRemoveZeroPageSafe(Color);
|
||||||
if (!DataPage[i])
|
if (!DataPage[i])
|
||||||
|
@ -701,6 +704,7 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
||||||
SessionGlobal = MiPteToAddress(SessionPte);
|
SessionGlobal = MiPteToAddress(SessionPte);
|
||||||
|
|
||||||
/* Get a zeroed colored zero page */
|
/* Get a zeroed colored zero page */
|
||||||
|
MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
|
||||||
Color = MI_GET_NEXT_COLOR();
|
Color = MI_GET_NEXT_COLOR();
|
||||||
SessionPageDirIndex = MiRemoveZeroPageSafe(Color);
|
SessionPageDirIndex = MiRemoveZeroPageSafe(Color);
|
||||||
if (!SessionPageDirIndex)
|
if (!SessionPageDirIndex)
|
||||||
|
@ -742,6 +746,7 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
||||||
for (i = 0; i < MiSessionTagPages; i++)
|
for (i = 0; i < MiSessionTagPages; i++)
|
||||||
{
|
{
|
||||||
/* Grab a zeroed colored page */
|
/* Grab a zeroed colored page */
|
||||||
|
MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
|
||||||
Color = MI_GET_NEXT_COLOR();
|
Color = MI_GET_NEXT_COLOR();
|
||||||
TagPage[i] = MiRemoveZeroPageSafe(Color);
|
TagPage[i] = MiRemoveZeroPageSafe(Color);
|
||||||
if (!TagPage[i])
|
if (!TagPage[i])
|
||||||
|
|
|
@ -328,6 +328,15 @@ MmAllocateSpecialPool(SIZE_T NumberOfBytes, ULONG Tag, POOL_TYPE PoolType, ULONG
|
||||||
MiSpecialPoolFirstPte = MmSystemPteBase + PointerPte->u.List.NextEntry;
|
MiSpecialPoolFirstPte = MmSystemPteBase + PointerPte->u.List.NextEntry;
|
||||||
|
|
||||||
/* Allocate a physical page */
|
/* Allocate a physical page */
|
||||||
|
if (PoolType == PagedPool)
|
||||||
|
{
|
||||||
|
MI_SET_USAGE(MI_USAGE_PAGED_POOL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MI_SET_USAGE(MI_USAGE_NONPAGED_POOL);
|
||||||
|
}
|
||||||
|
MI_SET_PROCESS2("Kernel-Special");
|
||||||
PageFrameNumber = MiRemoveAnyPage(MI_GET_NEXT_COLOR());
|
PageFrameNumber = MiRemoveAnyPage(MI_GET_NEXT_COLOR());
|
||||||
|
|
||||||
/* Initialize PFN and make it valid */
|
/* Initialize PFN and make it valid */
|
||||||
|
|
|
@ -178,6 +178,13 @@ MiLoadImageSection(IN OUT PVOID *SectionPtr,
|
||||||
/* Lock the PFN database */
|
/* Lock the PFN database */
|
||||||
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
||||||
|
|
||||||
|
/* Loop the new driver PTEs */
|
||||||
|
TempPte = ValidKernelPte;
|
||||||
|
while (PointerPte < LastPte)
|
||||||
|
{
|
||||||
|
/* Make sure the PTE is not valid for whatever reason */
|
||||||
|
ASSERT(PointerPte->u.Hard.Valid == 0);
|
||||||
|
|
||||||
/* Some debug stuff */
|
/* Some debug stuff */
|
||||||
MI_SET_USAGE(MI_USAGE_DRIVER_PAGE);
|
MI_SET_USAGE(MI_USAGE_DRIVER_PAGE);
|
||||||
#if MI_TRACE_PFNS
|
#if MI_TRACE_PFNS
|
||||||
|
@ -191,13 +198,6 @@ MiLoadImageSection(IN OUT PVOID *SectionPtr,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Loop the new driver PTEs */
|
|
||||||
TempPte = ValidKernelPte;
|
|
||||||
while (PointerPte < LastPte)
|
|
||||||
{
|
|
||||||
/* Make sure the PTE is not valid for whatever reason */
|
|
||||||
ASSERT(PointerPte->u.Hard.Valid == 0);
|
|
||||||
|
|
||||||
/* Grab a page */
|
/* Grab a page */
|
||||||
PageFrameIndex = MiRemoveAnyPage(MI_GET_NEXT_COLOR());
|
PageFrameIndex = MiRemoveAnyPage(MI_GET_NEXT_COLOR());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue