changeset 3043:6724f8254bcb

* tests/bin_sem2.cxx (PHILOSOPHERS): * tests/fptest.cx (TEST_NA): * tests/kmutex3.c (NTHREADS): * tests/kmutex4.c (NTHREADS): * tests/mutex3.cxx (NTHREADS): * tests/thread_gdb.c (NTHREADS): * tests/timeslice.c (NTHREADS_MAX): * tests/timeslice2.c (NTHREADS_MAX): * tests/tm_basic.cxx (NTEST_THREADS): Given a chance to compile and run more tests for low memory footprint targets. [ Bugzilla 1001253 ]
author sergeig
date Sun, 10 Jul 2011 16:01:36 +0000
parents c9b1a6470fbb
children a89747c41077
files packages/kernel/current/ChangeLog packages/kernel/current/tests/bin_sem2.cxx packages/kernel/current/tests/fptest.c packages/kernel/current/tests/kmutex3.c packages/kernel/current/tests/kmutex4.c packages/kernel/current/tests/mutex3.cxx packages/kernel/current/tests/thread_gdb.c packages/kernel/current/tests/timeslice.c packages/kernel/current/tests/timeslice2.c packages/kernel/current/tests/tm_basic.cxx
diffstat 10 files changed, 65 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/packages/kernel/current/ChangeLog
+++ b/packages/kernel/current/ChangeLog
@@ -1,3 +1,16 @@
+2011-07-09  Ilija Kocho  <ilijak@siva.com.mk>
+
+	* tests/bin_sem2.cxx (PHILOSOPHERS):
+	* tests/fptest.cx (TEST_NA):
+	* tests/kmutex3.c (NTHREADS):
+	* tests/kmutex4.c (NTHREADS):
+	* tests/mutex3.cxx (NTHREADS):
+	* tests/thread_gdb.c (NTHREADS):
+	* tests/timeslice.c (NTHREADS_MAX):
+	* tests/timeslice2.c (NTHREADS_MAX):
+	* tests/tm_basic.cxx (NTEST_THREADS): Given a chance to compile and
+	run more tests for low memory footprint targets. [ Bugzilla 1001253 ]
+
 2010-11-22  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* tests/intr0.cxx (intr0_main): Fix a compiler warning by changing
--- a/packages/kernel/current/tests/bin_sem2.cxx
+++ b/packages/kernel/current/tests/bin_sem2.cxx
@@ -58,10 +58,19 @@
 #include <cyg/infra/testcase.h>
 
 #include <cyg/kernel/sched.inl>
+#include CYGHWR_MEMORY_LAYOUT_H
 
 static cyg_ucount16 PHILO_LOOPS = 1000;
 
-#define PHILOSOPHERS 15
+#if (CYGMEM_REGION_ram_SIZE <= 32768)
+# define PHILOSOPHERS 5
+#elif (CYGMEM_REGION_ram_SIZE <= 49152)
+# define PHILOSOPHERS 9
+#elif (CYGMEM_REGION_ram_SIZE <= 65536)
+# define PHILOSOPHERS 11
+#else
+# define PHILOSOPHERS 15
+#endif
 #define NTHREADS PHILOSOPHERS
 #include "testaux.hxx"
 
--- a/packages/kernel/current/tests/fptest.c
+++ b/packages/kernel/current/tests/fptest.c
@@ -68,7 +68,8 @@
 
 #if defined(CYGFUN_KERNEL_API_C) &&             \
     defined(CYGSEM_KERNEL_SCHED_MLQUEUE) &&     \
-    (CYGNUM_KERNEL_SCHED_PRIORITIES > 12)
+    (CYGNUM_KERNEL_SCHED_PRIORITIES > 12) &&    \
+    (CYGMEM_REGION_ram_SIZE >= (49152-4096))
 
 //==========================================================================
 // Base priority for all threads.
@@ -358,7 +359,8 @@ cyg_start( void )
     CYG_TEST_INFO("FP test requires:\n"
                 "CYGFUN_KERNEL_API_C && \n"
                 "CYGSEM_KERNEL_SCHED_MLQUEUE && \n"
-                "(CYGNUM_KERNEL_SCHED_PRIORITIES > 12)\n");
+                "(CYGNUM_KERNEL_SCHED_PRIORITIES > 12) &&\n"
+                "(CYGMEM_REGION_ram_SIZE >= (49152-4096))\n");
     CYG_TEST_NA("FP test requirements");
 }
 
--- a/packages/kernel/current/tests/kmutex3.c
+++ b/packages/kernel/current/tests/kmutex3.c
@@ -79,6 +79,7 @@ cyg_hal_invoke_constructors();
 #include <cyg/infra/cyg_ass.h>
 #include <cyg/infra/cyg_trac.h>
 #include <cyg/infra/diag.h>             // diag_printf
+#include CYGHWR_MEMORY_LAYOUT_H
 
 
 // ------------------------------------------------------------------------
@@ -133,8 +134,11 @@ cyg_hal_invoke_constructors();
 //
 // Translated into KAPI also.
 
-#define NTHREADS 7
-
+#if (CYGMEM_REGION_ram_SIZE <= 32768)
+# define NTHREADS 5
+#else
+# define NTHREADS 7
+#endif
 #define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
 
 static  cyg_handle_t thread[NTHREADS] = { 0 };
