fix(kernel): fix kill wait-queue cleanup, RegionId tracking, ReleasePages ownership, and SwitchTo scheduler state

This commit is contained in:
2026-10-18 00:31:05 +02:00
parent 8912a944b8
commit b8c5090fe5
6 changed files with 93 additions and 19 deletions

View File

@@ -86,6 +86,21 @@ impl RegionTable {
self.regions.get_mut(id.raw() as usize).and_then(|s| s.take())
}
pub fn find_by_base(
&self,
owner: ProcessId,
base: PhysicalAddress,
) -> Option<(RegionId, &MemoryRegion)> {
for (i, slot) in self.regions.iter().enumerate() {
if let Some(region) = slot {
if region.owner() == owner && region.base() == base {
return Some((RegionId::from_raw(i as u16), region));
}
}
}
None
}
pub fn regions_for_process(&self, process: ProcessId) -> impl Iterator<Item = &MemoryRegion> {
self.regions
.iter()