2 * FreeRTOS Kernel V10.2.0
\r
3 * Copyright (C) 2019 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
29 #include "FreeRTOSConfig.h"
\r
30 #include "ISR_Support.h"
\r
32 .extern ulRegTest1Counter
\r
33 .extern ulRegTest2Counter
\r
34 .extern dRegTest1_st7
\r
35 .extern dRegTest1_st6
\r
36 .extern dRegTest1_st5
\r
37 .extern dRegTest1_st4
\r
38 .extern dRegTest1_st3
\r
39 .extern dRegTest1_st2
\r
40 .extern dRegTest1_st1
\r
41 .extern dRegTest2_st7
\r
42 .extern dRegTest2_st6
\r
43 .extern dRegTest2_st5
\r
44 .extern dRegTest2_st4
\r
45 .extern dRegTest2_st3
\r
46 .extern dRegTest2_st2
\r
47 .extern dRegTest2_st1
\r
48 .extern vGenerateYieldInterrupt
\r
49 .extern vHPETIRQHandler1
\r
53 .global vApplicationHPETTimer1Wrapper
\r
55 .section .text.last /* Push up the memory to check executing from higher memory addresses. */
\r
61 /* Set initial values into the general purpose registers. */
\r
62 movl $0x11111111, %eax
\r
63 movl $0x22222222, %ebx
\r
64 movl $0x33333333, %ecx
\r
65 movl $0x44444444, %edx
\r
66 movl $0x55555555, %esi
\r
67 movl $0x66666666, %edi
\r
69 /* Set initial values into the floating point registers. */
\r
70 .if configSUPPORT_FPU == 1
\r
78 .endif /* configSUPPORT_FPU */
\r
82 /* Loop checking the values originally loaded into the general purpose
\r
83 registers remain through the life of the task. */
\r
84 cmp $0x11111111, %eax
\r
86 cmp $0x22222222, %ebx
\r
88 cmp $0x33333333, %ecx
\r
90 cmp $0x44444444, %edx
\r
92 cmp $0x55555555, %esi
\r
94 cmp $0x66666666, %edi
\r
98 .if configSUPPORT_FPU == 1
\r
99 /* Loop checking the values originally loaded into the floating point
\r
100 registers remain through the life of the task. */
\r
101 push %eax /* push clobbered register. */
\r
102 fldl dRegTest1_st7 /* st( 0 ) set to st( 7 ) value. */
\r
103 fucomp %st( 7 ) /* Compare st( 0 ) with st( 7 ) and pop. */
\r
104 fnstsw %ax /* Copy status word to ax. */
\r
105 and $0x45, %ah /* Mask bits. */
\r
106 xor $0x40, %ah /* test bits. */
\r
145 /* Restore clobbered register. */
\r
147 .endif /* configSUPPORT_FPU */
\r
149 /* Incrememnt the loop counter to prove this task has not gone into the
\r
150 error null loop. */
\r
151 add $1, ulRegTest1Counter
\r
159 /*-----------------------------------------------------------*/
\r
164 /* Set initial values into the general purpose registers. */
\r
165 movl $0x10101010, %eax
\r
166 movl $0x20202020, %ebx
\r
167 movl $0x30303030, %ecx
\r
168 movl $0x40404040, %edx
\r
169 movl $0x50505050, %esi
\r
170 movl $0x60606060, %edi
\r
172 /* Set initial values into the floating point registers. */
\r
173 .if configSUPPORT_FPU == 1
\r
185 /* Loop checking the values originally loaded into the general purpose
\r
186 registers remain through the life of the task. */
\r
187 cmp $0x10101010, %eax
\r
189 cmp $0x20202020, %ebx
\r
191 cmp $0x30303030, %ecx
\r
193 cmp $0x40404040, %edx
\r
195 cmp $0x50505050, %esi
\r
197 cmp $0x60606060, %edi
\r
200 .if configSUPPORT_FPU == 1
\r
201 /* Loop checking the values originally loaded into the floating point
\r
202 registers remain through the life of the task. */
\r
203 /* Loop checking the values originally loaded into the floating point
\r
204 registers remain through the life of the task. */
\r
205 push %eax /* push clobbered register. */
\r
206 fldl dRegTest2_st7 /* st( 0 ) set to st( 7 ) value. */
\r
207 fucomp %st( 7 ) /* Compare st( 0 ) with st( 7 ) and pop. */
\r
208 fnstsw %ax /* Copy status word to ax. */
\r
209 and $0x45, %ah /* Mask bits. */
\r
210 xor $0x40, %ah /* test bits. */
\r
249 /* Restore clobbered register. */
\r
252 .endif /* configSUPPORT_FPU */
\r
254 /* Force a yield from one of the reg test tasks to increase coverage. */
\r
255 call vGenerateYieldInterrupt
\r
257 /* Increment the loop counter to prove this task has not entered the error
\r
259 add $1, ulRegTest2Counter
\r
267 /*-----------------------------------------------------------*/
\r
269 /* Purely for demonstration purposes, two of the HPET timers used by the
\r
270 IntQueue test use the central interrupt handler, and timer 1 uses its own
\r
271 assembly wrapper - which is defined below. See
\r
272 http://www.freertos.org/RTOS_Intel_Quark_Galileo_GCC.html#interrupts for more
\r
274 .func vApplicationHPETTimer1Wrapper
\r
275 vApplicationHPETTimer1Wrapper:
\r
277 portFREERTOS_INTERRUPT_ENTRY
\r
278 call vHPETIRQHandler1
\r
279 portFREERTOS_INTERRUPT_EXIT
\r