Added compile option to link in fewer binaries
authorAndrew Waterman <waterman@ubuntu.(none)>
Sun, 3 Jan 2010 00:44:40 +0000 (16:44 -0800)
committerAndrew Waterman <waterman@ubuntu.(none)>
Sun, 3 Jan 2010 00:44:40 +0000 (16:44 -0800)
-DMINIMAL_KFS will only link in matrix (the shell)

kern/src/Makefrag
kern/src/kfs.c
kern/src/manager.c

index 28b7a2c..5e291b8 100644 (file)
@@ -44,6 +44,10 @@ KERN_SRCFILES := $(KERN_ARCH_SRCFILES) \
 KERN_SRCFILES := $(wildcard $(KERN_SRCFILES))
 
 KERN_APPFILES := \
+                 $(USER_APPS_PARLIB_DIR)/matrix
+
+ifeq ($(TARGET_ARCH),i386)
+KERN_APPFILES += \
                  $(USER_APPS_ROSLIB_DIR)/proctests \
                  $(USER_APPS_ROSLIB_DIR)/fptest \
                  $(USER_APPS_ROSLIB_DIR)/null \
@@ -52,28 +56,11 @@ KERN_APPFILES := \
                  $(USER_APPS_ROSLIB_DIR)/mhello \
                  $(USER_APPS_ROSLIB_DIR)/mproctests \
                  $(USER_APPS_ROSLIB_DIR)/measurements \
-                 $(USER_APPS_PARLIB_PTHREAD_DIR)/pthread_test \
-                 $(USER_APPS_PARLIB_PTHREAD_DIR)/blackscholes \
                  $(USER_APPS_PARLIB_DIR)/draw_nanwan_standalone \
                  $(USER_APPS_PARLIB_DIR)/channel_test_client \
                  $(USER_APPS_PARLIB_DIR)/channel_test_server \
                  $(USER_APPS_PARLIB_DIR)/hello \
-                 $(USER_APPS_PARLIB_DIR)/manycore_test \
-                 $(USER_APPS_PARLIB_DIR)/matrix
-#                 $(USER_APPS_PARLIB_DIR)/open_read
-
-ifeq ($(TARGET_ARCH),sparc)
-KERN_APPFILES += \
-                 $(USER_APPS_USR_DIR)/blackscholes \
-                 $(USER_APPS_USR_DIR)/streamcluster \
-                 $(USER_APPS_USR_DIR)/swaptions \
-                 $(USER_APPS_USR_DIR)/bodytrack \
-                 $(USER_APPS_USR_DIR)/fluidanimate \
-                 $(USER_APPS_USR_DIR)/x264 \
-                 $(USER_APPS_USR_DIR)/cpptest \
-                 $(USER_APPS_USR_DIR)/condtest \
-                 $(USER_APPS_USR_DIR)/synthetic_procobv_cacheobv_offbwobv \
-                 $(USER_APPS_USR_DIR)/synthetic_procplus_cacheplus_offbwplus 
+                 $(USER_APPS_PARLIB_DIR)/manycore_test
 endif
 
 KERN_LDFLAGS   := $(KERN_LDFLAGS) -L$(OBJDIR)/$(KERN_DIR) \
index d27060d..4dd7248 100644 (file)
@@ -28,6 +28,8 @@
  * userapps in kern/src/Makefrag.
  * Make sure to declare it, and add an entry.  Keep MAX_KFS_FILES big enough too
  */
+DECL_PROG(parlib_matrix);
+#ifndef MINIMAL_KFS
 DECL_PROG(roslib_proctests);
 DECL_PROG(roslib_fptest);
 DECL_PROG(roslib_null);
@@ -40,25 +42,12 @@ DECL_PROG(parlib_draw_nanwan_standalone);
 DECL_PROG(parlib_channel_test_client);
 DECL_PROG(parlib_channel_test_server);
 DECL_PROG(parlib_hello);
-DECL_PROG(parlib_matrix);
 DECL_PROG(parlib_manycore_test);
