replace ad hoc driver loading with a proper driver manager, new DDK, new PnP manager with device matching, asynchronous startup, resource ownership and removal, add shared PCI capability helpers, replace typed, rigid services with a proper service manager, implement proper system shutdown and restart, shutting down unloads drivers and shuts down services, add simple power button, remove heavyweight boot self-tests and SMP stress runs, add monotonic timestamps to kernel debug output, fruitless USB and PS/2 fixes, make test builds opt in.
This commit is contained in:
1 parent
c0ad63c27f
commit
d36f19509c
160 files changed
+6563
-7366
No files matched your search
+15
-6
@@ -794,12 +794,14 @@ void MmPfnQueryStats(MM_PFN_STATS* out) {
|
||||
MM_PFN_STATS stats;
|
||||
memset(&stats, 0, sizeof(stats));
|
||||
|
||||
uintptr_t flags = KeAcquireSpinlock(&gPfnLock);
|
||||
stats.TotalFrames = (uint64_t)gTotalFrames;
|
||||
stats.FreeFrames = (uint64_t)gFreeFrames;
|
||||
stats.UsedFrames = stats.TotalFrames - stats.FreeFrames;
|
||||
|
||||
for (size_t pfn = 0; pfn < gMaxPfn; pfn++) {
|
||||
// Detailed statistics are diagnostic snapshots. Scan bounded PFN batches
|
||||
// so an ordinary query cannot monopolize the global allocator lock on
|
||||
// machines with millions of physical frames. Counters are sampled at end.
|
||||
const size_t pfnCount = gMaxPfn;
|
||||
for (size_t base = 0; base < pfnCount;) {
|
||||
size_t end = pfnCount - base < 1024u ? pfnCount : base + 1024u;
|
||||
uintptr_t flags = KeAcquireSpinlock(&gPfnLock);
|
||||
for (size_t pfn = base; pfn < end; ++pfn) {
|
||||
const MM_PFN* entry = &gPfnDatabase[pfn];
|
||||
if (entry->State == MmPfnStateInvalid)
|
||||
continue;
|
||||
@@ -847,8 +849,15 @@ void MmPfnQueryStats(MM_PFN_STATS* out) {
|
||||
case MmPfnUseMmio: stats.MmioFrames++; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
KeReleaseSpinlock(&gPfnLock, flags);
|
||||
base = end;
|
||||
}
|
||||
|
||||
uintptr_t flags = KeAcquireSpinlock(&gPfnLock);
|
||||
stats.TotalFrames = (uint64_t)gTotalFrames;
|
||||
stats.FreeFrames = (uint64_t)gFreeFrames;
|
||||
stats.UsedFrames = stats.TotalFrames - stats.FreeFrames;
|
||||
stats.AvailableFrames = stats.FreeFrames + stats.ReclaimableFrames;
|
||||
|
||||
stats.AllocationCount = gPfnAllocations;
|
||||
|
||||
Reference in new issue
Block a user