From 8eef60421f222000852be1b7fda03449f8189651 Mon Sep 17 00:00:00 2001 From: ccli8 Date: Mon, 24 Dec 2018 10:57:41 +0800 Subject: [PATCH] Fix crypto_misc.cpp compile error with RTOS-absent Replace Mutex with PlatformMutex which supports RTOS-absent --- .../TARGET_M480/crypto/crypto-misc.cpp | 12 +++++++----- .../TARGET_NUC472/crypto/crypto-misc.cpp | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.cpp b/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.cpp index 95f72eaea9..811715119a 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.cpp +++ b/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.cpp @@ -19,14 +19,16 @@ #include "mbed_assert.h" #include "mbed_critical.h" #include "mbed_error.h" +#if defined(MBED_CONF_RTOS_PRESENT) && MBED_CONF_RTOS_PRESENT #include "cmsis_os2.h" +#endif #include #include #include "nu_modutil.h" #include "nu_bitutil.h" #include "crypto-misc.h" -#include "SingletonPtr.h" -#include "Mutex.h" +#include "platform/SingletonPtr.h" +#include "platform/PlatformMutex.h" /* Consideration for choosing proper synchronization mechanism * @@ -45,13 +47,13 @@ */ /* Mutex for crypto AES AC management */ -static SingletonPtr crypto_aes_mutex; +static SingletonPtr crypto_aes_mutex; /* Mutex for crypto DES AC management */ -static SingletonPtr crypto_des_mutex; +static SingletonPtr crypto_des_mutex; /* Mutex for crypto ECC AC management */ -static SingletonPtr crypto_ecc_mutex; +static SingletonPtr crypto_ecc_mutex; /* Atomic flag for crypto SHA AC management */ static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT; diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.cpp b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.cpp index e44d15cf96..7f5b77cd9e 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.cpp +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.cpp @@ -19,14 +19,16 @@ #include "mbed_assert.h" #include "mbed_critical.h" #include "mbed_error.h" +#if defined(MBED_CONF_RTOS_PRESENT) && MBED_CONF_RTOS_PRESENT #include "cmsis_os2.h" +#endif #include #include #include "nu_modutil.h" #include "nu_bitutil.h" #include "crypto-misc.h" -#include "SingletonPtr.h" -#include "Mutex.h" +#include "platform/SingletonPtr.h" +#include "platform/PlatformMutex.h" /* Consideration for choosing proper synchronization mechanism * @@ -43,12 +45,12 @@ * (2) No biting CPU * Same reason as above. */ - + /* Mutex for crypto AES AC management */ -static SingletonPtr crypto_aes_mutex; +static SingletonPtr crypto_aes_mutex; /* Mutex for crypto DES AC management */ -static SingletonPtr crypto_des_mutex; +static SingletonPtr crypto_des_mutex; /* Atomic flag for crypto SHA AC management */ static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT;