newlib-freertos.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * FreeRTOS Kernel V11.1.0
  3. * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * SPDX-License-Identifier: MIT
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  8. * this software and associated documentation files (the "Software"), to deal in
  9. * the Software without restriction, including without limitation the rights to
  10. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  11. * the Software, and to permit persons to whom the Software is furnished to do so,
  12. * subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in all
  15. * copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  19. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  20. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  21. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * https://www.FreeRTOS.org
  25. * https://github.com/FreeRTOS
  26. *
  27. */
  28. #ifndef INC_NEWLIB_FREERTOS_H
  29. #define INC_NEWLIB_FREERTOS_H
  30. /* Note Newlib support has been included by popular demand, but is not
  31. * used by the FreeRTOS maintainers themselves. FreeRTOS is not
  32. * responsible for resulting newlib operation. User must be familiar with
  33. * newlib and must provide system-wide implementations of the necessary
  34. * stubs. Be warned that (at the time of writing) the current newlib design
  35. * implements a system-wide malloc() that must be provided with locks.
  36. *
  37. * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
  38. * for additional information. */
  39. #include <reent.h>
  40. #define configUSE_C_RUNTIME_TLS_SUPPORT 1
  41. #ifndef configTLS_BLOCK_TYPE
  42. #define configTLS_BLOCK_TYPE struct _reent
  43. #endif
  44. #ifndef configINIT_TLS_BLOCK
  45. #define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) _REENT_INIT_PTR( &( xTLSBlock ) )
  46. #endif
  47. #ifndef configSET_TLS_BLOCK
  48. #define configSET_TLS_BLOCK( xTLSBlock ) ( _impure_ptr = &( xTLSBlock ) )
  49. #endif
  50. #ifndef configDEINIT_TLS_BLOCK
  51. #define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
  52. #endif
  53. #endif /* INC_NEWLIB_FREERTOS_H */