This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Kernel - minor test fixes


Index: kernel/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.92
diff -u -5 -p -r1.92 ChangeLog
--- kernel/current/ChangeLog	31 Jan 2003 11:44:02 -0000	1.92
+++ kernel/current/ChangeLog	10 Feb 2003 21:02:14 -0000
@@ -1,5 +1,16 @@
+2003-02-10  Gary Thomas  <gary@mlbassoc.com>
+
+	* tests/clocktruth.cxx: 
+	* tests/clockcnv.cxx: Use <cyg/infra/diag.h> for diag_printf()
+	prototype, rather than hard coding (because it was inconsistent).
+
+2003-02-05  Gary Thomas  <gary@mlbassoc.com>
+
+	* tests/kcache2.c (test_dcache_operation): New test to verify
+	that the DATA cache syncs properly.
+
 2003-01-31  Nick Garnett  <nickg@calivar.com>
 
 	* cdl/kernel.cdl: 
 	* tests/fptest.c: Added this program to test interaction of FPU
 	with multiple threads.
Index: kernel/current/tests/clockcnv.cxx
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/kernel/current/tests/clockcnv.cxx,v
retrieving revision 1.7
diff -u -5 -p -r1.7 clockcnv.cxx
--- kernel/current/tests/clockcnv.cxx	23 May 2002 23:06:57 -0000	1.7
+++ kernel/current/tests/clockcnv.cxx	10 Feb 2003 21:02:02 -0000
@@ -7,10 +7,11 @@
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
 // Software Foundation; either version 2 or (at your option) any later version.
 //
@@ -57,11 +58,11 @@
 #include <cyg/kernel/clock.inl>
 #include <cyg/kernel/thread.inl>
 
 #ifdef CYGVAR_KERNEL_COUNTERS_CLOCK
 
-externC void diag_printf(const char *, ...);
+#include <cyg/infra/diag.h>
 
 static void null_printf(const char *, ...)
 { /* nothing */ }
 
 #define PRINTF0 diag_printf
Index: kernel/current/tests/clocktruth.cxx
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/kernel/current/tests/clocktruth.cxx,v
retrieving revision 1.3
diff -u -5 -p -r1.3 clocktruth.cxx
--- kernel/current/tests/clocktruth.cxx	23 May 2002 23:06:57 -0000	1.3
+++ kernel/current/tests/clocktruth.cxx	10 Feb 2003 21:02:14 -0000
@@ -7,10 +7,11 @@
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
 // Software Foundation; either version 2 or (at your option) any later version.
 //
@@ -64,11 +65,11 @@
 #include <cyg/kernel/clock.inl>
 #include <cyg/kernel/thread.inl>
 
 #ifdef CYGVAR_KERNEL_COUNTERS_CLOCK
 
-externC void diag_printf(const char *, ...);
+#include <cyg/infra/diag.h>
 
 #define NTHREADS 1
 #include "testaux.hxx"
 
 #ifdef RUNFOREVER
Index: kernel/current/tests/kcache2.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/kernel/current/tests/kcache2.c,v
retrieving revision 1.12
diff -u -5 -p -r1.12 kcache2.c
--- kernel/current/tests/kcache2.c	4 Jan 2003 13:02:31 -0000	1.12
+++ kernel/current/tests/kcache2.c	10 Feb 2003 20:46:27 -0000
@@ -74,12 +74,12 @@
 #define TIME_DLOCK_LOOPS 10000 // default number of loops for time_dlock()
 
 // Define this to enable a simple, but hopefully useful, data cache
 // test.  It may help discover if the cache support has been defined
 // properly (in terms of size and shape)
-#ifdef HAL_DCACHE_SIZE
-//#define _TEST_DCACHE_OPERATION
+#ifdef HAL_DCACHE_LINE_SIZE
+#define _TEST_DCACHE_OPERATION
 #endif
 
 static cyg_handle_t thread[NTHREADS];
 
 static cyg_thread thread_obj[NTHREADS];
@@ -313,10 +313,11 @@ static void test_dstore(void)
 static void
 test_dcache_operation(void)
 {
     long *lp = (long *)m;
     int i, errs;
+    cyg_uint32 oldints;
 
     CYG_TEST_INFO("Data cache basic");
 
     HAL_DISABLE_INTERRUPTS(oldints);
     HAL_DCACHE_SYNC();
@@ -327,10 +328,12 @@ test_dcache_operation(void)
         lp[i] = i;
     }
     HAL_DCACHE_INVALIDATE_ALL();
     HAL_DCACHE_ENABLE();
     // Now push data through the cache
+    // Note: 256 seems like a reasonable offset.  It may be useful to actually
+    // compute this (and the size of the test region) based on cache geometry
     for (i = 256;  i < 256+HAL_DCACHE_SIZE/sizeof(*lp);  i++) {
         lp[i] = 0xFF000000 + i;
     }
     // Now force cache clean and off
     HAL_DCACHE_SYNC();
@@ -353,12 +356,15 @@ test_dcache_operation(void)
                                 i, lp[i], i);
                 }
             }
         }
     }
+    CYG_TEST_CHECK(0 == errs, "dcache basic failed");
+#if 0 // Additional information
     diag_printf("%d total errors during compare\n", errs);
     diag_dump_buf(&lp[240], 128);
+#endif
     HAL_RESTORE_INTERRUPTS(oldints);
 }
 #endif
 
 static void test_dsync(void)
@@ -816,13 +822,10 @@ static void time_dlock(void)
 
 // -------------------------------------------------------------------------
 static void entry0( cyg_addrword_t data )
 {
     int numtests = 0;
-#ifdef _TEST_DCACHE_OPERATION
-    test_dcache_operation();
-#endif
 #ifdef HAL_DCACHE_QUERY_WRITE_MODE
     int wmode;
 #endif
 #ifdef HAL_DCACHE_LOCK
     time_dlock(); numtests++;
@@ -833,10 +836,13 @@ static void entry0( cyg_addrword_t data 
 #ifdef HAL_DCACHE_LINE_SIZE // So we can find our way around memory
     test_dsync(); numtests++;
 #endif
 #ifdef HAL_DCACHE_STORE
     test_dstore(); numtests++;
+#endif
+#ifdef _TEST_DCACHE_OPERATION
+    test_dcache_operation(); numtests++;
 #endif
 #ifdef HAL_DCACHE_READ_HINT
     test_dread_hint(); numtests++;
 #endif
 #ifdef HAL_DCACHE_WRITE_HINT


-- 
------------------------------------------------------------
Gary Thomas                 |
MLB Associates              |  Consulting for the
+1 (970) 229-1963           |    Embedded world
http://www.mlbassoc.com/    |
email: <gary@mlbassoc.com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]