2 ; * FreeRTOS Kernel V10.0.1
\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.
\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 EXPORT vRegTest1Implementation
\r
29 EXPORT vRegTest2Implementation
\r
31 ; This file is built with IAR and ARM compilers. When the ARM compiler
\r
32 ; is used the compiler options must define __IASMARM__ as 0 using the
\r
33 ; --predefine "__IASMARM__ SETA 0" command line option. When compiling
\r
34 ; with IAR __IASMARM__ is automatically set to 1 so no additional assembler
\r
35 ; options are required.
\r
36 SECTION .text:CODE:ROOT(2)
\r
39 ; This function is explained in the comments at the top of main-full.c.
\r
40 vRegTest1Implementation
\r
43 IMPORT ulRegTest1LoopCounter
\r
45 ; Fill each general purpose register with a known value.
\r
61 ; Fill each FPU register with a known value.
\r
79 ; Loop, checking each iteration that each register still contains the
\r
82 ; Yield to increase test coverage
\r
85 ; Check all the VFP registers still contain the values set above.
\r
86 ; First save registers that are clobbered by the test.
\r
91 bne reg1_error_loopf
\r
93 bne reg1_error_loopf
\r
96 bne reg1_error_loopf
\r
98 bne reg1_error_loopf
\r
101 bne reg1_error_loopf
\r
103 bne reg1_error_loopf
\r
106 bne reg1_error_loopf
\r
108 bne reg1_error_loopf
\r
111 bne reg1_error_loopf
\r
113 bne reg1_error_loopf
\r
116 bne reg1_error_loopf
\r
118 bne reg1_error_loopf
\r
121 bne reg1_error_loopf
\r
123 bne reg1_error_loopf
\r
126 bne reg1_error_loopf
\r
128 bne reg1_error_loopf
\r
131 bne reg1_error_loopf
\r
133 bne reg1_error_loopf
\r
136 bne reg1_error_loopf
\r
138 bne reg1_error_loopf
\r
141 bne reg1_error_loopf
\r
143 bne reg1_error_loopf
\r
146 bne reg1_error_loopf
\r
148 bne reg1_error_loopf
\r
151 bne reg1_error_loopf
\r
153 bne reg1_error_loopf
\r
156 bne reg1_error_loopf
\r
158 bne reg1_error_loopf
\r
161 bne reg1_error_loopf
\r
163 bne reg1_error_loopf
\r
166 bne reg1_error_loopf
\r
168 bne reg1_error_loopf
\r
170 ; Restore the registers that were clobbered by the test.
\r
173 ; VFP register test passed. Jump to the core register test.
\r
177 ; If this line is hit then a VFP register value was found to be
\r
183 ; Test each general purpose register to check that it still contains the
\r
184 ; expected known value, jumping to reg1_error_loop if any register contains
\r
185 ; an unexpected value.
\r
187 bne reg1_error_loop
\r
189 bne reg1_error_loop
\r
191 bne reg1_error_loop
\r
193 bne reg1_error_loop
\r
195 bne reg1_error_loop
\r
197 bne reg1_error_loop
\r
199 bne reg1_error_loop
\r
201 bne reg1_error_loop
\r
203 bne reg1_error_loop
\r
205 bne reg1_error_loop
\r
207 bne reg1_error_loop
\r
209 bne reg1_error_loop
\r
211 bne reg1_error_loop
\r
213 bne reg1_error_loop
\r
215 ; Everything passed, increment the loop counter.
\r
217 ldr r0, =ulRegTest1LoopCounter
\r
227 ; If this line is hit then there was an error in a core register value.
\r
228 ; The loop ensures the loop counter stops incrementing.
\r
232 ;/*-----------------------------------------------------------*/
\r
234 vRegTest2Implementation
\r
237 IMPORT ulRegTest2LoopCounter
\r
239 ; Put a known value in each register.
\r
240 mov r0, #0xFF000000
\r
241 mov r1, #0x11000000
\r
242 mov r2, #0x22000000
\r
243 mov r3, #0x33000000
\r
244 mov r4, #0x44000000
\r
245 mov r5, #0x55000000
\r
246 mov r6, #0x66000000
\r
247 mov r7, #0x77000000
\r
248 mov r8, #0x88000000
\r
249 mov r9, #0x99000000
\r
250 mov r10, #0xAA000000
\r
251 mov r11, #0xBB000000
\r
252 mov r12, #0xCC000000
\r
253 mov r14, #0xEE000000
\r
255 ; Likewise the floating point registers
\r
273 ; Loop, checking each iteration that each register still contains the
\r
276 ; Check all the VFP registers still contain the values set above.
\r
277 ; First save registers that are clobbered by the test.
\r
281 cmp r0, #0xFF000000
\r
282 bne reg2_error_loopf
\r
283 cmp r1, #0x11000000
\r
284 bne reg2_error_loopf
\r
286 cmp r0, #0x22000000
\r
287 bne reg2_error_loopf
\r
288 cmp r1, #0x33000000
\r
289 bne reg2_error_loopf
\r
291 cmp r0, #0x44000000
\r
292 bne reg2_error_loopf
\r
293 cmp r1, #0x55000000
\r
294 bne reg2_error_loopf
\r
296 cmp r0, #0x66000000
\r
297 bne reg2_error_loopf
\r
298 cmp r1, #0x77000000
\r
299 bne reg2_error_loopf
\r
301 cmp r0, #0x88000000
\r
302 bne reg2_error_loopf
\r
303 cmp r1, #0x99000000
\r
304 bne reg2_error_loopf
\r
306 cmp r0, #0xAA000000
\r
307 bne reg2_error_loopf
\r
308 cmp r1, #0xBB000000
\r
309 bne reg2_error_loopf
\r
311 cmp r0, #0xFF000000
\r
312 bne reg2_error_loopf
\r
313 cmp r1, #0x11000000
\r
314 bne reg2_error_loopf
\r
316 cmp r0, #0x22000000
\r
317 bne reg2_error_loopf
\r
318 cmp r1, #0x33000000
\r
319 bne reg2_error_loopf
\r
321 cmp r0, #0x44000000
\r
322 bne reg2_error_loopf
\r
323 cmp r1, #0x55000000
\r
324 bne reg2_error_loopf
\r
326 cmp r0, #0x66000000
\r
327 bne reg2_error_loopf
\r
328 cmp r1, #0x77000000
\r
329 bne reg2_error_loopf
\r
331 cmp r0, #0x88000000
\r
332 bne reg2_error_loopf
\r
333 cmp r1, #0x99000000
\r
334 bne reg2_error_loopf
\r
336 cmp r0, #0xAA000000
\r
337 bne reg2_error_loopf
\r
338 cmp r1, #0xBB000000
\r
339 bne reg2_error_loopf
\r
341 cmp r0, #0xFF000000
\r
342 bne reg2_error_loopf
\r
343 cmp r1, #0x11000000
\r
344 bne reg2_error_loopf
\r
346 cmp r0, #0x22000000
\r
347 bne reg2_error_loopf
\r
348 cmp r1, #0x33000000
\r
349 bne reg2_error_loopf
\r
351 cmp r0, #0x44000000
\r
352 bne reg2_error_loopf
\r
353 cmp r1, #0x55000000
\r
354 bne reg2_error_loopf
\r
356 cmp r0, #0x66000000
\r
357 bne reg2_error_loopf
\r
358 cmp r1, #0x77000000
\r
359 bne reg2_error_loopf
\r
361 ; Restore the registers that were clobbered by the test.
\r
364 ; VFP register test passed. Jump to the core register test.
\r
368 ; If this line is hit then a VFP register value was found to be
\r
374 cmp r0, #0xFF000000
\r
375 bne reg2_error_loop
\r
376 cmp r1, #0x11000000
\r
377 bne reg2_error_loop
\r
378 cmp r2, #0x22000000
\r
379 bne reg2_error_loop
\r
380 cmp r3, #0x33000000
\r
381 bne reg2_error_loop
\r
382 cmp r4, #0x44000000
\r
383 bne reg2_error_loop
\r
384 cmp r5, #0x55000000
\r
385 bne reg2_error_loop
\r
386 cmp r6, #0x66000000
\r
387 bne reg2_error_loop
\r
388 cmp r7, #0x77000000
\r
389 bne reg2_error_loop
\r
390 cmp r8, #0x88000000
\r
391 bne reg2_error_loop
\r
392 cmp r9, #0x99000000
\r
393 bne reg2_error_loop
\r
394 cmp r10, #0xAA000000
\r
395 bne reg2_error_loop
\r
396 cmp r11, #0xBB000000
\r
397 bne reg2_error_loop
\r
398 cmp r12, #0xCC000000
\r
399 bne reg2_error_loop
\r
400 cmp r14, #0xEE000000
\r
401 bne reg2_error_loop
\r
403 ; Everything passed, increment the loop counter.
\r
405 ldr r0, =ulRegTest2LoopCounter
\r
415 ; If this line is hit then there was an error in a core register value.
\r
416 ; The loop ensures the loop counter stops incrementing.
\r