Add secure gateway functions SYS_LockReg_S/SYS_UnlockReg_S

pull/7631/head
ccli8 2018-04-27 10:11:57 +08:00 committed by Cruz Monrreal II
parent c91f71b0dc
commit 18ce2e1b6b
2 changed files with 30 additions and 0 deletions

View File

@ -181,6 +181,22 @@ void CLK_DisableModuleClock_S(uint32_t u32ModuleIndex)
CLK_DisableModuleClock(u32ModuleIndex);
}
__NONSECURE_ENTRY
void SYS_LockReg_S(void)
{
/* Allow non-secure domain to lock/unlock locked registers without check.
* Guard access to locked registers is done through other related secure functions. */
SYS_LockReg();
}
__NONSECURE_ENTRY
void SYS_UnlockReg_S(void)
{
/* Allow non-secure domain to lock/unlock locked registers without check.
* Guard access to locked registers is done through other related secure functions. */
SYS_UnlockReg();
}
static bool check_mod_ns(int modclass, uint32_t modidx)
{
const nu_modidx_ns_t *modidx_ns = modidx_ns_tab;

View File

@ -51,6 +51,20 @@ void CLK_EnableModuleClock_S(uint32_t u32ModuleIndex);
*/
void CLK_DisableModuleClock_S(uint32_t u32ModuleIndex);
/* Secure SYS_LockReg
*
* Guard access to secure module from non-secure domain before SYS_LockReg.
* Its synopsis is the same as SYS_LockReg.
*/
void SYS_LockReg_S(void);
/* Secure SYS_UnlockReg
*
* Guard access to secure module from non-secure domain before SYS_UnlockReg.
* Its synopsis is the same as SYS_UnlockReg.
*/
void SYS_UnlockReg_S(void);
#ifdef __cplusplus
}
#endif