mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Add up_addrenv_coherent which will be called before address environment switches
This commit is contained in:
@@ -661,6 +661,56 @@ int up_addrenv_restore(FAR const save_addrenv_t *oldenv)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_addrenv_coherent
|
||||
*
|
||||
* Description:
|
||||
* Flush D-Cache and invalidate I-Cache in preparation for a change in
|
||||
* address environments. This should immediately precede a call to
|
||||
* up_addrenv_select();
|
||||
*
|
||||
* Input Parameters:
|
||||
* addrenv - Describes the address environment to be made coherent.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_coherent(FAR const group_addrenv_t *addrenv)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
int i;
|
||||
|
||||
bvdbg("addrenv=%p\n", addrenv);
|
||||
DEBUGASSERT(addrenv);
|
||||
|
||||
/* Invalidate I-Cache */
|
||||
|
||||
cp15_invalidate_icache();
|
||||
|
||||
/* Clean D-Cache in each region. */
|
||||
|
||||
#warning REVISIT... causes crashes
|
||||
#if 0
|
||||
arch_clean_dcache(CONFIG_ARCH_TEXT_VBASE,
|
||||
CONFIG_ARCH_TEXT_VBASE +
|
||||
CONFIG_ARCH_TEXT_NPAGES * MM_PGSIZE - 1);
|
||||
|
||||
arch_clean_dcache(CONFIG_ARCH_DATA_VBASE,
|
||||
CONFIG_ARCH_DATA_VBASE +
|
||||
CONFIG_ARCH_DATA_NPAGES * MM_PGSIZE - 1);
|
||||
|
||||
#if 0 /* Not yet implemented */
|
||||
arch_clean_dcache(CONFIG_ARCH_HEAP_VBASE,
|
||||
CONFIG_ARCH_HEAP_VBASE +
|
||||
CONFIG_ARCH_HEAP_NPAGES * MM_PGSIZE - 1);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_addrenv_clone
|
||||
*
|
||||
|
||||
@@ -457,6 +457,29 @@ int up_addrenv_restore(FAR const save_addrenv_t *oldenv)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_addrenv_coherent
|
||||
*
|
||||
* Description:
|
||||
* Flush D-Cache and invalidate I-Cache in preparation for a change in
|
||||
* address environments. This should immediately precede a call to
|
||||
* up_addrenv_select();
|
||||
*
|
||||
* Input Parameters:
|
||||
* addrenv - Describes the address environment to be made coherent.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_coherent(FAR const group_addrenv_t *addrenv)
|
||||
{
|
||||
/* There are no caches */
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_addrenv_clone
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user