mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 22:18:21 +00:00
vmm: destroy context
This commit is contained in:
@@ -366,6 +366,26 @@ static void getcontextinfo(void* addr, int** lock, vmm_mapping*** start){
|
||||
|
||||
}
|
||||
|
||||
void vmm_destroy(vmm_context* ctx){
|
||||
spinlock_acquire(&ctx->lock);
|
||||
|
||||
vmm_mapping* mapping = ctx->userstart;
|
||||
|
||||
while(mapping){
|
||||
|
||||
vmm_mapping* old = mapping;
|
||||
mapping = mapping->next;
|
||||
|
||||
freeentry(old);
|
||||
|
||||
}
|
||||
|
||||
arch_mmu_destroy(ctx->context);
|
||||
|
||||
free(ctx);
|
||||
|
||||
}
|
||||
|
||||
int vmm_fork(vmm_context* oldctx, vmm_context* newctx){
|
||||
|
||||
// TODO make this copy on write
|
||||
|
||||
Reference in New Issue
Block a user