portasm.src 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. ;/*
  2. ; * FreeRTOS Kernel V10.4.6
  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. .import _pxCurrentTCB
  29. .import _vTaskSwitchContext
  30. .import _xTaskIncrementTick
  31. .export _vPortStartFirstTask
  32. .export _ulPortGetGBR
  33. .export _vPortYieldHandler
  34. .export _vPortPreemptiveTick
  35. .export _vPortCooperativeTick
  36. .export _vPortSaveFlopRegisters
  37. .export _vPortRestoreFlopRegisters
  38. .section P
  39. .INCLUDE "ISR_Support.inc"
  40. _vPortStartFirstTask:
  41. portRESTORE_CONTEXT
  42. ;-----------------------------------------------------------
  43. _vPortYieldHandler:
  44. portSAVE_CONTEXT
  45. mov.l #_vTaskSwitchContext, r0
  46. jsr @r0
  47. nop
  48. portRESTORE_CONTEXT
  49. ;-----------------------------------------------------------
  50. _vPortPreemptiveTick
  51. portSAVE_CONTEXT
  52. mov.l #_xTaskIncrementTick, r0
  53. jsr @r0
  54. nop
  55. mov.l #_vTaskSwitchContext, r0
  56. jsr @r0
  57. nop
  58. portRESTORE_CONTEXT
  59. ;-----------------------------------------------------------
  60. _vPortCooperativeTick
  61. portSAVE_CONTEXT
  62. mov.l #_xTaskIncrementTick, r0
  63. jsr @r0
  64. nop
  65. portRESTORE_CONTEXT
  66. ;-----------------------------------------------------------
  67. _ulPortGetGBR:
  68. stc.l gbr, r0
  69. rts
  70. nop
  71. ;-----------------------------------------------------------
  72. _vPortSaveFlopRegisters:
  73. fmov.s fr0, @-r4
  74. fmov.s fr1, @-r4
  75. fmov.s fr2, @-r4
  76. fmov.s fr3, @-r4
  77. fmov.s fr4, @-r4
  78. fmov.s fr5, @-r4
  79. fmov.s fr6, @-r4
  80. fmov.s fr7, @-r4
  81. fmov.s fr8, @-r4
  82. fmov.s fr9, @-r4
  83. fmov.s fr10, @-r4
  84. fmov.s fr11, @-r4
  85. fmov.s fr12, @-r4
  86. fmov.s fr13, @-r4
  87. fmov.s fr14, @-r4
  88. fmov.s fr15, @-r4
  89. sts.l fpul, @-r4
  90. sts.l fpscr, @-r4
  91. rts
  92. nop
  93. ;-----------------------------------------------------------
  94. _vPortRestoreFlopRegisters:
  95. add.l #-72, r4
  96. lds.l @r4+, fpscr
  97. lds.l @r4+, fpul
  98. fmov.s @r4+, fr15
  99. fmov.s @r4+, fr14
  100. fmov.s @r4+, fr13
  101. fmov.s @r4+, fr12
  102. fmov.s @r4+, fr11
  103. fmov.s @r4+, fr10
  104. fmov.s @r4+, fr9
  105. fmov.s @r4+, fr8
  106. fmov.s @r4+, fr7
  107. fmov.s @r4+, fr6
  108. fmov.s @r4+, fr5
  109. fmov.s @r4+, fr4
  110. fmov.s @r4+, fr3
  111. fmov.s @r4+, fr2
  112. fmov.s @r4+, fr1
  113. fmov.s @r4+, fr0
  114. rts
  115. nop
  116. .end