2 * FreeRTOS Kernel V10.0.0
\r
3 * Copyright (C) 2017 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. If you wish to use our Amazon
\r
14 * FreeRTOS name, please do so in a fair use way that does not cause confusion.
\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 * http://www.FreeRTOS.org
\r
24 * http://aws.amazon.com/freertos
\r
26 * 1 tab == 4 spaces!
\r
29 PUBLIC vRegTest1Implementation
\r
30 PUBLIC vRegTest2Implementation
\r
31 EXTERN ulRegTest1LoopCounter
\r
32 EXTERN ulRegTest2LoopCounter
\r
34 SECTION intvec:CODE:ROOT(2)
\r
37 /* This function is explained in the comments at the top of main-full.c. */
\r
38 vRegTest1Implementation:
\r
40 /* Fill each general purpose register with a known value. */
\r
57 /* Fill each FPU register with a known value. */
\r
75 /* Loop, checking each iteration that each register still contains the
\r
78 /* Yield to increase test coverage */
\r
81 /* Check all the VFP registers still contain the values set above.
\r
82 First save registers that are clobbered by the test. */
\r
87 bne reg1_error_loopf
\r
89 bne reg1_error_loopf
\r
92 bne reg1_error_loopf
\r
94 bne reg1_error_loopf
\r
97 bne reg1_error_loopf
\r
99 bne reg1_error_loopf
\r
102 bne reg1_error_loopf
\r
104 bne reg1_error_loopf
\r
107 bne reg1_error_loopf
\r
109 bne reg1_error_loopf
\r
112 bne reg1_error_loopf
\r
114 bne reg1_error_loopf
\r
117 bne reg1_error_loopf
\r
119 bne reg1_error_loopf
\r
122 bne reg1_error_loopf
\r
124 bne reg1_error_loopf
\r
127 bne reg1_error_loopf
\r
129 bne reg1_error_loopf
\r
132 bne reg1_error_loopf
\r
134 bne reg1_error_loopf
\r
137 bne reg1_error_loopf
\r
139 bne reg1_error_loopf
\r
142 bne reg1_error_loopf
\r
144 bne reg1_error_loopf
\r
147 bne reg1_error_loopf
\r
149 bne reg1_error_loopf
\r
152 bne reg1_error_loopf
\r
154 bne reg1_error_loopf
\r
157 bne reg1_error_loopf
\r
159 bne reg1_error_loopf
\r
162 bne reg1_error_loopf
\r
164 bne reg1_error_loopf
\r
167 /* Restore the registers that were clobbered by the test. */
\r
170 /* VFP register test passed. Jump to the core register test. */
\r
174 /* If this line is hit then a VFP register value was found to be
\r
180 /* Test each general purpose register to check that it still contains the
\r
181 expected known value, jumping to reg1_error_loop if any register contains
\r
182 an unexpected value. */
\r
184 bne reg1_error_loop
\r
186 bne reg1_error_loop
\r
188 bne reg1_error_loop
\r
190 bne reg1_error_loop
\r
192 bne reg1_error_loop
\r
194 bne reg1_error_loop
\r
196 bne reg1_error_loop
\r
198 bne reg1_error_loop
\r
200 bne reg1_error_loop
\r
202 bne reg1_error_loop
\r
204 bne reg1_error_loop
\r
206 bne reg1_error_loop
\r
208 bne reg1_error_loop
\r
210 bne reg1_error_loop
\r
212 /* Everything passed, increment the loop counter. */
\r
214 ldr r0, =ulRegTest1LoopCounter
\r
224 /* If this line is hit then there was an error in a core register value.
\r
225 The loop ensures the loop counter stops incrementing. */
\r
229 /*-----------------------------------------------------------*/
\r
231 vRegTest2Implementation:
\r
233 /* Put a known value in each register. */
\r
234 mov r0, #0xFF000000
\r
235 mov r1, #0x11000000
\r
236 mov r2, #0x22000000
\r
237 mov r3, #0x33000000
\r
238 mov r4, #0x44000000
\r
239 mov r5, #0x55000000
\r
240 mov r6, #0x66000000
\r
241 mov r7, #0x77000000
\r
242 mov r8, #0x88000000
\r
243 mov r9, #0x99000000
\r
244 mov r10, #0xAA000000
\r
245 mov r11, #0xBB000000
\r
246 mov r12, #0xCC000000
\r
247 mov r14, #0xEE000000
\r
249 /* Likewise the floating point registers */
\r
267 /* Loop, checking each iteration that each register still contains the
\r
270 /* Check all the VFP registers still contain the values set above.
\r
271 First save registers that are clobbered by the test. */
\r
275 cmp r0, #0xFF000000
\r
276 bne reg2_error_loopf
\r
277 cmp r1, #0x11000000
\r
278 bne reg2_error_loopf
\r
280 cmp r0, #0x22000000
\r
281 bne reg2_error_loopf
\r
282 cmp r1, #0x33000000
\r
283 bne reg2_error_loopf
\r
285 cmp r0, #0x44000000
\r
286 bne reg2_error_loopf
\r
287 cmp r1, #0x55000000
\r
288 bne reg2_error_loopf
\r
290 cmp r0, #0x66000000
\r
291 bne reg2_error_loopf
\r
292 cmp r1, #0x77000000
\r
293 bne reg2_error_loopf
\r
295 cmp r0, #0x88000000
\r
296 bne reg2_error_loopf
\r
297 cmp r1, #0x99000000
\r
298 bne reg2_error_loopf
\r
300 cmp r0, #0xAA000000
\r
301 bne reg2_error_loopf
\r
302 cmp r1, #0xBB000000
\r
303 bne reg2_error_loopf
\r
305 cmp r0, #0xFF000000
\r
306 bne reg2_error_loopf
\r
307 cmp r1, #0x11000000
\r
308 bne reg2_error_loopf
\r
310 cmp r0, #0x22000000
\r
311 bne reg2_error_loopf
\r
312 cmp r1, #0x33000000
\r
313 bne reg2_error_loopf
\r
315 cmp r0, #0x44000000
\r
316 bne reg2_error_loopf
\r
317 cmp r1, #0x55000000
\r
318 bne reg2_error_loopf
\r
320 cmp r0, #0x66000000
\r
321 bne reg2_error_loopf
\r
322 cmp r1, #0x77000000
\r
323 bne reg2_error_loopf
\r
325 cmp r0, #0x88000000
\r
326 bne reg2_error_loopf
\r
327 cmp r1, #0x99000000
\r
328 bne reg2_error_loopf
\r
330 cmp r0, #0xAA000000
\r
331 bne reg2_error_loopf
\r
332 cmp r1, #0xBB000000
\r
333 bne reg2_error_loopf
\r
335 cmp r0, #0xFF000000
\r
336 bne reg2_error_loopf
\r
337 cmp r1, #0x11000000
\r
338 bne reg2_error_loopf
\r
340 cmp r0, #0x22000000
\r
341 bne reg2_error_loopf
\r
342 cmp r1, #0x33000000
\r
343 bne reg2_error_loopf
\r
345 cmp r0, #0x44000000
\r
346 bne reg2_error_loopf
\r
347 cmp r1, #0x55000000
\r
348 bne reg2_error_loopf
\r
350 cmp r0, #0x66000000
\r
351 bne reg2_error_loopf
\r
352 cmp r1, #0x77000000
\r
353 bne reg2_error_loopf
\r
355 /* Restore the registers that were clobbered by the test. */
\r
358 /* VFP register test passed. Jump to the core register test. */
\r
362 /* If this line is hit then a VFP register value was found to be
\r
368 cmp r0, #0xFF000000
\r
369 bne reg2_error_loop
\r
370 cmp r1, #0x11000000
\r
371 bne reg2_error_loop
\r
372 cmp r2, #0x22000000
\r
373 bne reg2_error_loop
\r
374 cmp r3, #0x33000000
\r
375 bne reg2_error_loop
\r
376 cmp r4, #0x44000000
\r
377 bne reg2_error_loop
\r
378 cmp r5, #0x55000000
\r
379 bne reg2_error_loop
\r
380 cmp r6, #0x66000000
\r
381 bne reg2_error_loop
\r
382 cmp r7, #0x77000000
\r
383 bne reg2_error_loop
\r
384 cmp r8, #0x88000000
\r
385 bne reg2_error_loop
\r
386 cmp r9, #0x99000000
\r
387 bne reg2_error_loop
\r
388 cmp r10, #0xAA000000
\r
389 bne reg2_error_loop
\r
390 cmp r11, #0xBB000000
\r
391 bne reg2_error_loop
\r
392 cmp r12, #0xCC000000
\r
393 bne reg2_error_loop
\r
394 cmp r14, #0xEE000000
\r
395 bne reg2_error_loop
\r
397 /* Everything passed, increment the loop counter. */
\r
399 ldr r0, =ulRegTest2LoopCounter
\r
409 /* If this line is hit then there was an error in a core register value.
\r
410 The loop ensures the loop counter stops incrementing. */
\r