Fix crypto_misc.cpp compile error with RTOS-absent

Replace Mutex with PlatformMutex which supports RTOS-absent
pull/9370/head
ccli8 2018-12-24 10:57:41 +08:00 committed by adbridge
parent fd0ff1f454
commit 8eef60421f
2 changed files with 14 additions and 10 deletions

View File

@ -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 <string.h>
#include <limits.h>
#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<rtos::Mutex> crypto_aes_mutex;
static SingletonPtr<PlatformMutex> crypto_aes_mutex;
/* Mutex for crypto DES AC management */
static SingletonPtr<rtos::Mutex> crypto_des_mutex;
static SingletonPtr<PlatformMutex> crypto_des_mutex;
/* Mutex for crypto ECC AC management */
static SingletonPtr<rtos::Mutex> crypto_ecc_mutex;
static SingletonPtr<PlatformMutex> crypto_ecc_mutex;
/* Atomic flag for crypto SHA AC management */
static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT;

View File

@ -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 <string.h>
#include <limits.h>
#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<rtos::Mutex> crypto_aes_mutex;
static SingletonPtr<PlatformMutex> crypto_aes_mutex;
/* Mutex for crypto DES AC management */
static SingletonPtr<rtos::Mutex> crypto_des_mutex;
static SingletonPtr<PlatformMutex> crypto_des_mutex;
/* Atomic flag for crypto SHA AC management */
static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT;