2 * FreeRTOS Kernel V10.3.0
\r
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 * this software and associated documentation files (the "Software"), to deal in
\r
7 * the Software without restriction, including without limitation the rights to
\r
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 * subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 * http://www.FreeRTOS.org
\r
23 * http://aws.amazon.com/freertos
\r
25 * 1 tab == 4 spaces!
\r
28 #include "FreeRTOSConfig.h"
\r
29 //#include "ISR_Support.h"
\r
31 .extern ulRegTest1Counter
\r
32 .extern ulRegTest2Counter
\r
42 /*-----------------------------------------------------------*/
\r
46 /* Set initial values into the general purpose registers.
\r
47 * a0 = return address, a1 = stack pointer. */
\r
48 #ifdef __XTENSA_WINDOWED_ABI__
\r
50 s32i a0, a1, 0 /* Save return address. */
\r
53 s32i a0, a1, 0 /* Save return address. */
\r
54 s32i a12, a1, 4 /* Save callee-saved regs if call0 ABI. */
\r
67 movi a10, 0x99999999
\r
68 movi a11, 0xaaaaaaaa
\r
69 movi a12, 0xbbbbbbbb
\r
70 movi a13, 0xcccccccc
\r
71 movi a14, 0xdddddddd
\r
72 movi a15, 0xeeeeeeee
\r
76 /* Loop checking the values originally loaded into the general purpose
\r
77 * registers remain through the life of the task. */
\r
79 bne a0, a2, _RegTest1Error
\r
81 bne a0, a3, _RegTest1Error
\r
83 bne a0, a4, _RegTest1Error
\r
85 bne a0, a5, _RegTest1Error
\r
87 bne a0, a6, _RegTest1Error
\r
89 bne a0, a7, _RegTest1Error
\r
91 bne a0, a8, _RegTest1Error
\r
93 bne a0, a9, _RegTest1Error
\r
95 bne a0, a10, _RegTest1Error
\r
97 bne a0, a11, _RegTest1Error
\r
99 bne a0, a12, _RegTest1Error
\r
100 movi a0, 0xcccccccc
\r
101 bne a0, a13, _RegTest1Error
\r
102 movi a0, 0xdddddddd
\r
103 bne a0, a14, _RegTest1Error
\r
104 movi a0, 0xeeeeeeee
\r
105 bne a0, a15, _RegTest1Error
\r
107 /* Incrememnt the loop counter to prove this task has not gone into the
\r
108 * error null loop. */
\r
110 movi a2, ulRegTest1Counter
\r
126 /*-----------------------------------------------------------*/
\r
130 /* Set initial values into the general purpose registers.
\r
131 * a0 = return address, a1 = stack pointer. */
\r
132 #ifdef __XTENSA_WINDOWED_ABI__
\r
134 s32i a0, a1, 0 /* Save return address. */
\r
137 s32i a0, a1, 0 /* Save return address. */
\r
138 s32i a12, a1, 4 /* Save callee-saved regs if call0 ABI. */
\r
146 movi a2, 0x01010101
\r
147 movi a3, 0x02020202
\r
148 movi a4, 0x03030303
\r
149 movi a5, 0x04040404
\r
150 movi a6, 0x05050505
\r
151 movi a7, 0x06060606
\r
152 movi a8, 0x07070707
\r
153 movi a9, 0x08080808
\r
154 movi a10, 0x09090909
\r
155 movi a11, 0x0a0a0a0a
\r
156 movi a12, 0x0b0b0b0b
\r
157 movi a13, 0x0c0c0c0c
\r
158 movi a14, 0x0d0d0d0d
\r
159 movi a15, 0x0e0e0e0e
\r
163 /* Loop checking the values originally loaded into the general purpose
\r
164 * registers remain through the life of the task. */
\r
165 movi a0, 0x01010101
\r
166 bne a0, a2, _RegTest1Error
\r
167 movi a0, 0x02020202
\r
168 bne a0, a3, _RegTest1Error
\r
169 movi a0, 0x03030303
\r
170 bne a0, a4, _RegTest1Error
\r
171 movi a0, 0x04040404
\r
172 bne a0, a5, _RegTest1Error
\r
173 movi a0, 0x05050505
\r
174 bne a0, a6, _RegTest1Error
\r
175 movi a0, 0x06060606
\r
176 bne a0, a7, _RegTest1Error
\r
177 movi a0, 0x07070707
\r
178 bne a0, a8, _RegTest1Error
\r
179 movi a0, 0x08080808
\r
180 bne a0, a9, _RegTest1Error
\r
181 movi a0, 0x09090909
\r
182 bne a0, a10, _RegTest1Error
\r
183 movi a0, 0x0a0a0a0a
\r
184 bne a0, a11, _RegTest1Error
\r
185 movi a0, 0x0b0b0b0b
\r
186 bne a0, a12, _RegTest1Error
\r
187 movi a0, 0x0c0c0c0c
\r
188 bne a0, a13, _RegTest1Error
\r
189 movi a0, 0x0d0d0d0d
\r
190 bne a0, a14, _RegTest1Error
\r
191 movi a0, 0x0e0e0e0e
\r
192 bne a0, a15, _RegTest1Error
\r
194 /* Force a yield from one of the reg test tasks to increase coverage.
\r
195 * IMPORTANT: this call will trash some number of registers. Branch
\r
196 * to _ReInit to set things up again. */
\r
197 #ifdef __XTENSA_WINDOWED_ABI__
\r
203 /* Increment the loop counter to prove this task has not gone into the
\r
204 * error null loop. */
\r
206 movi a2, ulRegTest2Counter
\r
213 j _ReInit /* See comments above about not using j _RegTest2Loop. */
\r