# HG changeset patch # User sergeig # Date 1310313696 0 # Node ID 6724f8254bcb21d68109d5d594738b20e3bc6c54 # Parent c9b1a6470fbb2cf8d6a33bb73aacd566a5f33078 * 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 ] diff --git a/packages/kernel/current/ChangeLog b/packages/kernel/current/ChangeLog --- a/packages/kernel/current/ChangeLog +++ b/packages/kernel/current/ChangeLog @@ -1,3 +1,16 @@ +2011-07-09 Ilija Kocho + + * 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 * tests/intr0.cxx (intr0_main): Fix a compiler warning by changing diff --git a/packages/kernel/current/tests/bin_sem2.cxx b/packages/kernel/current/tests/bin_sem2.cxx --- a/packages/kernel/current/tests/bin_sem2.cxx +++ b/packages/kernel/current/tests/bin_sem2.cxx @@ -58,10 +58,19 @@ #include #include +#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" diff --git a/packages/kernel/current/tests/fptest.c b/packages/kernel/current/tests/fptest.c --- 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"); } diff --git a/packages/kernel/current/tests/kmutex3.c b/packages/kernel/current/tests/kmutex3.c --- a/packages/kernel/current/tests/kmutex3.c +++ b/packages/kernel/current/tests/kmutex3.c @@ -79,6 +79,7 @@ cyg_hal_invoke_constructors(); #include #include #include // 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 }; diff --git a/packages/kernel/current/tests/kmutex4.c b/packages/kernel/current/tests/kmutex4.c --- a/packages/kernel/current/tests/kmutex4.c +++ b/packages/kernel/current/tests/kmutex4.c @@ -78,6 +78,7 @@ cyg_hal_invoke_constructors(); #include #include #include // 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 diff --git a/packages/kernel/current/tests/mutex3.cxx b/packages/kernel/current/tests/mutex3.cxx --- a/packages/kernel/current/tests/mutex3.cxx +++ b/packages/kernel/current/tests/mutex3.cxx @@ -59,6 +59,7 @@ #include #include // 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; }; diff --git a/packages/kernel/current/tests/thread_gdb.c b/packages/kernel/current/tests/thread_gdb.c --- 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 // 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 diff --git a/packages/kernel/current/tests/timeslice.c b/packages/kernel/current/tests/timeslice.c --- a/packages/kernel/current/tests/timeslice.c +++ b/packages/kernel/current/tests/timeslice.c @@ -58,6 +58,7 @@ #include #include +#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; diff --git a/packages/kernel/current/tests/timeslice2.c b/packages/kernel/current/tests/timeslice2.c --- a/packages/kernel/current/tests/timeslice2.c +++ b/packages/kernel/current/tests/timeslice2.c @@ -58,6 +58,7 @@ #include #include +#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; diff --git a/packages/kernel/current/tests/tm_basic.cxx b/packages/kernel/current/tests/tm_basic.cxx --- 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))