fixes wrong return value of page_map(), fixes #2y
This commit is contained in:
parent
0192f70338
commit
90937daeb5
1 changed files with 7 additions and 3 deletions
|
@ -129,6 +129,7 @@ int page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
out:
|
out:
|
||||||
if (bits & PG_USER)
|
if (bits & PG_USER)
|
||||||
spinlock_irqsave_unlock(¤t_task->page_lock);
|
spinlock_irqsave_unlock(¤t_task->page_lock);
|
||||||
|
@ -155,6 +156,7 @@ int page_unmap(size_t viraddr, size_t npages)
|
||||||
spinlock_irqsave_unlock(¤t_task->page_lock);
|
spinlock_irqsave_unlock(¤t_task->page_lock);
|
||||||
spinlock_unlock(&kslock);
|
spinlock_unlock(&kslock);
|
||||||
|
|
||||||
|
/* This can't fail because we don't make checks here */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +181,8 @@ int page_map_drop()
|
||||||
traverse(PAGE_LEVELS-1, 0);
|
traverse(PAGE_LEVELS-1, 0);
|
||||||
|
|
||||||
spinlock_irqsave_unlock(¤t_task->page_lock);
|
spinlock_irqsave_unlock(¤t_task->page_lock);
|
||||||
|
|
||||||
|
/* This can't fail because we don't make checks here */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,8 +226,9 @@ int page_map_copy(task_t *dest)
|
||||||
other[PAGE_LEVELS-1][PAGE_MAP_ENTRIES-1] = dest->page_map | PG_PRESENT | PG_SELF | PG_RW;
|
other[PAGE_LEVELS-1][PAGE_MAP_ENTRIES-1] = dest->page_map | PG_PRESENT | PG_SELF | PG_RW;
|
||||||
self [PAGE_LEVELS-1][PAGE_MAP_ENTRIES-2] = 0;
|
self [PAGE_LEVELS-1][PAGE_MAP_ENTRIES-2] = 0;
|
||||||
spinlock_irqsave_unlock(¤t_task->page_lock);
|
spinlock_irqsave_unlock(¤t_task->page_lock);
|
||||||
|
|
||||||
flush_tlb(); /* Flush TLB entries of 'other' self-reference */
|
/* Flush TLB entries of 'other' self-reference */
|
||||||
|
flush_tlb();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue