1 /* 2 * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #pragma once 7 8 #include "freertos/FreeRTOS.h" 9 #include "freertos/semphr.h" 10 11 typedef struct mbedtls_threading_mutex_t { 12 SemaphoreHandle_t mutex; 13 /* is_valid is 0 after a failed init or a free, and nonzero after a 14 * successful init. This field is not considered part of the public 15 * API of Mbed TLS and may change without notice. */ 16 char is_valid; 17 } mbedtls_threading_mutex_t; 18 19 extern void mbedtls_threading_set_alt(void (*mutex_init)(mbedtls_threading_mutex_t *), 20 void (*mutex_free)(mbedtls_threading_mutex_t *), 21 int (*mutex_lock)(mbedtls_threading_mutex_t *), 22 int (*mutex_unlock)(mbedtls_threading_mutex_t *)); 23