stos: mm: Add locking to VAD lists

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-23 22:27:05 +00:00
parent b5c2ba80f7
commit 7ce1cf27d1
3 changed files with 17 additions and 6 deletions
+5
View File
@@ -19,6 +19,7 @@ MmVadListAppend(MM_VAD_LIST *List, MM_VAD *Vad)
Vad->Next = NULL;
Vad->Prev = NULL;
KeSpinLockAcquire(&List->Lock, true);
if (List->Last == NULL || List->First == NULL) {
List->Last = Vad;
@@ -29,6 +30,8 @@ MmVadListAppend(MM_VAD_LIST *List, MM_VAD *Vad)
Last->Next = Vad;
List->Last = Vad;
}
KeSpinLockRelease(&List->Lock);
}
MM_VAD *
@@ -44,11 +47,13 @@ MmVadListPop(MM_VAD_LIST *List)
return NULL;
}
KeSpinLockAcquire(&List->Lock, true);
Last = List->Last;
if (Last->Prev != NULL) {
Last->Prev->Next = NULL;
}
List->Last = Last->Prev;
KeSpinLockRelease(&List->Lock);
return Last;
}