Compare commits
1 Commits
5e99093e9f
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f3d273fe9 |
@@ -274,3 +274,25 @@ HalMmuMapSingle(MMU_VAS *Vas, UPTR Vma, UPTR Pma, USHORT Flags, MMU_PAGESIZE Pag
|
|||||||
MmuInvlpg(Vma);
|
MmuInvlpg(Vma);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ST_STATUS
|
||||||
|
HalMmuUnmapSingle(MMU_VAS *Vas, UPTR Vma, MMU_PAGESIZE PageSize)
|
||||||
|
{
|
||||||
|
UPTR *PageTable;
|
||||||
|
USHORT Index;
|
||||||
|
|
||||||
|
if (Vas == NULL) {
|
||||||
|
return STATUS_INVALID_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
PageTable = MmuExtractLevel(Vas, Vma, PAGE_LEVEL_PML1, false);
|
||||||
|
if (PageTable == NULL) {
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Unmap the page */
|
||||||
|
Index = MmuLevelIndex(Vma, PAGE_LEVEL_PML1);
|
||||||
|
PageTable[Index] = 0;
|
||||||
|
MmuInvlpg(Vma);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|||||||
@@ -63,4 +63,13 @@ ST_STATUS HalMmuMapSingle(
|
|||||||
USHORT Flags, MMU_PAGESIZE PageSize
|
USHORT Flags, MMU_PAGESIZE PageSize
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unmap a single page of memory
|
||||||
|
*
|
||||||
|
* @Vas: Virtual address space to unmap within
|
||||||
|
* @Vma: Virtual address to unmap
|
||||||
|
* @PageSize: Pagesize to unmap
|
||||||
|
*/
|
||||||
|
ST_STATUS HalMmuUnmapSingle(MMU_VAS *Vas, UPTR Vma, MMU_PAGESIZE PageSize);
|
||||||
|
|
||||||
#endif /* !_HAL_MMU_H_ */
|
#endif /* !_HAL_MMU_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user