]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/abstractions/mbedtls/threading_alt.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / FreeRTOS-IoT-Libraries / abstractions / mbedtls / threading_alt.h
diff --git a/FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/abstractions/mbedtls/threading_alt.h b/FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/abstractions/mbedtls/threading_alt.h
new file mode 100644 (file)
index 0000000..e8b6648
--- /dev/null
@@ -0,0 +1,44 @@
+/*\r
+ * Copyright (C) 2018 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/* mbed TLS threading functions implemented for FreeRTOS. */\r
+\r
+#ifndef MBEDTLS_THREADING_ALT_H_\r
+#define MBEDTLS_THREADING_ALT_H_\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "semphr.h"\r
+\r
+/* mbed TLS mutex type. */\r
+typedef struct mbedtls_threading_mutex\r
+{\r
+    SemaphoreHandle_t mutexHandle;\r
+    StaticSemaphore_t mutexStorage;\r
+} mbedtls_threading_mutex_t;\r
+\r
+/* mbed TLS mutex functions. */\r
+void mbedtls_platform_mutex_init( mbedtls_threading_mutex_t * pMutex );\r
+void mbedtls_platform_mutex_free( mbedtls_threading_mutex_t * pMutex );\r
+int mbedtls_platform_mutex_lock( mbedtls_threading_mutex_t * pMutex );\r
+int mbedtls_platform_mutex_unlock( mbedtls_threading_mutex_t * pMutex );\r
+\r
+#endif\r