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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [MSP430X_MSP430F5438_IAR/] [RegTest.s43] - 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
#include "msp430.h"
54
#include "FreeRTOSConfig.h"
55
#include "data_model.h"
56
 
57
/*
58
 * The definition of the "register test" tasks, as described at the top of
59
 * main.c
60
 */
61
 
62
 
63
 
64
        IMPORT usRegTest1Counter
65
        IMPORT usRegTest2Counter
66
        IMPORT vPortYield
67
 
68
        EXPORT vRegTest1Task
69
        EXPORT vRegTest2Task
70
 
71
        RSEG CODE
72
 
73
        EVEN
74
 
75
vRegTest1Task:
76
 
77
        /* Fill each general purpose register with a known value. */
78
        mov_x   #0x4444, r4
79
        mov_x   #0x5555, r5
80
        mov_x   #0x6666, r6
81
        mov_x   #0x7777, r7
82
        mov_x   #0x8888, r8
83
        mov_x   #0x9999, r9
84
        mov_x   #0xaaaa, r10
85
        mov_x   #0xbbbb, r11
86
        mov_x   #0xcccc, r12
87
        mov_x   #0xdddd, r13
88
        mov_x   #0xeeee, r14
89
        mov_x   #0xffff, r15
90
 
91
prvRegTest1Loop:
92
 
93
        /* Test each general purpose register to check that it still contains the
94
        expected known value, jumping to vRegTest1Error if any register contains
95
        an unexpected value. */
96
        cmp_x   #0x4444, r4
97
        jne             vRegTest1Error
98
        cmp_x   #0x5555, r5
99
        jne             vRegTest1Error
100
        cmp_x   #0x6666, r6
101
        jne             vRegTest1Error
102
        cmp_x   #0x7777, r7
103
        jne             vRegTest1Error
104
        cmp_x   #0x8888, r8
105
        jne             vRegTest1Error
106
        cmp_x   #0x9999, r9
107
        jne             vRegTest1Error
108
        cmp_x   #0xaaaa, r10
109
        jne             vRegTest1Error
110
        cmp_x   #0xbbbb, r11
111
        jne             vRegTest1Error
112
        cmp_x   #0xcccc, r12
113
        jne             vRegTest1Error
114
        cmp_x   #0xdddd, r13
115
        jne             vRegTest1Error
116
        cmp_x   #0xeeee, r14
117
        jne             vRegTest1Error
118
        cmp_x   #0xffff, r15
119
        jne             vRegTest1Error
120
 
121
        /* This task is still running without jumping to vRegTest1Error, so increment
122
        the loop counter so the check task knows the task is running error free. */
123
        incx.w  &usRegTest1Counter
124
 
125
        /* Loop again, performing the same tests. */
126
        jmp             prvRegTest1Loop
127
        nop
128
 
129
 
130
        EVEN
131
 
132
vRegTest1Error:
133
        jmp vRegTest1Error
134
        nop
135
 
136
/*-----------------------------------------------------------*/
137
 
138
/* See the comments in vRegTest1Task.  This task is the same, it just uses
139
different values in its registers. */
140
vRegTest2Task:
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
        calla   #vPortYield
184
 
185
        incx.w  &usRegTest2Counter
186
        jmp             prvRegTest2Loop
187
        nop
188
 
189
 
190
vRegTest2Error:
191
        jmp vRegTest2Error
192
        nop
193
/*-----------------------------------------------------------*/
194
 
195
 
196
        END
197
 

powered by: WebSVN 2.1.0

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