comparison packages/hal/common/current/tests/cache.c @ 20:5f5102441818 ecos-sw-1999-07-02

Merge from eCos master repository on 1999-07-02-23:17:07-BST
author jlarmour
date Fri, 02 Jul 1999 15:44:37 +0000
parents d3fbcdfa1b2f
children a0774359f013
comparison
equal deleted inserted replaced
19:154303061551 20:5f5102441818
39 39
40 #include <cyg/infra/testcase.h> 40 #include <cyg/infra/testcase.h>
41 41
42 #include <cyg/hal/hal_cache.h> 42 #include <cyg/hal/hal_cache.h>
43 #include <cyg/hal/hal_intr.h> 43 #include <cyg/hal/hal_intr.h>
44 #include <cyg/infra/diag.h>
44 45
45 // ------------------------------------------------------------------------- 46 // -------------------------------------------------------------------------
46 // If the HAL does not supply this, we supply our own version 47 // If the HAL does not supply this, we supply our own version
47 48
48 #ifdef HAL_DCACHE_SYNC 49 #ifdef HAL_DCACHE_SYNC
79 // ------------------------------------------------------------------------- 80 // -------------------------------------------------------------------------
80 81
81 static void time0(register cyg_uint32 stride) 82 static void time0(register cyg_uint32 stride)
82 { 83 {
83 register cyg_uint32 j,k; 84 register cyg_uint32 j,k;
84 // cyg_tick_count_t count0, count1;
85 // cyg_ucount32 t;
86 register char c; 85 register char c;
87 86
88 // count0 = current_time(); 87 diag_printf("stride=%d\n", stride);
88
89 k = 0; 89 k = 0;
90 if ( cyg_test_is_simulator ) 90 if ( cyg_test_is_simulator )
91 k = 3960; 91 k = 3960;
92 92
93 for(; k<4000;k++) { 93 for(; k<4000;k++) {
94 for(j=0; j<(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); j++) { 94 for(j=0; j<(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); j++) {
95 c=m[stride*j]; 95 c=m[stride*j];
96 } 96 }
97 } 97 }
98
99 // count1 = current_time();
100 // t = count1 - count0;
101 // diag_printf("stride=%d, time=%d\n", stride, t);
102 } 98 }
103 99
104 // ------------------------------------------------------------------------- 100 // -------------------------------------------------------------------------
105 101
106 void time1(void) 102 void time1(void)