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_legacy_isr.h 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 - legacy (Nucleus) IRQ support
  27. =============================================================================*/
  28. #ifndef VCOS_LEGACY_ISR_H
  29. #define VCOS_LEGACY_ISR_H
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #include "vcos_types.h"
  34. #include "pthreads/vcos_platform.h"
  35. /** \file vcos_legacy_isr.h
  36. *
  37. * API for dispatching interrupts the Nucleus way, via a LISR and HISR.
  38. * New code should use the single-dispatch scheme - the LISR/HISR
  39. * distinction is not necessary.
  40. *
  41. * Under ThreadX, a HISR is implemented as a high-priority thread which
  42. * waits on a counting semaphore to call the HISR function. Although this
  43. * provides a good approximation to the Nucleus semantics, it is potentially
  44. * slow if all you are trying to do is to wake a thread from LISR context.
  45. */
  46. /** Register a LISR. This is identical to the NU_Register_LISR API.
  47. */
  48. VCOS_INLINE_DECL
  49. VCOS_STATUS_T vcos_register_legacy_lisr(VCOS_UNSIGNED vecnum,
  50. void (*lisr)(VCOS_INT),
  51. void (**old_lisr)(VCOS_INT));
  52. VCOS_INLINE_DECL
  53. VCOS_STATUS_T vcos_legacy_hisr_create(VCOS_HISR_T *hisr, const char *name,
  54. void (*entry)(void),
  55. VCOS_UNSIGNED pri,
  56. void *stack, VCOS_UNSIGNED stack_size);
  57. /** Activate a HISR. On an OS which has no distinction between a HISR and LISR,
  58. * this may use some kind of emulation, which could well be less efficient than
  59. * a normal ISR.`
  60. *
  61. * @param hisr HISR to activate.
  62. */
  63. VCOS_INLINE_DECL
  64. void vcos_legacy_hisr_activate(VCOS_HISR_T *hisr);
  65. /** Delete a HISR.
  66. *
  67. * @param hisr HISR to delete.
  68. */
  69. VCOS_INLINE_DECL
  70. void vcos_legacy_hisr_delete(VCOS_HISR_T *hisr);
  71. /** Are we in a legacy LISR?
  72. *
  73. * @return On Nucleus, non-zero if in a LISR. On other platforms, non-zero if
  74. * in an interrupt.
  75. */
  76. VCOS_INLINE_DECL
  77. int vcos_in_legacy_lisr(void);
  78. /** Is the current thread actually a fake HISR thread? Only implemented
  79. * on platforms that fake up HISRs.
  80. */
  81. #ifndef VCOS_LISRS_NEED_HISRS
  82. VCOSPRE_ int VCOSPOST_ vcos_current_thread_is_fake_hisr_thread(VCOS_HISR_T *);
  83. #endif
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif