]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/RegTest.s
Update version number in readiness for V10.2.0 release.
[freertos] / FreeRTOS / Demo / CORTEX_M0_STM32F0518_IAR / RegTest.s
1 /*\r
2  * FreeRTOS Kernel V10.2.0\r
3  * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\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
11  *\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
14  *\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
21  *\r
22  * http://www.FreeRTOS.org\r
23  * http://aws.amazon.com/freertos\r
24  *\r
25  * 1 tab == 4 spaces!\r
26  */\r
27 \r
28         RSEG    CODE:CODE(2)\r
29         thumb\r
30 \r
31         EXTERN ulRegTest1LoopCounter\r
32         EXTERN ulRegTest2LoopCounter\r
33 \r
34         PUBLIC vRegTest1Task\r
35         PUBLIC vRegTest2Task\r
36 \r
37 /*-----------------------------------------------------------*/\r
38 vRegTest1Task\r
39 \r
40         /* Fill the core registers with known values.  This is only done once. */\r
41         movs r1, #101\r
42         movs r2, #102\r
43         movs r3, #103\r
44         movs r4, #104\r
45         movs r5, #105\r
46         movs r6, #106\r
47         movs r7, #107\r
48         movs r0, #108\r
49         mov      r8, r0\r
50         movs r0, #109\r
51         mov  r9, r0\r
52         movs r0, #110\r
53         mov      r10, r0\r
54         movs r0, #111\r
55         mov      r11, r0\r
56         movs r0, #112\r
57         mov  r12, r0\r
58         movs r0, #100\r
59 \r
60 reg1_loop\r
61         /* Repeatedly check that each register still contains the value written to\r
62         it when the task started. */\r
63         cmp     r0, #100\r
64         bne     reg1_error_loop\r
65         cmp     r1, #101\r
66         bne     reg1_error_loop\r
67         cmp     r2, #102\r
68         bne     reg1_error_loop\r
69         cmp r3, #103\r
70         bne     reg1_error_loop\r
71         cmp     r4, #104\r
72         bne     reg1_error_loop\r
73         cmp     r5, #105\r
74         bne     reg1_error_loop\r
75         cmp     r6, #106\r
76         bne     reg1_error_loop\r
77         cmp     r7, #107\r
78         bne     reg1_error_loop\r
79         movs r0, #108\r
80         cmp     r8, r0\r
81         bne     reg1_error_loop\r
82         movs r0, #109\r
83         cmp     r9, r0\r
84         bne     reg1_error_loop\r
85         movs r0, #110\r
86         cmp     r10, r0\r
87         bne     reg1_error_loop\r
88         movs r0, #111\r
89         cmp     r11, r0\r
90         bne     reg1_error_loop\r
91         movs r0, #112\r
92         cmp     r12, r0\r
93         bne     reg1_error_loop\r
94 \r
95         /* Everything passed, increment the loop counter. */\r
96         push { r1 }\r
97         ldr     r0, =ulRegTest1LoopCounter\r
98         ldr r1, [r0]\r
99         adds r1, r1, #1\r
100         str r1, [r0]\r
101         pop { r1 }\r
102 \r
103         /* Start again. */\r
104         movs r0, #100\r
105         b reg1_loop\r
106 \r
107 reg1_error_loop\r
108         /* If this line is hit then there was an error in a core register value.\r
109         The loop ensures the loop counter stops incrementing. */\r
110         b reg1_error_loop\r
111         nop\r
112 \r
113 \r
114 \r
115 vRegTest2Task\r
116 \r
117         /* Fill the core registers with known values.  This is only done once. */\r
118         movs r1, #1\r
119         movs r2, #2\r
120         movs r3, #3\r
121         movs r4, #4\r
122         movs r5, #5\r
123         movs r6, #6\r
124         movs r7, #7\r
125         movs r0, #8\r
126         mov     r8, r0\r
127         movs r0, #9\r
128         mov r9, r0\r
129         movs r0, #10\r
130         mov     r10, r0\r
131         movs r0, #11\r
132         mov     r11, r0\r
133         movs r0, #12\r
134         mov r12, r0\r
135         movs r0, #10\r
136 \r
137 reg2_loop\r
138         /* Repeatedly check that each register still contains the value written to\r
139         it when the task started. */\r
140         cmp     r0, #10\r
141         bne     reg2_error_loop\r
142         cmp     r1, #1\r
143         bne     reg2_error_loop\r
144         cmp     r2, #2\r
145         bne     reg2_error_loop\r
146         cmp r3, #3\r
147         bne     reg2_error_loop\r
148         cmp     r4, #4\r
149         bne     reg2_error_loop\r
150         cmp     r5, #5\r
151         bne     reg2_error_loop\r
152         cmp     r6, #6\r
153         bne     reg2_error_loop\r
154         cmp     r7, #7\r
155         bne     reg2_error_loop\r
156         movs r0, #8\r
157         cmp     r8, r0\r
158         bne     reg2_error_loop\r
159         movs r0, #9\r
160         cmp     r9, r0\r
161         bne     reg2_error_loop\r
162         movs r0, #10\r
163         cmp     r10, r0\r
164         bne     reg2_error_loop\r
165         movs r0, #11\r
166         cmp     r11, r0\r
167         bne     reg2_error_loop\r
168         movs r0, #12\r
169         cmp     r12, r0\r
170         bne     reg2_error_loop\r
171 \r
172         /* Everything passed, increment the loop counter. */\r
173         push { r1 }\r
174         ldr     r0, =ulRegTest2LoopCounter\r
175         ldr r1, [r0]\r
176         adds r1, r1, #1\r
177         str r1, [r0]\r
178         pop { r1 }\r
179 \r
180         /* Start again. */\r
181         movs r0, #10\r
182         b reg2_loop\r
183 \r
184 reg2_error_loop\r
185         /* If this line is hit then there was an error in a core register value.\r
186         The loop ensures the loop counter stops incrementing. */\r
187         b reg2_error_loop\r
188         nop\r
189 \r
190         END\r