2 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
5 * this software and associated documentation files (the "Software"), to deal in
\r
6 * the Software without restriction, including without limitation the rights to
\r
7 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
8 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
9 * subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in all
\r
12 * copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
16 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
17 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
18 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 /* mbed TLS threading functions implemented for FreeRTOS. */
\r
24 #ifndef MBEDTLS_THREADING_ALT_H_
\r
25 #define MBEDTLS_THREADING_ALT_H_
\r
27 /* FreeRTOS includes. */
\r
28 #include "FreeRTOS.h"
\r
31 /* mbed TLS mutex type. */
\r
32 typedef struct mbedtls_threading_mutex
\r
34 SemaphoreHandle_t mutexHandle;
\r
35 StaticSemaphore_t mutexStorage;
\r
36 } mbedtls_threading_mutex_t;
\r
38 /* mbed TLS mutex functions. */
\r
39 void mbedtls_platform_mutex_init( mbedtls_threading_mutex_t * pMutex );
\r
40 void mbedtls_platform_mutex_free( mbedtls_threading_mutex_t * pMutex );
\r
41 int mbedtls_platform_mutex_lock( mbedtls_threading_mutex_t * pMutex );
\r
42 int mbedtls_platform_mutex_unlock( mbedtls_threading_mutex_t * pMutex );
\r