source: rtems/testsuites/sptests/sp19/inttest.h @ 828049cb

5
Last change on this file since 828049cb was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 4.7 KB
Line 
1/*
2 *  This include file contains the CPU dependent implementation
3 *  of the following routines needed to test RTEMS floating
4 *  point support:
5 *           INTEGER_load( &context )
6 *           INTEGER_check( &context )
7 *
8 *  INTEGER_load   - loads the specified floating point context
9 *  INTEGER_check  - checks the specified floating point context
10 *
11 *  NOTE:  These routines are VERY CPU dependent and are thus
12 *         located in in the CPU dependent include file
13 *         inttest.h.  These routines form the core of the
14 *         floating point context switch test.
15 *
16 *  COPYRIGHT (c) 1989-2011.
17 *  On-Line Applications Research Corporation (OAR).
18 *
19 *  The license and distribution terms for this file may be
20 *  found in the file LICENSE in this distribution or at
21 *  http://www.rtems.org/license/LICENSE.
22 */
23
24
25#ifndef __INTEGER_TEST_h
26#define __INTEGER_TEST_h
27
28#include <stdio.h>
29#define REG_VARIABLE uint32_t
30
31#define INTEGER_DECLARE \
32    REG_VARIABLE int01 = 1; \
33    REG_VARIABLE int02 = 2; \
34    REG_VARIABLE int03 = 3; \
35    REG_VARIABLE int04 = 4; \
36    REG_VARIABLE int05 = 5; \
37    REG_VARIABLE int06 = 6; \
38    REG_VARIABLE int07 = 7; \
39    REG_VARIABLE int08 = 8; \
40    REG_VARIABLE int09 = 9; \
41    REG_VARIABLE int10 = 10; \
42    REG_VARIABLE int11 = 11; \
43    REG_VARIABLE int12 = 12; \
44    REG_VARIABLE int13 = 13; \
45    REG_VARIABLE int14 = 14; \
46    REG_VARIABLE int15 = 15; \
47    REG_VARIABLE int16 = 16; \
48    REG_VARIABLE int17 = 17; \
49    REG_VARIABLE int18 = 18; \
50    REG_VARIABLE int19 = 19; \
51    REG_VARIABLE int20 = 20; \
52    REG_VARIABLE int21 = 21; \
53    REG_VARIABLE int22 = 22; \
54    REG_VARIABLE int23 = 23; \
55    REG_VARIABLE int24 = 24; \
56    REG_VARIABLE int25 = 25; \
57    REG_VARIABLE int26 = 26; \
58    REG_VARIABLE int27 = 27; \
59    REG_VARIABLE int28 = 28; \
60    REG_VARIABLE int29 = 29; \
61    REG_VARIABLE int30 = 30; \
62    REG_VARIABLE int31 = 31; \
63    REG_VARIABLE int32 = 32
64
65#define INTEGER_LOAD( _factor ) \
66  do {                \
67    int01  += _factor; \
68    int02  += _factor; \
69    int03  += _factor; \
70    int04  += _factor; \
71    int05  += _factor; \
72    int06  += _factor; \
73    int07  += _factor; \
74    int08  += _factor; \
75    int09  += _factor; \
76    int10  += _factor; \
77    int11  += _factor; \
78    int12  += _factor; \
79    int13  += _factor; \
80    int14  += _factor; \
81    int15  += _factor; \
82    int16  += _factor; \
83    int17  += _factor; \
84    int18  += _factor; \
85    int19  += _factor; \
86    int20  += _factor; \
87    int21  += _factor; \
88    int22  += _factor; \
89    int23  += _factor; \
90    int24  += _factor; \
91    int25  += _factor; \
92    int26  += _factor; \
93    int27  += _factor; \
94    int28  += _factor; \
95    int29  += _factor; \
96    int30  += _factor; \
97    int31  += _factor; \
98    int32  += _factor; \
99  } while (0)
100
101#define INTEGER_CHECK_ONE( _v, _base, _factor ) \
102  if ( (_v) != ((_base) + (_factor)) )  { \
103    printf( \
104      "%" PRIu32 ": " #_v " wrong -- (0x%" PRIx32 " not 0x%" PRIx32 ")\n", \
105      task_index, \
106      (_v), \
107      (_base + _factor) \
108    ); \
109  }
110
111
112#define INTEGER_CHECK( _factor ) \
113    do { \
114      INTEGER_CHECK_ONE( int01,  1, (_factor) ); \
115      INTEGER_CHECK_ONE( int02,  2, (_factor) ); \
116      INTEGER_CHECK_ONE( int03,  3, (_factor) ); \
117      INTEGER_CHECK_ONE( int04,  4, (_factor) ); \
118      INTEGER_CHECK_ONE( int05,  5, (_factor) ); \
119      INTEGER_CHECK_ONE( int06,  6, (_factor) ); \
120      INTEGER_CHECK_ONE( int07,  7, (_factor) ); \
121      INTEGER_CHECK_ONE( int08,  8, (_factor) ); \
122      INTEGER_CHECK_ONE( int09,  9, (_factor) ); \
123      INTEGER_CHECK_ONE( int10, 10, (_factor) ); \
124      INTEGER_CHECK_ONE( int11, 11, (_factor) ); \
125      INTEGER_CHECK_ONE( int12, 12, (_factor) ); \
126      INTEGER_CHECK_ONE( int13, 13, (_factor) ); \
127      INTEGER_CHECK_ONE( int14, 14, (_factor) ); \
128      INTEGER_CHECK_ONE( int15, 15, (_factor) ); \
129      INTEGER_CHECK_ONE( int16, 16, (_factor) ); \
130      INTEGER_CHECK_ONE( int17, 17, (_factor) ); \
131      INTEGER_CHECK_ONE( int18, 18, (_factor) ); \
132      INTEGER_CHECK_ONE( int19, 19, (_factor) ); \
133      INTEGER_CHECK_ONE( int20, 20, (_factor) ); \
134      INTEGER_CHECK_ONE( int21, 21, (_factor) ); \
135      INTEGER_CHECK_ONE( int22, 22, (_factor) ); \
136      INTEGER_CHECK_ONE( int23, 23, (_factor) ); \
137      INTEGER_CHECK_ONE( int24, 24, (_factor) ); \
138      INTEGER_CHECK_ONE( int25, 25, (_factor) ); \
139      INTEGER_CHECK_ONE( int26, 26, (_factor) ); \
140      INTEGER_CHECK_ONE( int27, 27, (_factor) ); \
141      INTEGER_CHECK_ONE( int28, 28, (_factor) ); \
142      INTEGER_CHECK_ONE( int29, 29, (_factor) ); \
143      INTEGER_CHECK_ONE( int30, 30, (_factor) ); \
144      INTEGER_CHECK_ONE( int31, 31, (_factor) ); \
145      INTEGER_CHECK_ONE( int32, 32, (_factor) ); \
146    } while (0)
147
148#endif
Note: See TracBrowser for help on using the repository browser.