This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sparc leon3 hal patch


Andrew Lunn wrote:
On Wed, Jul 27, 2005 at 09:56:36AM +0200, Konrad Eisele wrote:

I think Jiri Gaisler send in the patches before. He told me to
resynchronize with the current cvs. He also sait it's ok that I sign a
possible licence statement if needed. Let me know.


Yes, we will need a copyright assignment. Please see

http://ecos.sourceware.org/assign.html

We first need Nick to take a look at your kernel and i386 changes.  If
Nick accepts them i can then take a closer look at the rest.


--- ecos-rep-ori/packages/kernel/current/tests/tm_basic.cxx	2005-07-26 17:57:22.000000000 +0200
+++ ecos-rep/packages/kernel/current/tests/tm_basic.cxx	2005-07-26 18:08:48.000000000 +0200
@@ -88,7 +88,7 @@

#define STACK_SIZE CYGNUM_HAL_STACK_SIZE_MINIMUM

-#ifdef CYGMEM_REGION_ram_SIZE
+#if defined(CYGMEM_REGION_ram_SIZE) && !(defined(CYGPKG_HAL_SPARC_LEON3_OPTIONS) || defined(CYGPKG_HAL_SPARC_LEON_OPTIONS))
#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 CYG_MUTEX_OVERHEAD   (sizeof(cyg_mutex_t)+sizeof(fun_times))


I can tell you now, this huck of the patch will be rejected. There
should be no target specific options inside the generic kernel. You
need to find another way to do this.

Andrew


OK, the same patches again this time without the kernel/tests/tm_basic patch.


.


diff -Naur -x tests -x tests_smp -x kernel.cdl ecos-rep-ori/packages/kernel/current/include/smp.hxx ecos-rep/packages/kernel/current/include/smp.hxx
--- ecos-rep-ori/packages/kernel/current/include/smp.hxx	2005-07-26 17:57:21.000000000 +0200
+++ ecos-rep/packages/kernel/current/include/smp.hxx	2005-07-26 18:08:48.000000000 +0200
@@ -88,6 +88,8 @@
 
 #define CYG_KERNEL_CPU_COUNT()          HAL_SMP_CPU_COUNT()
 
+#define CYG_KERNEL_CPU_START_COUNT()    HAL_SMP_CPU_START_COUNT()
+
 #define CYG_KERNEL_CPU_THIS()           HAL_SMP_CPU_THIS()
 
 #define CYG_KERNEL_CPU_NONE             HAL_SMP_CPU_NONE
diff -Naur -x tests -x tests_smp -x kernel.cdl ecos-rep-ori/packages/kernel/current/src/sched/mlqueue.cxx ecos-rep/packages/kernel/current/src/sched/mlqueue.cxx
--- ecos-rep-ori/packages/kernel/current/src/sched/mlqueue.cxx	2005-07-26 17:57:21.000000000 +0200
+++ ecos-rep/packages/kernel/current/src/sched/mlqueue.cxx	2005-07-26 18:08:48.000000000 +0200
@@ -350,7 +350,8 @@
 
     for(int i = 0; i < cpu_count; i++)
     {
-        HAL_SMP_CPU_TYPE cpu = (i + cpu_this) % cpu_count;
+        HAL_SMP_CPU_TYPE cpu =
+          HAL_SMP_CPU_COUNT2IDX ( (i + HAL_SMP_CPU_IDX2COUNT( cpu_this ) ) % cpu_count );
        
         // If a CPU is not already marked for rescheduling, and its
         // current thread is of lower priority than _thread_, then
@@ -464,12 +465,15 @@
 
 #ifdef CYGPKG_KERNEL_SMP_SUPPORT
 
+    int c;
     HAL_SMP_CPU_TYPE cpu;
     HAL_SMP_CPU_TYPE cpu_count = CYG_KERNEL_CPU_COUNT();
     HAL_SMP_CPU_TYPE cpu_this = CYG_KERNEL_CPU_THIS();
     
-    for( cpu = 0; cpu < cpu_count; cpu++ )
+    for( c = 0; c < cpu_count; c++ )
     {
+        cpu = HAL_SMP_CPU_COUNT2IDX(c);
+      
         if( --timeslice_count[cpu] == 0 )
             if( cpu == cpu_this )
                 timeslice_cpu();
diff -Naur -x tests -x tests_smp -x kernel.cdl ecos-rep-ori/packages/kernel/current/src/sched/sched.cxx ecos-rep/packages/kernel/current/src/sched/sched.cxx
--- ecos-rep-ori/packages/kernel/current/src/sched/sched.cxx	2005-07-26 17:57:21.000000000 +0200
+++ ecos-rep/packages/kernel/current/src/sched/sched.cxx	2005-07-26 18:08:48.000000000 +0200
@@ -321,7 +321,7 @@
 
     HAL_SMP_CPU_TYPE cpu;
     
-    for( cpu = 0; cpu < CYG_KERNEL_CPU_COUNT(); cpu++ )
+    for( cpu = 0; cpu < CYG_KERNEL_CPU_START_COUNT(); cpu++ )
     {
         // Don't start this CPU, it is running already!
         if( cpu == CYG_KERNEL_CPU_THIS() )
diff -Naur ecos-rep-ori/packages/hal/i386/arch/current/include/hal_smp.h ecos-rep/packages/hal/i386/arch/current/include/hal_smp.h
--- ecos-rep-ori/packages/hal/i386/arch/current/include/hal_smp.h	2005-07-26 17:57:15.000000000 +0200
+++ ecos-rep/packages/hal/i386/arch/current/include/hal_smp.h	2005-07-26 18:08:48.000000000 +0200
@@ -156,6 +156,12 @@
 
 #define HAL_SMP_CPU_COUNT()     cyg_hal_smp_cpu_count
 
+#define HAL_SMP_CPU_START_COUNT() HAL_SMP_CPU_COUNT()
+     
+#define HAL_SMP_CPU_COUNT2IDX(n)  (n)
+
+#define HAL_SMP_CPU_IDX2COUNT(n)  (n)
+
 #define HAL_SMP_CPU_THIS()                      \
 ({                                              \
     HAL_SMP_CPU_TYPE __id;                      \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]