arch/addrenv: Add utility function to wipe one page

up_addrenv_page_wipe can be used to wipe a single page of memory.
This commit is contained in:
Ville Juven 2024-02-01 14:59:10 +02:00 committed by Xiang Xiao
parent 8562dd5796
commit 15f19c32ac
2 changed files with 40 additions and 1 deletions

View File

@ -147,6 +147,26 @@ bool up_addrenv_user_vaddr(uintptr_t vaddr)
return riscv_uservaddr(vaddr);
}
/****************************************************************************
* Name: up_addrenv_page_wipe
*
* Description:
* Wipe a page of physical memory, first mapping it into kernel virtual
* memory.
*
* Input Parameters:
* page - The page physical address.
*
* Returned Value:
* None.
*
****************************************************************************/
void up_addrenv_page_wipe(uintptr_t page)
{
riscv_pgwipe(page);
}
#ifdef CONFIG_MM_KMAP
/****************************************************************************

View File

@ -1378,7 +1378,7 @@ uintptr_t up_addrenv_page_vaddr(uintptr_t page);
* vaddr - The virtual address.
*
* Returned Value:
* True if it is; false if it's not
* True if it is; false if it's not.
*
****************************************************************************/
@ -1386,6 +1386,25 @@ uintptr_t up_addrenv_page_vaddr(uintptr_t page);
bool up_addrenv_user_vaddr(uintptr_t vaddr);
#endif
/****************************************************************************
* Name: up_addrenv_page_wipe
*
* Description:
* Wipe a page of physical memory, first mapping it into kernel virtual
* memory.
*
* Input Parameters:
* page - The page physical address.
*
* Returned Value:
* None.
*
****************************************************************************/
#ifdef CONFIG_ARCH_ADDRENV
void up_addrenv_page_wipe(uintptr_t page);
#endif
/****************************************************************************
* Name: up_addrenv_kmap_init
*