Skip to content

Commit 39f705e

Browse files
committed
[Nuvoton] Fix crypto_misc.cpp compile error with RTOS-absent
Replace Mutex with PlatformMutex which supports RTOS-absent
1 parent 388076d commit 39f705e

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@
1919
#include "mbed_assert.h"
2020
#include "mbed_critical.h"
2121
#include "mbed_error.h"
22+
#if defined(MBED_CONF_RTOS_PRESENT) && MBED_CONF_RTOS_PRESENT
2223
#include "cmsis_os2.h"
24+
#endif
2325
#include <string.h>
2426
#include <limits.h>
2527
#include "nu_modutil.h"
2628
#include "nu_bitutil.h"
2729
#include "crypto-misc.h"
28-
#include "SingletonPtr.h"
29-
#include "Mutex.h"
30+
#include "platform/SingletonPtr.h"
31+
#include "platform/PlatformMutex.h"
3032

3133
/* Consideration for choosing proper synchronization mechanism
3234
*
@@ -45,13 +47,13 @@
4547
*/
4648

4749
/* Mutex for crypto AES AC management */
48-
static SingletonPtr<rtos::Mutex> crypto_aes_mutex;
50+
static SingletonPtr<PlatformMutex> crypto_aes_mutex;
4951

5052
/* Mutex for crypto DES AC management */
51-
static SingletonPtr<rtos::Mutex> crypto_des_mutex;
53+
static SingletonPtr<PlatformMutex> crypto_des_mutex;
5254

5355
/* Mutex for crypto ECC AC management */
54-
static SingletonPtr<rtos::Mutex> crypto_ecc_mutex;
56+
static SingletonPtr<PlatformMutex> crypto_ecc_mutex;
5557

5658
/* Atomic flag for crypto SHA AC management */
5759
static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT;

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@
1919
#include "mbed_assert.h"
2020
#include "mbed_critical.h"
2121
#include "mbed_error.h"
22+
#if defined(MBED_CONF_RTOS_PRESENT) && MBED_CONF_RTOS_PRESENT
2223
#include "cmsis_os2.h"
24+
#endif
2325
#include <string.h>
2426
#include <limits.h>
2527
#include "nu_modutil.h"
2628
#include "nu_bitutil.h"
2729
#include "crypto-misc.h"
28-
#include "SingletonPtr.h"
29-
#include "Mutex.h"
30+
#include "platform/SingletonPtr.h"
31+
#include "platform/PlatformMutex.h"
3032

3133
/* Consideration for choosing proper synchronization mechanism
3234
*
@@ -43,12 +45,12 @@
4345
* (2) No biting CPU
4446
* Same reason as above.
4547
*/
46-
48+
4749
/* Mutex for crypto AES AC management */
48-
static SingletonPtr<rtos::Mutex> crypto_aes_mutex;
50+
static SingletonPtr<PlatformMutex> crypto_aes_mutex;
4951

5052
/* Mutex for crypto DES AC management */
51-
static SingletonPtr<rtos::Mutex> crypto_des_mutex;
53+
static SingletonPtr<PlatformMutex> crypto_des_mutex;
5254

5355
/* Atomic flag for crypto SHA AC management */
5456
static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT;

0 commit comments

Comments
 (0)