clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.
This commit is contained in:
1 parent
899225f551
commit
c0ad63c27f
226 files changed
+6562
-4147
No files matched your search
+11
-10
@@ -4,6 +4,7 @@
|
||||
// but callers now get typed, reference-counted frames instead of anonymous
|
||||
// bitmap bits.
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <kernel/mm_pfn.h>
|
||||
#include <kernel/ke_spinlock.h>
|
||||
#include <kernel/ke_irql.h>
|
||||
@@ -61,12 +62,12 @@ static inline PHYSICAL_ADDRESS KiAlignDown(PHYSICAL_ADDRESS value) {
|
||||
}
|
||||
|
||||
// Returns whether a boot memory type describes RAM that the PFN database should track.
|
||||
static int KiMemoryTypeManaged(MEMORY_TYPE type) {
|
||||
static bool KiMemoryTypeManaged(MEMORY_TYPE type) {
|
||||
return type == MemoryUsable || type == MemoryBootloader || type == MemoryKernel;
|
||||
}
|
||||
|
||||
// Returns whether an allocation may consume the emergency kernel reserve.
|
||||
static int KiPfnUsageMayUseReserve(MM_PFN_USAGE usage) {
|
||||
static bool KiPfnUsageMayUseReserve(MM_PFN_USAGE usage) {
|
||||
return usage == MmPfnUseKernel ||
|
||||
usage == MmPfnUsePageTable ||
|
||||
usage == MmPfnUseDma ||
|
||||
@@ -142,11 +143,11 @@ static void KiRegisterManagedRange(PHYSICAL_ADDRESS base,
|
||||
}
|
||||
|
||||
// Returns whether the future page-replacement code may consider this frame a candidate.
|
||||
static int KiPfnEvictableLocked(const MM_PFN* entry) {
|
||||
static bool KiPfnEvictableLocked(const MM_PFN* entry) {
|
||||
if (!entry || entry->PinCount)
|
||||
return 0;
|
||||
return false;
|
||||
if (entry->State != MmPfnStateActive && entry->State != MmPfnStateStandby && entry->State != MmPfnStateModified)
|
||||
return 0;
|
||||
return false;
|
||||
return entry->Usage == MmPfnUseUser ||
|
||||
entry->Usage == MmPfnUseCleanFileCache ||
|
||||
entry->Usage == MmPfnUseImage ||
|
||||
@@ -156,18 +157,18 @@ static int KiPfnEvictableLocked(const MM_PFN* entry) {
|
||||
}
|
||||
|
||||
// Returns whether a standby frame can be counted as immediately reclaimable.
|
||||
static int KiPfnReclaimableLocked(const MM_PFN* entry) {
|
||||
static bool KiPfnReclaimableLocked(const MM_PFN* entry) {
|
||||
if (!entry || entry->PinCount || entry->MappedCount)
|
||||
return 0;
|
||||
return false;
|
||||
if (entry->State != MmPfnStateStandby || entry->RefCount != 1)
|
||||
return 0;
|
||||
return false;
|
||||
return entry->Usage == MmPfnUseCleanFileCache || entry->Usage == MmPfnUseImage;
|
||||
}
|
||||
|
||||
// Returns true when a PFN can satisfy a new allocation.
|
||||
static int KiPfnAvailableLocked(size_t pfn) {
|
||||
static bool KiPfnAvailableLocked(size_t pfn) {
|
||||
if (pfn >= gMaxPfn)
|
||||
return 0;
|
||||
return false;
|
||||
MM_PFN* entry = &gPfnDatabase[pfn];
|
||||
return entry->State == MmPfnStateFree || entry->State == MmPfnStateZeroed;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user