Finished sparc port merge, fixed symlink cleaning
authorAndrew Waterman <waterman@r53.millennium.berkeley.edu>
Mon, 3 Aug 2009 21:34:16 +0000 (14:34 -0700)
committerAndrew Waterman <waterman@r53.millennium.berkeley.edu>
Mon, 3 Aug 2009 21:34:16 +0000 (14:34 -0700)
12 files changed:
.gitignore
GNUmakefile
kern/Makefrag
kern/arch/i386/mmu.h
kern/arch/sparc/Makefrag
kern/boot [deleted symlink]
kern/include/arch [deleted symlink]
kern/src/Makefrag
kern/src/manager.c
kern/src/syscall.c
kern/src/testing.c
user/Makefrag

index a5dde3b..8e29928 100644 (file)
@@ -12,3 +12,7 @@ hdd.img
 *.*~
 Makelocal
 ros-project.tmproj
+kern/boot
+kern/include/arch
+kern/src/arch
+
index 7b8e140..352b068 100644 (file)
@@ -12,11 +12,11 @@ OBJDIR := obj
 # User defined constants passed on the command line 
 TARGET_ARCH := i386
 
+-include Makelocal
+
 # Make sure that 'all' is the first target
 all: symlinks
 
--include Makelocal
-
 TOP_DIR := .
 ARCH_DIR := $(TOP_DIR)/kern/arch
 INCLUDE_DIR := $(TOP_DIR)/kern/include
@@ -83,12 +83,10 @@ endif
 # List of directories that the */Makefrag makefile fragments will add to
 OBJDIRS :=
 
-kern/boot/Makefrag: symlinks
-
 symlinks:
-       @-unlink kern/include/arch
+       @rm -f kern/include/arch
        @ln -s ../arch/$(TARGET_ARCH)/ kern/include/arch
-       @-unlink kern/boot
+       @rm -f kern/boot
        @ln -s arch/$(TARGET_ARCH)/boot/ kern/boot
 
 # Include Makefrags for subdirectories
