annotate packages/hal/common/current/tests/cache.c @ 3292:7f8e529b4d82 default tip

Fix FREESCALE_EDMA_NBYTES_MLOFFYES_MLOFF() so it works with negative offsets.
author vae
date Wed, 29 Apr 2015 23:31:48 +0000
parents 6e9f1cd4ed38
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
1 /*=================================================================
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
2 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
3 // cache.c
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
4 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
5 // HAL Cache timing test
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
6 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
7 //==========================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
8 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
9 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
10 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
12 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
13 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
14 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
15 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
16 // version.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
17 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
18 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
21 // for more details.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
22 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
23 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
24 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
26 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
27 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
28 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
29 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
30 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
31 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
32 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
33 // General Public License v2.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
34 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
35 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
36 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
37 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
38 // ####ECOSGPLCOPYRIGHTEND####
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
39 //==========================================================================
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
40 //#####DESCRIPTIONBEGIN####
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
41 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
42 // Author(s): dsm
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
43 // Contributors: dsm, nickg
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
44 // Date: 1998-06-18
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
45 //####DESCRIPTIONEND####
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
46 */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
47
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
48 #include <pkgconf/hal.h>
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
49
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
50 #include <cyg/infra/testcase.h>
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
51
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
52 #include <cyg/hal/hal_cache.h>
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
53 #include <cyg/hal/hal_intr.h>
20
5f5102441818 Merge from eCos master repository on 1999-07-02-23:17:07-BST
jlarmour
parents: 10
diff changeset
54 #include <cyg/infra/diag.h>
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
55
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
56 #if defined(HAL_DCACHE_SIZE) && HAL_DCACHE_SIZE != 0
50
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
57
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
58 // -------------------------------------------------------------------------
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
59 // If the HAL does not supply this, we supply our own version
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
60
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
61 #ifndef HAL_DCACHE_PURGE_ALL
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
62
10
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
63 #ifdef HAL_DCACHE_SYNC
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
64
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
65 # define HAL_DCACHE_PURGE_ALL() HAL_DCACHE_SYNC()
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
66
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
67 #else
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
68
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
69 static cyg_uint8 dca[HAL_DCACHE_SIZE + HAL_DCACHE_LINE_SIZE*2];
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
70
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
71 #define HAL_DCACHE_PURGE_ALL() \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
72 CYG_MACRO_START \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
73 volatile cyg_uint8 *addr = &dca[HAL_DCACHE_LINE_SIZE]; \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
74 volatile cyg_uint8 tmp = 0; \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
75 int i; \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
76 for( i = 0; i < HAL_DCACHE_SIZE; i += HAL_DCACHE_LINE_SIZE ) \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
77 { \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
78 tmp = addr[i]; \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
79 } \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
80 CYG_MACRO_END
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
81
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
82 #endif // HAL_DCACHE_SYNC
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
83
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 161
diff changeset
84 #endif // HAL_DCACHE_PURGE_ALL
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
85
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
86 // -------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
87
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
88 #ifndef MAX_STRIDE
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
89 #define MAX_STRIDE 64
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
90 #endif
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
91
50
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
92 volatile char m[(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE)*MAX_STRIDE];
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
93
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
94 // -------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
95
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
96 static void time0(register cyg_uint32 stride)
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
97 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
98 register cyg_uint32 j,k;
3249
6e9f1cd4ed38 Fix compiler warning about variable set but not used. [ Bugzilla 1001865 ]
vae
parents: 2729
diff changeset
99 register char c CYGBLD_ATTRIB_UNUSED;
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
100
20
5f5102441818 Merge from eCos master repository on 1999-07-02-23:17:07-BST
jlarmour
parents: 10
diff changeset
101 diag_printf("stride=%d\n", stride);
5f5102441818 Merge from eCos master repository on 1999-07-02-23:17:07-BST
jlarmour
parents: 10
diff changeset
102
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
103 k = 0;
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
104 if ( cyg_test_is_simulator )
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
105 k = 3960;
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
106
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
107 for(; k<4000;k++) {
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
108 for(j=0; j<(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); j++) {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
109 c=m[stride*j];
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
110 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
111 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
112 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
113
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
114 // -------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
115
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
116 void time1(void)
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
117 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
118 cyg_uint32 i;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
119
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
120 for(i=1; i<=MAX_STRIDE; i+=i) {
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
121 time0(i);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
122 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
123 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
124
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
125 // -------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
126 // This test could be improved by counting number of passes possible
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
127 // in a given number of ticks.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
128
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
129 static void entry0( void )
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
130 {
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
131 register CYG_INTERRUPT_STATE oldints;
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
132
10
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
133 #ifdef HAL_CACHE_UNIFIED
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
134
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
135 HAL_DISABLE_INTERRUPTS(oldints);
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
136 HAL_DCACHE_PURGE_ALL(); // rely on above definition
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
137 HAL_UCACHE_INVALIDATE_ALL();
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
138 HAL_UCACHE_DISABLE();
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
139 HAL_RESTORE_INTERRUPTS(oldints);
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
140 CYG_TEST_INFO("Cache off");
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
141 time1();
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
142
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
143 HAL_DISABLE_INTERRUPTS(oldints);
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
144 HAL_DCACHE_PURGE_ALL(); // rely on above definition
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
145 HAL_UCACHE_INVALIDATE_ALL();
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
146 HAL_UCACHE_ENABLE();
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
147 HAL_RESTORE_INTERRUPTS(oldints);
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
148 CYG_TEST_INFO("Cache on");
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
149 time1();
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
150
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
151 #else // HAL_CACHE_UNIFIED
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
152
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
153 HAL_DISABLE_INTERRUPTS(oldints);
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
154 HAL_DCACHE_PURGE_ALL();
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
155 HAL_ICACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
156 HAL_DCACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
157 HAL_ICACHE_DISABLE();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
158 HAL_DCACHE_DISABLE();
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
159 HAL_RESTORE_INTERRUPTS(oldints);
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
160 CYG_TEST_INFO("Dcache off Icache off");
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
161 time1();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
162
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
163 HAL_DISABLE_INTERRUPTS(oldints);
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
164 HAL_DCACHE_PURGE_ALL();
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
165 HAL_ICACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
166 HAL_DCACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
167 HAL_ICACHE_DISABLE();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
168 HAL_DCACHE_ENABLE();
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
169 HAL_RESTORE_INTERRUPTS(oldints);
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
170 CYG_TEST_INFO("Dcache on Icache off");
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
171 time1();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
172
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
173 HAL_DISABLE_INTERRUPTS(oldints);
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
174 HAL_DCACHE_PURGE_ALL();
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
175 HAL_ICACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
176 HAL_DCACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
177 HAL_ICACHE_ENABLE();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
178 HAL_DCACHE_DISABLE();
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
179 HAL_RESTORE_INTERRUPTS(oldints);
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
180 CYG_TEST_INFO("Dcache off Icache on");
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
181 time1();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
182
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
183 HAL_DISABLE_INTERRUPTS(oldints);
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
184 HAL_DCACHE_PURGE_ALL();
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
185 HAL_ICACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
186 HAL_DCACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
187 HAL_ICACHE_ENABLE();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
188 HAL_DCACHE_ENABLE();
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
189 HAL_RESTORE_INTERRUPTS(oldints);
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
190 CYG_TEST_INFO("Dcache on Icache on");
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
191 time1();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
192
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
193 HAL_DISABLE_INTERRUPTS(oldints);
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
194 HAL_DCACHE_PURGE_ALL();
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
195 HAL_ICACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
196 HAL_DCACHE_INVALIDATE_ALL();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
197 HAL_ICACHE_DISABLE();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
198 HAL_DCACHE_DISABLE();
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
199 HAL_RESTORE_INTERRUPTS(oldints);
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
200 CYG_TEST_INFO("Dcache off Icache off");
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
201 time1();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
202
10
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
203 #endif // HAL_CACHE_UNIFIED
d3fbcdfa1b2f Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents: 2
diff changeset
204
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
205 CYG_TEST_PASS_FINISH("End of test");
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
206 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
207
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
208 // -------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
209
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
210 void cache_main( void )
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
211 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
212 CYG_TEST_INIT();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
213
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
214 entry0();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
215
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
216 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
217
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
218 // -------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
219
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
220 externC void
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
221 cyg_start( void )
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
222 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
223 cache_main();
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
224 }
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
225
161
ac086aa3217e Merge from eCos master repository on 2001-06-08-21:11:51-BST
jlarmour
parents: 66
diff changeset
226 #else // HAL_DCACHE_SIZE
50
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
227 #define N_A_MSG "No cache"
161
ac086aa3217e Merge from eCos master repository on 2001-06-08-21:11:51-BST
jlarmour
parents: 66
diff changeset
228 #endif // HAL_DCACHE_SIZE
50
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
229
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
230 #ifdef N_A_MSG
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
231 externC void
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
232 cyg_start( void )
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
233 {
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
234 CYG_TEST_INIT();
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
235 CYG_TEST_NA( N_A_MSG );
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
236 }
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
237 #endif // N_A_MSG
a0774359f013 Merge from eCos master repository on 1999-11-02-17:02:15-GMT
jlarmour
parents: 20
diff changeset
238
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
239 // -------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
240 /* EOF cache.c */