[Zion] Remove all capabilities on process cleanup.
This commit is contained in:
parent
430dc36728
commit
e50d3f8abc
|
@ -33,3 +33,13 @@ glcr::RefPtr<Capability> CapabilityTable::ReleaseCapability(uint64_t id) {
|
||||||
(void)capabilities_.Delete(id);
|
(void)capabilities_.Delete(id);
|
||||||
return cap;
|
return cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CapabilityTable::ReleaseAll() {
|
||||||
|
for (uint64_t i = 0; i < next_cap_id_; i++) {
|
||||||
|
(void)capabilities_.Delete(i);
|
||||||
|
}
|
||||||
|
if (capabilities_.size() != 0) {
|
||||||
|
dbgln("Capabilities still remaining after clear: {x}",
|
||||||
|
capabilities_.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ class CapabilityTable {
|
||||||
glcr::RefPtr<Capability> GetCapability(uint64_t id);
|
glcr::RefPtr<Capability> GetCapability(uint64_t id);
|
||||||
glcr::RefPtr<Capability> ReleaseCapability(uint64_t id);
|
glcr::RefPtr<Capability> ReleaseCapability(uint64_t id);
|
||||||
|
|
||||||
|
void ReleaseAll();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
glcr::RefPtr<Mutex> lock_ = Mutex::Create();
|
glcr::RefPtr<Mutex> lock_ = Mutex::Create();
|
||||||
// TODO: Do some randomization.
|
// TODO: Do some randomization.
|
||||||
|
|
|
@ -98,7 +98,8 @@ void Process::Cleanup() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Release all capabailities. TODO
|
// 2. Release all capabailities.
|
||||||
|
caps_.ReleaseAll();
|
||||||
|
|
||||||
// 3. Unmap all user memory. TODO
|
// 3. Unmap all user memory. TODO
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue