Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vcos_thread_attr.h 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. Copyright (c) 2012, Broadcom Europe Ltd
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. * Neither the name of the copyright holder nor the
  12. names of its contributors may be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
  18. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. /*=============================================================================
  26. VideoCore OS Abstraction Layer - thread attributes
  27. =============================================================================*/
  28. #ifndef VCOS_THREAD_ATTR_H
  29. #define VCOS_THREAD_ATTR_H
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /**
  34. * \file
  35. *
  36. * Attributes for thread creation.
  37. *
  38. */
  39. /** Initialize thread attribute struct. This call does not allocate memory,
  40. * and so cannot fail.
  41. *
  42. */
  43. VCOSPRE_ void VCOSPOST_ vcos_thread_attr_init(VCOS_THREAD_ATTR_T *attrs);
  44. /** Set the stack address and size. If not set, a stack will be allocated automatically.
  45. *
  46. * This can only be set on some platforms. It will always be possible to set the stack
  47. * address on VideoCore, but on host platforms, support may well not be available.
  48. */
  49. #if VCOS_CAN_SET_STACK_ADDR
  50. VCOS_INLINE_DECL
  51. void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attrs, void *addr, VCOS_UNSIGNED sz);
  52. #endif
  53. /** Set the stack size. If not set, a default size will be used. Attempting to call this after having
  54. * set the stack location with vcos_thread_attr_setstack() will result in undefined behaviour.
  55. */
  56. VCOS_INLINE_DECL
  57. void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED sz);
  58. /** Set the task priority. If not set, a default value will be used.
  59. */
  60. VCOS_INLINE_DECL
  61. void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED pri);
  62. /** Set the task cpu affinity. If not set, the default will be used.
  63. */
  64. VCOS_INLINE_DECL
  65. void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED aff);
  66. /** Set the timeslice. If not set the default will be used.
  67. */
  68. VCOS_INLINE_DECL
  69. void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts);
  70. /** The thread entry function takes (argc,argv), as per Nucleus, with
  71. * argc being 0. This may be withdrawn in a future release and should not
  72. * be used in new code.
  73. */
  74. VCOS_INLINE_DECL
  75. void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy);
  76. VCOS_INLINE_DECL
  77. void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart);
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif