Skip to content

Commit de83cb2

Browse files
committed
[M2351] Add secure gateway functions SYS_LockReg_S/SYS_UnlockReg_S
1 parent 9906655 commit de83cb2

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,22 @@ void CLK_DisableModuleClock_S(uint32_t u32ModuleIndex)
181181
CLK_DisableModuleClock(u32ModuleIndex);
182182
}
183183

184+
__NONSECURE_ENTRY
185+
void SYS_LockReg_S(void)
186+
{
187+
/* Allow non-secure domain to lock/unlock locked registers without check.
188+
* Guard access to locked registers is done through other related secure functions. */
189+
SYS_LockReg();
190+
}
191+
192+
__NONSECURE_ENTRY
193+
void SYS_UnlockReg_S(void)
194+
{
195+
/* Allow non-secure domain to lock/unlock locked registers without check.
196+
* Guard access to locked registers is done through other related secure functions. */
197+
SYS_UnlockReg();
198+
}
199+
184200
static bool check_mod_ns(int modclass, uint32_t modidx)
185201
{
186202
const nu_modidx_ns_t *modidx_ns = modidx_ns_tab;

targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ void CLK_EnableModuleClock_S(uint32_t u32ModuleIndex);
5151
*/
5252
void CLK_DisableModuleClock_S(uint32_t u32ModuleIndex);
5353

54+
/* Secure SYS_LockReg
55+
*
56+
* Guard access to secure module from non-secure domain before SYS_LockReg.
57+
* Its synopsis is the same as SYS_LockReg.
58+
*/
59+
void SYS_LockReg_S(void);
60+
61+
/* Secure SYS_UnlockReg
62+
*
63+
* Guard access to secure module from non-secure domain before SYS_UnlockReg.
64+
* Its synopsis is the same as SYS_UnlockReg.
65+
*/
66+
void SYS_UnlockReg_S(void);
67+
5468
#ifdef __cplusplus
5569
}
5670
#endif

0 commit comments

Comments
 (0)