Index: testsuites/sptests/ChangeLog
===================================================================
--- testsuites/sptests/ChangeLog	(revision 42740bd6b545c9b389e53ec67bcd83b291821344)
+++ testsuites/sptests/ChangeLog	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
@@ -1,2 +1,10 @@
+2009-01-30	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile.am, configure.ac: Add sp48 which tests that configuring for
+	unlimited objects when configured for a unified workspace works as
+	expected.
+	* sp48/.cvsignore, sp48/Makefile.am, sp48/init.c, sp48/sp48.doc,
+	sp48/sp48.scn: New files.
+
 2009-01-21	Nickolay Kolchin <nbkolchin@gmail.com>
 	        Joel Sherrill <joel.sherrill@oarcorp.com>
Index: testsuites/sptests/Makefile.am
===================================================================
--- testsuites/sptests/Makefile.am	(revision 42740bd6b545c9b389e53ec67bcd83b291821344)
+++ testsuites/sptests/Makefile.am	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
@@ -9,6 +9,6 @@
     sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
     sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
-    sp45 sp46 sp47 spsize spwatchdog spfatal01 spfatal02 spfatal03 spfatal04 \
-    spfatal05 spfatal06 spfatal07 spfatal08 spfatal09
+    sp45 sp46 sp47 sp48 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
+    spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09
 
 DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
Index: testsuites/sptests/configure.ac
===================================================================
--- testsuites/sptests/configure.ac	(revision 42740bd6b545c9b389e53ec67bcd83b291821344)
+++ testsuites/sptests/configure.ac	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
@@ -73,4 +73,5 @@
 sp46/Makefile
 sp47/Makefile
+sp48/Makefile
 spwatchdog/Makefile
 spsize/Makefile
Index: testsuites/sptests/sp48/.cvsignore
===================================================================
--- testsuites/sptests/sp48/.cvsignore	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
+++ testsuites/sptests/sp48/.cvsignore	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Index: testsuites/sptests/sp48/Makefile.am
===================================================================
--- testsuites/sptests/sp48/Makefile.am	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
+++ testsuites/sptests/sp48/Makefile.am	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp48.exe
+sp48_exe_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp48.scn
+dist_rtems_tests_DATA += sp48.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp48_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(sp48_exe_OBJECTS) $(sp48_exe_LDADD)
+LINK_LIBS = $(sp48_exe_LDLIBS)
+
+sp48.exe$(EXEEXT): $(sp48_exe_OBJECTS) $(sp48_exe_DEPENDENCIES)
+	@rm -f sp48.exe$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/sptests/sp48/init.c
===================================================================
--- testsuites/sptests/sp48/init.c	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
+++ testsuites/sptests/sp48/init.c	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
@@ -0,0 +1,84 @@
+/*
+ *  Verify creation of semaphores with unlimited attribute works.
+ *
+ *  $Id$
+ */
+
+#include <tmacros.h>
+#include <rtems/libcsupport.h>
+
+#define MAX 5000
+rtems_id Semaphores[MAX];
+
+rtems_task Init(rtems_task_argument ignored)
+{
+  rtems_status_code sc;
+  int               i;
+  int               created;
+
+  puts( "\n\n*** TEST 48 ***" );
+
+  printf( "Largest C program heap block available: %d\n", malloc_free_space() );
+  for (i=0 ; i<MAX ; i++ ) {
+    sc = rtems_semaphore_create(
+      rtems_build_name('s', 'e', 'm', ' '),
+      1,
+      RTEMS_DEFAULT_ATTRIBUTES,
+      0, 
+      &Semaphores[i]
+    );
+    /* printf("Creating %i id=0x%08x\n", i, Semaphores[i]); */
+
+    if (sc == RTEMS_TOO_MANY) {
+      printf("We run out at %i!\n", i);
+      break;
+    }
+    if (sc != RTEMS_SUCCESSFUL) {
+      printf("FAILED creating at %i\n", i);
+      directive_failed( sc, "rtems_semaphore_create " );
+      rtems_test_exit( 0 );
+    }
+  }
+
+  created = i;
+  if ( created == MAX )
+    puts( "Created all semaphores allowed in this test" );
+
+  printf( "%d semaphores created\n", i );
+  printf( "Largest C program heap block available: %d\n", malloc_free_space() );
+
+  for ( i-- ; i ; i-- ) {
+    sc = rtems_semaphore_delete( Semaphores[i] );
+    if (sc != RTEMS_SUCCESSFUL) {
+      printf("FAILED deleting at %i\n", i);
+      directive_failed( sc, "rtems_semaphore_delete " );
+      rtems_test_exit( 0 );
+    }
+  }
+
+  printf( "%d semaphores successfully deleted\n", created );
+  printf( "Largest C program heap block available: %d\n", malloc_free_space() );
+
+  puts( "*** END OF TEST 48 ***" );
+  rtems_test_exit( 0 );
+}
+
+/* configuration stuff */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS        1
+#define CONFIGURE_MAXIMUM_SEMAPHORES   rtems_resource_unlimited(5)
+#if 1
+  #define CONFIGURE_UNIFIED_WORK_AREAS
+#else
+  #define CONFIGURE_MEMORY_OVERHEAD    1024
+#endif
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
Index: testsuites/sptests/sp48/sp48.scn
===================================================================
--- testsuites/sptests/sp48/sp48.scn	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
+++ testsuites/sptests/sp48/sp48.scn	(revision c83a33ccbbcbf108412a116356b6168b8b3b8b99)
@@ -0,0 +1,11 @@
+*** TEST 48 ***
+Largest C program heap block available: 4006096
+Created all semaphores allowed in this test
+5000 semaphores created
+Largest C program heap block available: 2376296
+5000 semaphores successfully deleted
+Largest C program heap block available: 2376296
+*** END OF TEST 48 ***
+
+NOTE: Heap block size and maximum objects created vary based upon target.
+      The maximum semaphores that will be created is 5000.