--- a/packages/kernel/current/tests/kmutex4.c
+++ b/packages/kernel/current/tests/kmutex4.c
@@ -78,6 +78,7 @@ cyg_hal_invoke_constructors();
 #include <cyg/infra/cyg_ass.h>
 #include <cyg/infra/cyg_trac.h>
 #include <cyg/infra/diag.h>             // diag_printf
+#include CYGHWR_MEMORY_LAYOUT_H
 
 // ------------------------------------------------------------------------
 
@@ -116,7 +117,11 @@ static char * protnames[] = {
 //
 // Translated into KAPI also.
 
-#define NTHREADS 7
+#if (CYGMEM_REGION_ram_SIZE <= 32768)
+# define NTHREADS 5
+#else
+# define NTHREADS 7
+#endif
 
 #define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
 
--- a/packages/kernel/current/tests/mutex3.cxx
+++ b/packages/kernel/current/tests/mutex3.cxx
@@ -59,6 +59,7 @@
 #include <cyg/kernel/thread.inl>
 
 #include <cyg/infra/diag.h>             // diag_printf
+#include CYGHWR_MEMORY_LAYOUT_H
 
 #ifdef CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG
 externC void
@@ -128,7 +129,11 @@ cyg_hal_invoke_constructors();
 // Stolen from testaux.hxx and copied in here because I want to be able to
 // reset the world also.
 
-#define NTHREADS 7
+#if (CYGMEM_REGION_ram_SIZE <= 32768)
+# define NTHREADS 5
+#else
+# define NTHREADS 7
+#endif
 
 inline void *operator new(size_t size, void *ptr) { return ptr; };
 
--- a/packages/kernel/current/tests/thread_gdb.c
+++ b/packages/kernel/current/tests/thread_gdb.c
@@ -56,10 +56,17 @@
     (CYGNUM_KERNEL_SCHED_PRIORITIES > 26)
 
 #include <cyg/hal/hal_arch.h>           // for CYGNUM_HAL_STACK_SIZE_TYPICAL
+#include CYGHWR_MEMORY_LAYOUT_H
 
 // -------------------------------------------------------------------------
 
-#define THREADS                 10
+#if (CYGMEM_REGION_ram_SIZE <= 32768)
+# define THREADS 5
+#elif (CYGMEM_REGION_ram_SIZE <= 49152)
+# define THREADS 8
+#else
+# define THREADS 10
+#endif
 
 #ifdef CYGNUM_HAL_STACK_SIZE_TYPICAL
 #define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
--- a/packages/kernel/current/tests/timeslice.c
+++ b/packages/kernel/current/tests/timeslice.c
@@ -58,6 +58,7 @@
 
 #include <cyg/infra/testcase.h>
 #include <cyg/infra/diag.h>
+#include CYGHWR_MEMORY_LAYOUT_H
 
 //==========================================================================
 
@@ -72,7 +73,11 @@
 
 #define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
 
+#if (CYGMEM_REGION_ram_SIZE <= 32768)
+#define NTHREADS_MAX (CYGNUM_KERNEL_CPU_MAX*4)
+#else
 #define NTHREADS_MAX (CYGNUM_KERNEL_CPU_MAX*6)
+#endif
 
 static int ncpus = CYGNUM_KERNEL_CPU_MAX;
 
--- a/packages/kernel/current/tests/timeslice2.c
+++ b/packages/kernel/current/tests/timeslice2.c
@@ -58,6 +58,7 @@
 
 #include <cyg/infra/testcase.h>
 #include <cyg/infra/diag.h>
+#include CYGHWR_MEMORY_LAYOUT_H
 
 //==========================================================================
 
@@ -72,7 +73,11 @@
 
 #define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
 
+#if (CYGMEM_REGION_ram_SIZE <= 32768)
+#define NTHREADS_MAX (CYGNUM_KERNEL_CPU_MAX*3)
+#else
 #define NTHREADS_MAX (CYGNUM_KERNEL_CPU_MAX*6)
+#endif
 
 static int ncpus = CYGNUM_KERNEL_CPU_MAX;
 
--- a/packages/kernel/current/tests/tm_basic.cxx
+++ b/packages/kernel/current/tests/tm_basic.cxx
@@ -88,7 +88,8 @@ typedef struct fun_times {
 
 #ifdef CYGMEM_REGION_ram_SIZE
 #define CYG_THREAD_OVERHEAD  (STACK_SIZE+sizeof(cyg_thread)+(sizeof(fun_times)*2))
-#define NTEST_THREADS        ((CYGMEM_REGION_ram_SIZE/16)/CYG_THREAD_OVERHEAD)
+#define NTEST_THREADS_AVAIL  ((CYGMEM_REGION_ram_SIZE/16)/CYG_THREAD_OVERHEAD)
+#define NTEST_THREADS        (2>(NTEST_THREADS_AVAIL)?2:(NTEST_THREADS_AVAIL))
 #define CYG_MUTEX_OVERHEAD   (sizeof(cyg_mutex_t)+sizeof(fun_times))
 #define NMUTEXES             ((CYGMEM_REGION_ram_SIZE/16)/CYG_MUTEX_OVERHEAD)
 #define CYG_MBOX_OVERHEAD    (sizeof(cyg_mbox)+sizeof(fun_times))