diff --git a/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.c b/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.c index 258bc31dbf..56011319e3 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.c +++ b/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.c @@ -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; diff --git a/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.h b/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.h index 8d2d43b9bf..ecf2993292 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.h +++ b/targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.h @@ -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