OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [MSP430X_MSP430F5438_CCS4/] [Demo_Source/] [RegTest.asm] - Blame information for rev 609

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 584 jeremybenn
;
2
;    FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
3
;
4
;    ***************************************************************************
5
;    *                                                                         *
6
;    * If you are:                                                             *
7
;    *                                                                         *
8
;    *    + New to FreeRTOS,                                                   *
9
;    *    + Wanting to learn FreeRTOS or multitasking in general quickly       *
10
;    *    + Looking for basic training,                                        *
11
;    *    + Wanting to improve your FreeRTOS skills and productivity           *
12
;    *                                                                         *
13
;    * then take a look at the FreeRTOS books - available as PDF or paperback  *
14
;    *                                                                         *
15
;    *        "Using the FreeRTOS Real Time Kernel - a Practical Guide"        *
16
;    *                  http://www.FreeRTOS.org/Documentation                  *
17
;    *                                                                         *
18
;    * A pdf reference manual is also available.  Both are usually delivered   *
19
;    * to your inbox within 20 minutes to two hours when purchased between 8am *
20
;    * and 8pm GMT (although please allow up to 24 hours in case of            *
21
;    * exceptional circumstances).  Thank you for your support!                *
22
;    *                                                                         *
23
;    ***************************************************************************
24
;
25
;    This file is part of the FreeRTOS distribution.
26
;
27
;    FreeRTOS is free software; you can redistribute it and/or modify it under
28
;    the terms of the GNU General Public License (version 2) as published by the
29
;    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
30
;    ***NOTE*** The exception to the GPL is included to allow you to distribute
31
;    a combined work that includes FreeRTOS without being obliged to provide the
32
;    source code for proprietary components outside of the FreeRTOS kernel.
33
;    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
34
;    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
35
;    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
36
;    more details. You should have received a copy of the GNU General Public
37
;    License and the FreeRTOS license exception along with FreeRTOS; if not it
38
;    can be viewed here: http://www.freertos.org/a00114.html and also obtained
39
;    by writing to Richard Barry, contact details for whom are available on the
40
;    FreeRTOS WEB site.
41
;
42
;    1 tab == 4 spaces!
43
;
44
;    http://www.FreeRTOS.org - Documentation, latest information, license and
45
;    contact details.
46
;
47
;    http://www.SafeRTOS.com - A version that is certified for use in safety
48
;    critical systems.
49
;
50
;    http://www.OpenRTOS.com - Commercial support, development, porting,
51
;    licensing and training services.
52
 
53
; * The definition of the "register test" tasks, as described at the top of
54
; * main.c
55
 
56
        .include data_model.h
57
 
58
        .if $DEFINED( __LARGE_DATA_MODEL__ )
59
                .define "cmp.a", cmp_x
60
                .define "incx.w", inc_x
61
        .else
62
                .define "cmp.w", cmp_x
63
                .define "inc.w", inc_x
64
        .endif
65
 
66
 
67
        .global usRegTest1Counter
68
        .global usRegTest2Counter
69
        .global vPortYield
70
 
71
        .def vRegTest1Task
72
        .def vRegTest2Task
73
 
74
        .text
75
 
76
        .align 2
77
vRegTest1Task: .asmfunc
78
 
79
        ; Fill each general purpose register with a known value.
80
        mov_x   #0x4444, r4
81
        mov_x   #0x5555, r5
82
        mov_x   #0x6666, r6
83
        mov_x   #0x7777, r7
84
        mov_x   #0x8888, r8
85
        mov_x   #0x9999, r9
86
        mov_x   #0xaaaa, r10
87
        mov_x   #0xbbbb, r11
88
        mov_x   #0xcccc, r12
89
        mov_x   #0xdddd, r13
90
        mov_x   #0xeeee, r14
91
        mov_x   #0xffff, r15
92
 
93
prvRegTest1Loop:
94
 
