Skip to content

Commit 89d3222

Browse files
committed
[M2351] Replace __attribute__((cmse_nonsecure_entry)) with compiler agnostic __NONSECURE_ENTRY
1 parent 767e74b commit 89d3222

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/device/StdDriver/m2351_clk.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void CLK_Idle(void)
114114
*/
115115
//__NONSECURE_ENTRY_WEAK
116116
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
117-
__attribute__((cmse_nonsecure_entry))
117+
__NONSECURE_ENTRY
118118
uint32_t CLK_GetHXTFreq(void)
119119
{
120120
uint32_t u32Freq = 0UL;
@@ -142,7 +142,7 @@ uint32_t CLK_GetHXTFreq(void)
142142

143143
//__NONSECURE_ENTRY_WEAK
144144
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
145-
__attribute__((cmse_nonsecure_entry))
145+
__NONSECURE_ENTRY
146146
uint32_t CLK_GetLXTFreq(void)
147147
{
148148
uint32_t u32Freq = 0UL;
@@ -169,7 +169,7 @@ uint32_t CLK_GetLXTFreq(void)
169169

170170
//__NONSECURE_ENTRY_WEAK
171171
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
172-
__attribute__((cmse_nonsecure_entry))
172+
__NONSECURE_ENTRY
173173
uint32_t CLK_GetHCLKFreq(void)
174174
{
175175
SystemCoreClockUpdate();
@@ -186,7 +186,7 @@ uint32_t CLK_GetHCLKFreq(void)
186186

187187
//__NONSECURE_ENTRY_WEAK
188188
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
189-
__attribute__((cmse_nonsecure_entry))
189+
__NONSECURE_ENTRY
190190
uint32_t CLK_GetPCLK0Freq(void)
191191
{
192192
SystemCoreClockUpdate();
@@ -203,7 +203,7 @@ uint32_t CLK_GetPCLK0Freq(void)
203203

204204
//__NONSECURE_ENTRY_WEAK
205205
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
206-
__attribute__((cmse_nonsecure_entry))
206+
__NONSECURE_ENTRY
207207
uint32_t CLK_GetPCLK1Freq(void)
208208
{
209209
SystemCoreClockUpdate();
@@ -220,7 +220,7 @@ uint32_t CLK_GetPCLK1Freq(void)
220220

221221
//__NONSECURE_ENTRY_WEAK
222222
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
223-
__attribute__((cmse_nonsecure_entry))
223+
__NONSECURE_ENTRY
224224
uint32_t CLK_GetCPUFreq(void)
225225
{
226226
uint32_t u32Freq, u32HclkSrc, u32HclkDiv;
@@ -1080,7 +1080,7 @@ void CLK_EnableSPDWKPin(uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerTy
10801080

10811081
//__NONSECURE_ENTRY_WEAK
10821082
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1083-
__attribute__((cmse_nonsecure_entry))
1083+
__NONSECURE_ENTRY
10841084
uint32_t CLK_GetPLLClockFreq(void)
10851085
{
10861086
uint32_t u32PllFreq = 0UL, u32PllReg;
@@ -1169,7 +1169,7 @@ uint32_t CLK_GetPLLClockFreq(void)
11691169

11701170
//__NONSECURE_ENTRY_WEAK
11711171
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1172-
__attribute__((cmse_nonsecure_entry))
1172+
__NONSECURE_ENTRY
11731173
uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx)
11741174
{
11751175
uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL;
@@ -1229,7 +1229,7 @@ uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx)
12291229

12301230
//__NONSECURE_ENTRY_WEAK
12311231
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1232-
__attribute__((cmse_nonsecure_entry))
1232+
__NONSECURE_ENTRY
12331233
uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx)
12341234
{
12351235
uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL;

targets/TARGET_NUVOTON/TARGET_M2351/device/StdDriver/m2351_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void SYS_ResetCPU(void)
165165
* @details This function reset selected module.
166166
*/
167167
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
168-
__attribute__((cmse_nonsecure_entry))
168+
__NONSECURE_ENTRY
169169
void SYS_ResetModule(uint32_t u32ModuleIndex)
170170
{
171171
uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL;

targets/TARGET_NUVOTON/TARGET_M2351/device/m2351_stddriver_sup.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static const nu_modidx_ns_t modidx_ns_tab[] = {
133133
*/
134134
static bool check_mod_ns(int modclass, uint32_t modidx);
135135

136-
__attribute__((cmse_nonsecure_entry))
136+
__NONSECURE_ENTRY
137137
void SYS_ResetModule_S(uint32_t u32ModuleIndex)
138138
{
139139
/* Guard access to secure module from non-secure domain */
@@ -145,7 +145,7 @@ void SYS_ResetModule_S(uint32_t u32ModuleIndex)
145145
SYS_ResetModule(u32ModuleIndex);
146146
}
147147

148-
__attribute__((cmse_nonsecure_entry))
148+
__NONSECURE_ENTRY
149149
void CLK_SetModuleClock_S(uint32_t u32ModuleIndex, uint32_t u32ClkSrc, uint32_t u32ClkDiv)
150150
{
151151
/* Guard access to secure module from non-secure domain */
@@ -157,7 +157,7 @@ void CLK_SetModuleClock_S(uint32_t u32ModuleIndex, uint32_t u32ClkSrc, uint32_t
157157
CLK_SetModuleClock(u32ModuleIndex, u32ClkSrc, u32ClkDiv);
158158
}
159159

160-
__attribute__((cmse_nonsecure_entry))
160+
__NONSECURE_ENTRY
161161
void CLK_EnableModuleClock_S(uint32_t u32ModuleIndex)
162162
{
163163
/* Guard access to secure module from non-secure domain */
@@ -169,7 +169,7 @@ void CLK_EnableModuleClock_S(uint32_t u32ModuleIndex)
169169
CLK_EnableModuleClock(u32ModuleIndex);
170170
}
171171

172-
__attribute__((cmse_nonsecure_entry))
172+
__NONSECURE_ENTRY
173173
void CLK_DisableModuleClock_S(uint32_t u32ModuleIndex)
174174
{
175175
/* Guard access to secure module from non-secure domain */

targets/TARGET_NUVOTON/TARGET_M2351/pinmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727

2828
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
29-
__attribute__((cmse_nonsecure_entry))
29+
__NONSECURE_ENTRY
3030
void pin_function(PinName pin, int data)
3131
{
3232
MBED_ASSERT(pin != (PinName)NC);

targets/TARGET_NUVOTON/TARGET_M2351/rtc_api.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
/* As of ARM Compiler 6.9, we meet some NSC functions are missing in secure gateway
3939
* import library (cmse_lib.o) in secure build. Per test, we could get around it by
4040
* adding declaration for NSC functions. */
41-
__attribute__((cmse_nonsecure_entry))
41+
__NONSECURE_ENTRY
4242
void rtc_init(void);
43-
__attribute__((cmse_nonsecure_entry))
43+
__NONSECURE_ENTRY
4444
void rtc_free(void);
45-
__attribute__((cmse_nonsecure_entry))
45+
__NONSECURE_ENTRY
4646
int rtc_isenabled(void);
47-
__attribute__((cmse_nonsecure_entry))
47+
__NONSECURE_ENTRY
4848
time_t rtc_read(void);
49-
__attribute__((cmse_nonsecure_entry))
49+
__NONSECURE_ENTRY
5050
void rtc_write(time_t t);
5151

5252
/* Micro seconds per second */
@@ -111,7 +111,7 @@ static void rtc_convert_datetime_hwrtc_to_tm(struct tm *datetime_tm, const S_RTC
111111

112112
static const struct nu_modinit_s rtc_modinit = {RTC_0, RTC_MODULE, 0, 0, 0, RTC_IRQn, NULL};
113113

114-
__attribute__((cmse_nonsecure_entry))
114+
__NONSECURE_ENTRY
115115
void rtc_init(void)
116116
{
117117
if (rtc_isenabled()) {
@@ -124,13 +124,13 @@ void rtc_init(void)
124124
rtc_write(0);
125125
}
126126

127-
__attribute__((cmse_nonsecure_entry))
127+
__NONSECURE_ENTRY
128128
void rtc_free(void)
129129
{
130130
// N/A
131131
}
132132

133-
__attribute__((cmse_nonsecure_entry))
133+
__NONSECURE_ENTRY
134134
int rtc_isenabled(void)
135135
{
136136
// NOTE: To access (RTC) registers, clock must be enabled first.
@@ -145,7 +145,7 @@ int rtc_isenabled(void)
145145
return !! (rtc_base->INIT & RTC_INIT_ACTIVE_Msk);
146146
}
147147

148-
__attribute__((cmse_nonsecure_entry))
148+
__NONSECURE_ENTRY
149149
time_t rtc_read(void)
150150
{
151151
/* NOTE: After boot, RTC time registers are not synced immediately, about 1 sec latency.
@@ -186,7 +186,7 @@ time_t rtc_read(void)
186186
return t_present;
187187
}
188188

189-
__attribute__((cmse_nonsecure_entry))
189+
__NONSECURE_ENTRY
190190
void rtc_write(time_t t)
191191
{
192192
if (! rtc_isenabled()) {

targets/TARGET_NUVOTON/TARGET_M2351/sleep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* Enter idle mode, in which just CPU is halted.
3030
*/
31-
__attribute__((cmse_nonsecure_entry))
31+
__NONSECURE_ENTRY
3232
void hal_sleep(void)
3333
{
3434
SYS_UnlockReg();
@@ -39,7 +39,7 @@ void hal_sleep(void)
3939
/**
4040
* Enter power-down mode, in which HXT/HIRC are halted.
4141
*/
42-
__attribute__((cmse_nonsecure_entry))
42+
__NONSECURE_ENTRY
4343
void hal_deepsleep(void)
4444
{
4545
SYS_UnlockReg();

0 commit comments

Comments
 (0)