Changeset e1d7bf0 in rtems
- Timestamp:
- Feb 26, 2014, 10:08:31 AM (6 years ago)
- Branches:
- 4.11, master
- Children:
- 80186ca8
- Parents:
- e7549ff4
- git-author:
- Sebastian Huber <sebastian.huber@…> (02/26/14 10:08:31)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (02/28/14 08:06:16)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libcpu/shared/src/cache_manager.c
re7549ff4 re1d7bf0 161 161 162 162 163 size_t 164 rtems_cache_get_data_cache_size( uint32_t level ) 165 { 166 #if defined(CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS) 167 return _CPU_cache_get_data_cache_size( level ); 168 #else 169 return 0; 170 #endif 171 } 172 163 173 /* 164 174 * This function freezes the data cache; cache lines … … 276 286 277 287 288 size_t 289 rtems_cache_get_instruction_cache_size( uint32_t level ) 290 { 291 #if defined(CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS) 292 return _CPU_cache_get_instruction_cache_size( level ); 293 #else 294 return 0; 295 #endif 296 } 297 298 278 299 /* 279 300 * This function freezes the instruction cache; cache lines -
cpukit/rtems/include/rtems/rtems/cache.h
re7549ff4 re1d7bf0 60 60 */ 61 61 size_t rtems_cache_get_instruction_line_size( void ); 62 63 /** 64 * @brief Returns the data cache size in bytes. 65 * 66 * @param[in] level The cache level of interest. The cache level zero 67 * specifies the entire data cache. 68 * 69 * @returns The data cache size in bytes of the specified level. 70 */ 71 size_t rtems_cache_get_data_cache_size( uint32_t level ); 72 73 /** 74 * @brief Returns the instruction cache size in bytes. 75 * 76 * @param[in] level The cache level of interest. The cache level zero 77 * specifies the entire instruction cache. 78 * 79 * @returns The instruction cache size in bytes of the specified level. 80 */ 81 size_t rtems_cache_get_instruction_cache_size( uint32_t level ); 62 82 63 83 /** -
testsuites/sptests/spcache01/init.c
re7549ff4 re1d7bf0 164 164 size_t data_size = sizeof(data); 165 165 uint64_t d[3]; 166 167 printf( 168 "data cache line size %zi bytes\n", 169 rtems_cache_get_data_line_size() 170 ); 166 uint32_t cache_level; 167 size_t cache_size; 168 169 printf( 170 "data cache line size %zi bytes\n" 171 "data cache size %zi bytes\n", 172 rtems_cache_get_data_line_size(), 173 rtems_cache_get_data_cache_size(0) 174 ); 175 176 cache_level = 1; 177 cache_size = rtems_cache_get_data_cache_size(cache_level); 178 while (cache_size > 0) { 179 printf( 180 "data cache level %" PRIu32 " size %zi bytes\n", 181 cache_level, 182 cache_size 183 ); 184 ++cache_level; 185 cache_size = rtems_cache_get_data_cache_size(cache_level); 186 } 171 187 172 188 rtems_interrupt_lock_acquire(&lock, level); … … 291 307 292 308 printf( 293 "instruction cache line size %zi bytes\n", 294 rtems_cache_get_instruction_line_size() 295 ); 309 "instruction cache line size %zi bytes\n" 310 "instruction cache size %zi bytes\n", 311 rtems_cache_get_instruction_line_size(), 312 rtems_cache_get_instruction_cache_size(0) 313 ); 314 315 cache_level = 1; 316 cache_size = rtems_cache_get_instruction_cache_size(cache_level); 317 while (cache_size > 0) { 318 printf( 319 "instruction cache level %" PRIu32 " size %zi bytes\n", 320 cache_level, 321 cache_size 322 ); 323 ++cache_level; 324 cache_size = rtems_cache_get_instruction_cache_size(cache_level); 325 } 296 326 297 327 rtems_interrupt_lock_acquire(&lock, level); -
testsuites/sptests/spcache01/spcache01.scn
re7549ff4 re1d7bf0 4 4 data cache operations by line passed the test (copy-back cache detected) 5 5 data cache line size 32 bytes 6 data cache size 262144 bytes 7 data cache level 1 size 32768 bytes 8 data cache level 2 size 262144 bytes 6 9 load 4096 bytes with flush entire data 7 10 duration with normal cache 12660 ns … … 29 32 duration with invalidated cache 2640 ns 30 33 instruction cache line size 32 bytes 34 instruction cache size 262144 bytes 35 instruction cache level 1 size 32768 bytes 36 instruction cache level 2 size 262144 bytes 31 37 invalidate entire instruction 32 38 duration with normal cache 5780 ns
Note: See TracChangeset
for help on using the changeset viewer.