95
        ; Test each general purpose register to check that it still contains the
96
        ; expected known value, jumping to vRegTest1Error if any register contains
97
        ; an unexpected value.
98
        cmp_x   #0x4444, r4
99
        jne             vRegTest1Error
100
        cmp_x   #0x5555, r5
101
        jne             vRegTest1Error
102
        cmp_x   #0x6666, r6
103
        jne             vRegTest1Error
104
        cmp_x   #0x7777, r7
105
        jne             vRegTest1Error
106
        cmp_x   #0x8888, r8
107
        jne             vRegTest1Error
108
        cmp_x   #0x9999, r9
109
        jne             vRegTest1Error
110
        cmp_x   #0xaaaa, r10
111
        jne             vRegTest1Error
112
        cmp_x   #0xbbbb, r11
113
        jne             vRegTest1Error
114
        cmp_x   #0xcccc, r12
115
        jne             vRegTest1Error
116
        cmp_x   #0xdddd, r13
117
        jne             vRegTest1Error
118
        cmp_x   #0xeeee, r14
119
        jne             vRegTest1Error
120
        cmp_x   #0xffff, r15
121
        jne             vRegTest1Error
122
 
123
        ; This task is still running without jumping to vRegTest1Error, so increment
124
        ; the loop counter so the check task knows the task is running error free.
125
        inc_x   &usRegTest1Counter
126
 
127
        ; Loop again, performing the same tests.
128
        jmp             prvRegTest1Loop
129
        nop
130
 
131
vRegTest1Error:
132
        jmp vRegTest1Error
133
        nop
134
        .endasmfunc
135
; -----------------------------------------------------------
136
 
137
; See the comments in vRegTest1Task.  This task is the same, it just uses
138
; different values in its registers.
139
        .align 2
140
vRegTest2Task: .asmfunc
141
 
142
        mov_x   #0x4441, r4
143
        mov_x   #0x5551, r5
144
        mov_x   #0x6661, r6
145
        mov_x   #0x7771, r7
146
        mov_x   #0x8881, r8
147
        mov_x   #0x9991, r9
148
        mov_x   #0xaaa1, r10
149
        mov_x   #0xbbb1, r11
150
        mov_x   #0xccc1, r12
151
        mov_x   #0xddd1, r13
152
        mov_x   #0xeee1, r14
153
        mov_x   #0xfff1, r15
154
 
155
prvRegTest2Loop:
156
 
157
        cmp_x   #0x4441, r4
158
        jne             vRegTest2Error
159
        cmp_x   #0x5551, r5
160
        jne             vRegTest2Error
161
        cmp_x   #0x6661, r6
162
        jne             vRegTest2Error
163
        cmp_x   #0x7771, r7
164
        jne             vRegTest2Error
165
        cmp_x   #0x8881, r8
166
        jne             vRegTest2Error
167
        cmp_x   #0x9991, r9
168
        jne             vRegTest2Error
169
        cmp_x   #0xaaa1, r10
170
        jne             vRegTest2Error
171
        cmp_x   #0xbbb1, r11
172
        jne             vRegTest2Error
173
        cmp_x   #0xccc1, r12
174
        jne             vRegTest2Error
175
        cmp_x   #0xddd1, r13
176
        jne             vRegTest2Error
177
        cmp_x   #0xeee1, r14
178
        jne             vRegTest2Error
179
        cmp_x   #0xfff1, r15
180
        jne             vRegTest2Error
181
 
182
        ; Also perform a manual yield, just to increase the scope of the test.
183
        call_x  #vPortYield
184
 
185
        inc_x   &usRegTest2Counter
186
        jmp             prvRegTest2Loop
187
        nop
188
 
189
 
190
vRegTest2Error:
191
        jmp vRegTest2Error
192
        nop
193
        .endasmfunc
194
; /*-----------------------------------------------------------
195
 
196
 
197
        .end
198
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.