]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/common/include/private/iot_static_memory.h
Remove the FreeRTOS-IoT-Libraries from FreeRTOS-Plus as it was an old copy with a...
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-IoT-Libraries / c_sdk / standard / common / include / private / iot_static_memory.h
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/common/include/private/iot_static_memory.h b/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/common/include/private/iot_static_memory.h
deleted file mode 100644 (file)
index 76fe2b3..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*\r
- * Amazon FreeRTOS Common V1.0.0\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
- * http://aws.amazon.com/freertos\r
- * http://www.FreeRTOS.org\r
- */\r
-\r
-/**\r
- * @file iot_static_memory.h\r
- * @brief Common functions for managing static buffers. Only used when\r
- * @ref IOT_STATIC_MEMORY_ONLY is `1`.\r
- */\r
-\r
-/* The config header is always included first. */\r
-#include "iot_config.h"\r
-\r
-/* The functions in this file should only exist in static memory only mode, hence\r
- * the check for IOT_STATIC_MEMORY_ONLY in the double inclusion guard. */\r
-#if !defined( IOT_STATIC_MEMORY_H_ ) && ( IOT_STATIC_MEMORY_ONLY == 1 )\r
-#define IOT_STATIC_MEMORY_H_\r
-\r
-/* Standard includes. */\r
-#include <stdbool.h>\r
-#include <stddef.h>\r
-#include <stdint.h>\r
-\r
-/**\r
- * @functionspage{static_memory,static memory component}\r
- * - @functionname{static_memory_function_init}\r
- * - @functionname{static_memory_function_cleanup}\r
- * - @functionname{static_memory_function_findfree}\r
- * - @functionname{static_memory_function_returninuse}\r
- * - @functionname{static_memory_function_messagebuffersize}\r
- * - @functionname{static_memory_function_mallocmessagebuffer}\r
- * - @functionname{static_memory_function_freemessagebuffer}\r
- */\r
-\r
-/*----------------------- Initialization and cleanup ------------------------*/\r
-\r
-/**\r
- * @functionpage{IotStaticMemory_Init,static_memory,init}\r
- * @functionpage{IotStaticMemory_Cleanup,static_memory,cleanup}\r
- */\r
-\r
-/**\r
- * @brief One-time initialization function for static memory.\r
- *\r
- * This function performs internal setup of static memory. <b>It must be called\r
- * once (and only once) before calling any other static memory function.</b>\r
- * Calling this function more than once without first calling\r
- * @ref static_memory_function_cleanup may result in a crash.\r
- *\r
- * @return `true` if initialization succeeded; `false` otherwise.\r
- *\r
- * @attention This function is called by `IotSdk_Init` and does not need to be\r
- * called by itself.\r
- *\r
- * @warning No thread-safety guarantees are provided for this function.\r
- *\r
- * @see static_memory_function_cleanup\r
- */\r
-/* @[declare_static_memory_init] */\r
-bool IotStaticMemory_Init( void );\r
-/* @[declare_static_memory_init] */\r
-\r
-/**\r
- * @brief One-time deinitialization function for static memory.\r
- *\r
- * This function frees resources taken in @ref static_memory_function_init.\r
- * It should be called after to clean up static memory. After this function\r
- * returns, @ref static_memory_function_init must be called again before\r
- * calling any other static memory function.\r
- *\r
- * @attention This function is called by `IotSdk_Cleanup` and does not need\r
- * to be called by itself.\r
- *\r
- * @warning No thread-safety guarantees are provided for this function.\r
- *\r
- * @see static_memory_function_init\r
- */\r
-/* @[declare_static_memory_cleanup] */\r
-void IotStaticMemory_Cleanup( void );\r
-/* @[declare_static_memory_cleanup] */\r
-\r
-/*------------------------- Buffer allocation and free ----------------------*/\r
-\r
-/**\r
- * @functionpage{IotStaticMemory_FindFree,static_memory,findfree}\r
- * @functionpage{IotStaticMemory_ReturnInUse,static_memory,returninuse}\r
- */\r
-\r
-/**\r
- * @brief Find a free buffer using the "in-use" flags.\r
- *\r
- * If a free buffer is found, this function marks the buffer in-use. This function\r
- * is common to the static memory implementation.\r
- *\r
- * @param[in] pInUse The "in-use" flags to search.\r
- * @param[in] limit How many flags to check, i.e. the size of `pInUse`.\r
- *\r
- * @return The index of a free buffer; `-1` if no free buffers are available.\r
- *\r
- * <b>Example</b>:\r
- * @code{c}\r
- * // To use this function, first declare two arrays. One provides the statically-allocated\r
- * // objects, the other provides flags to determine which objects are in-use.\r
- * #define NUMBER_OF_OBJECTS    ...\r
- * #define OBJECT_SIZE          ...\r
- * static bool _pInUseObjects[ NUMBER_OF_OBJECTS ] = { 0 };\r
- * static uint8_t _pObjects[ NUMBER_OF_OBJECTS ][ OBJECT_SIZE ] = { { 0 } }; // Placeholder for objects.\r
- *\r
- * // The function to statically allocate objects. Must have the same signature\r
- * // as malloc().\r
- * void * Iot_MallocObject( size_t size )\r
- * {\r
- *     int32_t freeIndex = -1;\r
- *     void * pNewObject = NULL;\r
- *\r
- *     // Check that sizes match. \r
- *     if( size != OBJECT_SIZE )\r
- *     {\r
- *         // Get the index of a free object.\r
- *         freeIndex = IotStaticMemory_FindFree( _pInUseMessageBuffers,\r
- *                                               IOT_MESSAGE_BUFFERS );\r
- *\r
- *         if( freeIndex != -1 )\r
- *         {\r
- *             pNewBuffer = &( _pMessageBuffers[ freeIndex ][ 0 ] );\r
- *         }\r
- *     }\r
- *\r
- *     return pNewBuffer;\r
- * }\r
- * @endcode\r
- */\r
-/* @[declare_static_memory_findfree] */\r
-int32_t IotStaticMemory_FindFree( bool * pInUse,\r
-                                  size_t limit );\r
-/* @[declare_static_memory_findfree] */\r
-\r
-/**\r
- * @brief Return an "in-use" buffer.\r
- *\r
- * This function is common to the static memory implementation.\r
- *\r
- * @param[in] ptr Pointer to the buffer to return.\r
- * @param[in] pPool The pool of buffers that the in-use buffer was allocated from.\r
- * @param[in] pInUse The "in-use" flags for pPool.\r
- * @param[in] limit How many buffers (and flags) to check while searching for ptr.\r
- * @param[in] elementSize The size of a single element in pPool.\r
- *\r
- * <b>Example</b>:\r
- * @code{c}\r
- * // To use this function, first declare two arrays. One provides the statically-allocated\r
- * // objects, the other provides flags to determine which objects are in-use.\r
- * #define NUMBER_OF_OBJECTS    ...\r
- * #define OBJECT_SIZE          ...\r
- * static bool _pInUseObjects[ NUMBER_OF_OBJECTS ] = { 0 };\r
- * static uint8_t _pObjects[ NUMBER_OF_OBJECTS ][ OBJECT_SIZE ] = { { 0 } }; // Placeholder for objects.\r
- *\r
- * // The function to free statically-allocated objects. Must have the same signature\r
- * // as free().\r
- * void Iot_FreeObject( void * ptr )\r
- * {\r
- *     IotStaticMemory_ReturnInUse( ptr,\r
- *                                 _pObjects,\r
- *                                 _pInUseObjects,\r
- *                                 NUMBER_OF_OBJECTS,\r
- *                                 OBJECT_SIZE );\r
- * }\r
- * @endcode\r
- */\r
-/* @[declare_static_memory_returninuse] */\r
-void IotStaticMemory_ReturnInUse( void * ptr,\r
-                                  void * pPool,\r
-                                  bool * pInUse,\r
-                                  size_t limit,\r
-                                  size_t elementSize );\r
-/* @[declare_static_memory_returninuse] */\r
-\r
-/*------------------------ Message buffer management ------------------------*/\r
-\r
-/**\r
- * @functionpage{Iot_MessageBufferSize,static_memory,messagebuffersize}\r
- * @functionpage{Iot_MallocMessageBuffer,static_memory,mallocmessagebuffer}\r
- * @functionpage{Iot_FreeMessageBuffer,static_memory,freemessagebuffer}\r
- */\r
-\r
-/**\r
- * @brief Get the fixed size of a message buffer.\r
- *\r
- * The size of the message buffers are known at compile time, but it is a [constant]\r
- * (@ref IOT_MESSAGE_BUFFER_SIZE) that may not be visible to all source files.\r
- * This function allows other source files to know the size of a message buffer.\r
- *\r
- * @return The size, in bytes, of a single message buffer.\r
- */\r
-/* @[declare_static_memory_messagebuffersize] */\r
-size_t Iot_MessageBufferSize( void );\r
-/* @[declare_static_memory_messagebuffersize] */\r
-\r
-/**\r
- * @brief Get an empty message buffer.\r
- *\r
- * This function is the analog of [malloc]\r
- * (http://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html)\r
- * for message buffers.\r
- *\r
- * @param[in] size Requested size for a message buffer.\r
- *\r
- * @return Pointer to the start of a message buffer. If the `size` argument is larger\r
- * than the [fixed size of a message buffer](@ref IOT_MESSAGE_BUFFER_SIZE)\r
- * or no message buffers are available, `NULL` is returned.\r
- */\r
-/* @[declare_static_memory_mallocmessagebuffer] */\r
-void * Iot_MallocMessageBuffer( size_t size );\r
-/* @[declare_static_memory_mallocmessagebuffer] */\r
-\r
-/**\r
- * @brief Free an in-use message buffer.\r
- *\r
- * This function is the analog of [free]\r
- * (http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html)\r
- * for message buffers.\r
- *\r
- * @param[in] ptr Pointer to the message buffer to free.\r
- */\r
-/* @[declare_static_memory_freemessagebuffer] */\r
-void Iot_FreeMessageBuffer( void * ptr );\r
-/* @[declare_static_memory_freemessagebuffer] */\r
\r
-#endif /* if !defined( IOT_STATIC_MEMORY_H_ ) && ( IOT_STATIC_MEMORY_ONLY == 1 ) */\r