@@ -114,6 +112,8 @@ $(OBJDIR)/.deps: $(foreach dir, $(OBJDIRS), $(wildcard $(OBJDIR)/$(dir)/*.d))
 # For deleting the build
 clean:
        rm -rf $(OBJDIR)
+       rm -f kern/boot
+       rm -f kern/include/arch
 
 always:
        @:
index 3523940..3687d72 100644 (file)
@@ -4,7 +4,7 @@ KERN_CFLAGS := $(CFLAGS) -DROS_KERNEL
 KERN_CFLAGS += -I$(INCLUDE_DIR)
 KERN_LDFLAGS := $(LDFLAGS)
 
-include $(KERN_DIR)/boot/Makefrag
+include $(KERN_DIR)/arch/$(TARGET_ARCH)/boot/Makefrag
 include $(KERN_DIR)/ivy/Makefrag
 include $(KERN_DIR)/arch/$(TARGET_ARCH)/Makefrag
 include $(KERN_DIR)/src/Makefrag
index 804260d..115b810 100644 (file)
 #define PTE_USER_RW    (PTE_W | PTE_U) // Kernel/User Read/Write
 #define PTE_USER_RO    PTE_U           // Kernel/User Read-Only
 
-
-#define VALID_USER_PERMS(perm) \
-       (((perm) == PTE_U) || ((perm) == (PTE_U | PTE_W))) 
-
 // The PTE_AVAIL bits aren't used by the kernel or interpreted by the
 // hardware, so user processes are allowed to set them arbitrarily.
 #define PTE_AVAIL      0xE00   // Available for software use
index 519181e..5357327 100644 (file)
@@ -4,7 +4,7 @@
 # where the GNUmakefile is located.
 #
 
-KERN_ARCH_SRC_DIR = $(KERN_DIR)/src/arch
+KERN_ARCH_SRC_DIR = $(KERN_DIR)/arch/$(TARGET_ARCH)
 
 # entry.S must be first, so that it's the first code in the text segment!!!
 #
diff --git a/kern/boot b/kern/boot
deleted file mode 120000 (symlink)
index 1a02482..0000000
--- a/kern/boot
+++ /dev/null
@@ -1 +0,0 @@
-arch/i386/boot/
\ No newline at end of file
diff --git a/kern/include/arch b/kern/include/arch
deleted file mode 120000 (symlink)
index 02e569b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../arch/i386/
\ No newline at end of file
index 2729cf9..87e1654 100644 (file)
@@ -37,13 +37,17 @@ KERN_APPFILES := \
                     $(USER_APPS_ROSLIB_DIR)/proctests \
                     $(USER_APPS_ROSLIB_DIR)/fptest \
                     $(USER_APPS_ROSLIB_DIR)/null \
-                    $(USER_APPS_ROSLIB_DIR)/hello \
-                    $(USER_APPS_PARLIB_DIR)/channel_test_client \
-                    $(USER_APPS_PARLIB_DIR)/channel_test_server \
-                    $(USER_APPS_ROSLIB_DIR)/measurements
-#                    $(USER_APPS_PARLIB_DIR)/draw_nanwan
-#                    $(USER_APPS_PARLIB_DIR)/open_read \
-#                    $(USER_APPS_PARLIB_DIR)/hello
+                    $(USER_APPS_ROSLIB_DIR)/hello
+
+ifeq ($(TARGET_ARCH),i386)
+       KERN_APPFILES += \
+                           $(USER_APPS_PARLIB_DIR)/channel_test_client \
+                           $(USER_APPS_PARLIB_DIR)/channel_test_server \
+                           $(USER_APPS_ROSLIB_DIR)/measurements
+       #                    $(USER_APPS_PARLIB_DIR)/draw_nanwan
+       #                    $(USER_APPS_PARLIB_DIR)/open_read \
+       #                    $(USER_APPS_PARLIB_DIR)/hello
+endif
 
 KERN_LDFLAGS   := $(KERN_LDFLAGS) -L$(OBJDIR)/$(KERN_DIR) \
                   -T $(ARCH_DIR)/$(TARGET_ARCH)/kernel.ld
@@ -75,6 +79,7 @@ $(OBJDIR)/$(KERN_DIR)/%.o: $(KERN_DIR)/%.S
        $(V)$(CC) $(KERN_CFLAGS) -c -o $@ $<
 
 $(OBJDIR)/$(KERN_DIR)/kernel: $(KERN_LDDEPENDS)
+       echo $(KERN_SRCFILES)
        @echo + ld [KERN] $@
        $(V)$(LD) -o $@ $(KERN_LDFLAGS) $(KERN_OBJFILES) $(KERN_LDLIBS) \
                        $(KERN_GCC_LIB) -b binary $(KERN_APPFILES)
index f76eb0e..c722a71 100644 (file)
@@ -28,12 +28,27 @@ void manager(void)
        env_t *envs[256];
 
        switch (progress++) {
+       
+       #ifdef __i386__
+
                case 0:
                        envs[0] = ENV_CREATE(parlib_channel_test_client);
                        envs[1] = ENV_CREATE(parlib_channel_test_server);
                        smp_call_function_single(1, run_env_handler, envs[0], 0);
                        smp_call_function_single(2, run_env_handler, envs[1], 0);
-               #if 0
+
+       #if 0
+               case 0:
+                       printk("Beginning Tests\n");
+                       test_run_measurements(progress-1);  // should never return
+                       break;
+       #endif
+
+               case 1:
+               case 2:
+               case 3:
+       #else
+
                case 0:
                        envs[0] = ENV_CREATE(roslib_proctests);
                        envs[1] = ENV_CREATE(roslib_proctests);
@@ -49,15 +64,9 @@ void manager(void)
                case 1:
                case 2:
                case 3:
-               #endif
-               #if 0
-               case 0:
-                       printk("Beginning Tests\n");
-                       test_run_measurements(progress-1);  // should never return
-                       break;
-               case 1:
-               case 2:
-               case 3:
+
+       #endif
+
                case 4:
                case 5:
                case 6:
@@ -69,9 +78,8 @@ void manager(void)
                case 12:
                case 13:
                case 14:
-                       test_run_measurements(progress-1);
+                       //test_run_measurements(progress-1);
                        break;
-               #endif
                default:
                        printk("Manager Progress: %d\n", progress);
                        schedule();
index 73336d4..7278f4b 100644 (file)
@@ -58,8 +58,8 @@ static ssize_t sys_shared_page_alloc(env_t* p1,
                                      int p1_flags, int p2_flags
                                     ) 
 {
-       if (!VALID_USER_PERMS(p1_flags)) return -EPERM;
-       if (!VALID_USER_PERMS(p2_flags)) return -EPERM;
+       //if (!VALID_USER_PERMS(p1_flags)) return -EPERM;
+       //if (!VALID_USER_PERMS(p2_flags)) return -EPERM;
 
        page_t* page;
        env_t* p2 = &(envs[ENVX(p2_id)]);
index 4c3cece..722f7a1 100644 (file)
@@ -418,6 +418,8 @@ static void wait_for_all_envs_to_die(void)
                cpu_relax();
 }
 
+#if 0
+
 // this never returns.
 static void sync_tests(int start_core, int num_threads, int job_num)
 {
@@ -534,6 +536,8 @@ void test_run_measurements(uint32_t job_num)
        panic("Error in test setup!!");
 }
 
+#endif
+
 /************************************************************/
 /* ISR Handler Functions */
 
index 0596f5e..57a7397 100644 (file)
@@ -4,5 +4,9 @@ USER_CFLAGS  := $(CFLAGS) -DROS_USER
 USER_LDFLAGS := $(LDFLAGS)
 
 include $(USER_DIR)/roslib/Makefrag
-include $(USER_DIR)/parlib/Makefrag
+
+ifeq ($(TARGET_ARCH),i386)
+       include $(USER_DIR)/parlib/Makefrag
+endif
+
 include $(USER_DIR)/apps/Makefrag