diff packages/hal/common/current/tests/cache.c @ 50:a0774359f013 ecos-sw-1999-11-02

Merge from eCos master repository on 1999-11-02-17:02:15-GMT
author jlarmour
date Tue, 02 Nov 1999 20:57:07 +0000
parents 5f5102441818
children c38311975d4f
line wrap: on
line diff
--- a/packages/hal/common/current/tests/cache.c
+++ b/packages/hal/common/current/tests/cache.c
@@ -43,6 +43,8 @@
 #include <cyg/hal/hal_intr.h>
 #include <cyg/infra/diag.h>
 
+#if (HAL_DCACHE_SIZE > 0)
+
 // -------------------------------------------------------------------------
 // If the HAL does not supply this, we supply our own version
 
@@ -69,14 +71,12 @@ CYG_MACRO_END
 
 // -------------------------------------------------------------------------
 
-#define MAXSIZE 1<<18
-
-volatile char m[MAXSIZE];
-
 #ifndef MAX_STRIDE
 #define MAX_STRIDE 64
 #endif
 
+volatile char m[(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE)*MAX_STRIDE];
+
 // -------------------------------------------------------------------------
 
 static void time0(register cyg_uint32 stride)
@@ -209,5 +209,18 @@ cyg_start( void )
     cache_main();
 }
 
+#else // (HAL_DCACHE_SIZE > 0)
+#define N_A_MSG "No cache"
+#endif // (HAL_DCACHE_SIZE > 0)
+
+#ifdef N_A_MSG
+externC void
+cyg_start( void )
+{
+    CYG_TEST_INIT();
+    CYG_TEST_NA( N_A_MSG );
+}
+#endif // N_A_MSG
+
 // -------------------------------------------------------------------------
 /* EOF cache.c */