-DECL_PROG(parlib_pthread_pthread_test);
-DECL_PROG(parlib_pthread_blackscholes);
-
-#ifndef __i386__
-DECL_PROG(usr_blackscholes);
-DECL_PROG(usr_streamcluster);
-DECL_PROG(usr_swaptions);
-DECL_PROG(usr_bodytrack);
-DECL_PROG(usr_fluidanimate);
-DECL_PROG(usr_x264);
-DECL_PROG(usr_synthetic_procobv_cacheobv_offbwobv);
-DECL_PROG(usr_synthetic_procplus_cacheplus_offbwplus);
-DECL_PROG(usr_cpptest);
-DECL_PROG(usr_condtest);
 #endif
 
 struct kfs_entry kfs[MAX_KFS_FILES] = {
+       KFS_ENTRY(parlib_matrix)
+#ifndef MINIMAL_KFS
        KFS_ENTRY(roslib_proctests)
        KFS_ENTRY(roslib_fptest)
        KFS_ENTRY(roslib_null)
@@ -71,21 +60,7 @@ struct kfs_entry kfs[MAX_KFS_FILES] = {
        KFS_ENTRY(parlib_channel_test_client)
        KFS_ENTRY(parlib_channel_test_server)
        KFS_ENTRY(parlib_hello)
-       KFS_ENTRY(parlib_matrix)
        KFS_ENTRY(parlib_manycore_test)
-       KFS_ENTRY(parlib_pthread_pthread_test)
-       KFS_ENTRY(parlib_pthread_blackscholes)
-#ifndef __i386__
-       KFS_ENTRY(usr_blackscholes)
-       KFS_ENTRY(usr_streamcluster)
-       KFS_ENTRY(usr_swaptions)
-       KFS_ENTRY(usr_bodytrack)
-       KFS_ENTRY(usr_fluidanimate)
-       KFS_ENTRY(usr_x264)
-       KFS_ENTRY(usr_synthetic_procobv_cacheobv_offbwobv)
-       KFS_ENTRY(usr_synthetic_procplus_cacheplus_offbwplus)
-       KFS_ENTRY(usr_cpptest)
-       KFS_ENTRY(usr_condtest)
 #endif
 };
 
index 0532869..6eeca47 100644 (file)
@@ -189,6 +189,11 @@ void manager_klueska()
        panic("DON'T PANIC");
 }
 
+void manager_waterman()
+{
+       manager_klueska();
+}
+
 #ifdef __sparc_v8__
 
 static char*
@@ -239,107 +244,3 @@ void gsf_set_core_partition(int core, int partition)
 
 #endif
 
-void manager_waterman()
-{
-#if 0
-
-        static uint8_t progress = 0;
-       if(progress > 0)
-               goto run_some_apps;     
-
-       #define MAX_APPS 2
-       struct app
-       {
-               int threads;
-               int colors;
-               int credits;
-               int argc;
-               char** argv;
-       };
-
-       static struct app apps[MAX_APPS];
-       static int napps = 0;
-
-       // arg format:
-       // #apps [#threads #colors #credits name args] - [#threads ...] - ...
-       assert(argc > 0);
-       napps = atoi(argv[0]);
-       assert(napps <= MAX_APPS);
-       argc--; argv++;
-       for(int a = 0; a < napps; a++)
-       {
-               assert(argc >= 4);
-               apps[a].threads = atoi(argv[0]);
-               apps[a].colors = atoi(argv[1]);
-               apps[a].credits = atoi(argv[2]);
-               argc -= 3; argv += 3;
-
-               apps[a].argc = 0;
-               apps[a].argv = argv;
-               while(argc)
-               {
-                       argc--;
-                       if(strcmp(*argv++,"-") != 0)
-                               apps[a].argc++;
-                       else
-                               break;
-               }
-
-               printk("app %d: %d threads, %d colors, %d credits\ncommand line: ",a,apps[a].threads,apps[a].colors,apps[a].credits);
-               for(int i = 0; i < apps[a].argc; i++)
-                       printk("%s ",apps[a].argv[i]);
-               printk("\n");
-       }
-
-       // DRAM can process requests every 40 cycles.
-       // In a 480-cycle window, this gives us 12 total credits.
-       gsf_set_frame_cycles(482);
-       for(int a = 0, cores_used = 0; a < napps; a++)
-       {
-               gsf_set_partition_credits(a,apps[a].credits);
-               for(int i = 0; i < apps[a].threads; i++, cores_used++)
-                       gsf_set_core_partition(num_cpus-cores_used-1,a);
-       }
-
-run_some_apps:
-       ;
-
-       static struct proc *envs[MAX_APPS];
-       int apps_running = napps;
-       int envs_free[MAX_APPS] = {0};
-       if(progress == napps)
-       {
-               while(apps_running)
-               {
-                       for(int i = 0; i < napps; i++)
-                       {
-                               if(*(volatile uint32_t*)&envs[i]->state == ENV_FREE && !envs_free[i])
-                               {
-                                       envs_free[i] = 1;
-                                       apps_running--;
-                                       printk("Finished application %d at cycle %lld\n", i, read_tsc()); 
-                               }
-                       }
-               }
-               reboot();
-       }
-       else
-       {
-               envs[progress] = kfs_proc_create(kfs_lookup_path(apps[progress].argv[0]));
-
-               envs[progress]->cache_colors_map = cache_colors_map_alloc();
-               for(int i = 0; i < apps[progress].colors; i++)
-                       assert(cache_color_alloc(llc_cache, envs[progress]->cache_colors_map) == ESUCCESS);
-
-               proc_set_state(envs[progress], PROC_RUNNABLE_S);
-
-               if(apps[progress].argc)
-                       proc_init_argc_argv(envs[progress],apps[progress].argc,(const char**)apps[progress].argv);
-
-               proc_run(envs[progress++]);
-
-               schedule();
-       }
-#endif
-       panic("professional bomb technician at work.  if you see me running, try to keep up!");
-}