Mercurial > ecos
comparison packages/kernel/current/tests/kcache1.c @ 44:41bd4f3a90de ecos-sw-1999-10-08
Merge from eCos master repository on 1999-10-08-07:47:04-BST
| author | jlarmour |
|---|---|
| date | Fri, 08 Oct 1999 13:16:25 +0000 |
| parents | 29bc183297e1 |
| children | 797268ecc331 |
comparison
equal
deleted
inserted
replaced
| 43:3e1bfbe59ff6 | 44:41bd4f3a90de |
|---|---|
| 28 //####COPYRIGHTEND#### | 28 //####COPYRIGHTEND#### |
| 29 //========================================================================== | 29 //========================================================================== |
| 30 //#####DESCRIPTIONBEGIN#### | 30 //#####DESCRIPTIONBEGIN#### |
| 31 // | 31 // |
| 32 // Author(s): dsm | 32 // Author(s): dsm |
| 33 // Contributors: dsm, nickg | 33 // Contributors: dsm, nickg |
| 34 // Date: 1998-06-18 | 34 // Date: 1998-06-18 |
| 35 //####DESCRIPTIONEND#### | 35 //####DESCRIPTIONEND#### |
| 36 */ | 36 */ |
| 37 | 37 |
| 38 #include <cyg/hal/hal_arch.h> // CYGNUM_HAL_STACK_SIZE_TYPICAL | 38 #include <cyg/hal/hal_arch.h> // CYGNUM_HAL_STACK_SIZE_TYPICAL |
| 49 #include <cyg/hal/hal_intr.h> | 49 #include <cyg/hal/hal_intr.h> |
| 50 | 50 |
| 51 // ------------------------------------------------------------------------- | 51 // ------------------------------------------------------------------------- |
| 52 // If the HAL does not supply this, we supply our own version | 52 // If the HAL does not supply this, we supply our own version |
| 53 | 53 |
| 54 #ifdef HAL_DCACHE_SYNC | 54 #ifndef HAL_DCACHE_PURGE_ALL |
| 55 | 55 # ifdef HAL_DCACHE_SYNC |
| 56 # define HAL_DCACHE_PURGE_ALL() HAL_DCACHE_SYNC() | 56 |
| 57 | 57 #define HAL_DCACHE_PURGE_ALL() HAL_DCACHE_SYNC() |
| 58 #else | 58 |
| 59 # else | |
| 59 | 60 |
| 60 static cyg_uint8 dca[HAL_DCACHE_SIZE + HAL_DCACHE_LINE_SIZE*2]; | 61 static cyg_uint8 dca[HAL_DCACHE_SIZE + HAL_DCACHE_LINE_SIZE*2]; |
| 61 | 62 |
| 62 #define HAL_DCACHE_PURGE_ALL() \ | 63 #define HAL_DCACHE_PURGE_ALL() \ |
| 63 CYG_MACRO_START \ | 64 CYG_MACRO_START \ |
| 68 { \ | 69 { \ |
| 69 tmp = addr[i]; \ | 70 tmp = addr[i]; \ |
| 70 } \ | 71 } \ |
| 71 CYG_MACRO_END | 72 CYG_MACRO_END |
| 72 | 73 |
| 74 # endif | |
| 73 #endif | 75 #endif |
| 74 | 76 |
| 75 // ------------------------------------------------------------------------- | 77 // ------------------------------------------------------------------------- |
| 76 | 78 |
| 77 #define NTHREADS 1 | 79 #define NTHREADS 1 |
| 80 static cyg_handle_t thread[NTHREADS]; | 82 static cyg_handle_t thread[NTHREADS]; |
| 81 | 83 |
| 82 static cyg_thread thread_obj[NTHREADS]; | 84 static cyg_thread thread_obj[NTHREADS]; |
| 83 static char stack[NTHREADS][STACKSIZE]; | 85 static char stack[NTHREADS][STACKSIZE]; |
| 84 | 86 |
| 85 #define MAXSIZE 1<<18 | |
| 86 | |
| 87 volatile char m[MAXSIZE]; | |
| 88 | |
| 89 #ifndef MAX_STRIDE | 87 #ifndef MAX_STRIDE |
| 90 #define MAX_STRIDE 64 | 88 #define MAX_STRIDE 64 |
| 91 #endif | 89 #endif |
| 90 | |
| 91 volatile char m[(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE)*MAX_STRIDE+1]; | |
| 92 | 92 |
| 93 // ------------------------------------------------------------------------- | 93 // ------------------------------------------------------------------------- |
| 94 | 94 |
| 95 static void time0(register cyg_uint32 stride) | 95 static void time0(register cyg_uint32 stride) |
| 96 { | 96 { |
