Fix for build
authorSapan Bhatia <sapanb@cs.princeton.edu>
Wed, 30 Apr 2008 18:38:57 +0000 (18:38 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Wed, 30 Apr 2008 18:38:57 +0000 (18:38 +0000)
linux-2.6-590-chopstix-intern.patch

index 71f53e8..5c8cc49 100644 (file)
@@ -275,6 +275,20 @@ diff -Nurb linux-2.6.22-580/include/linux/arrays.h linux-2.6.22-590/include/linu
 +      struct task_struct *task;
 +};
 +#endif
+diff -Nurb linux-2.6.22-580/include/linux/mutex.h linux-2.6.22-590/include/linux/mutex.h
+--- linux-2.6.22-580/include/linux/mutex.h     2008-04-30 09:19:15.000000000 -0400
++++ linux-2.6.22-590/include/linux/mutex.h     2008-04-29 17:09:49.000000000 -0400
+@@ -53,6 +53,10 @@
+       struct thread_info      *owner;
+       const char              *name;
+       void                    *magic;
++#else
++#ifdef CONFIG_CHOPSTIX
++      struct thread_info      *owner;
++#endif
+ #endif
+ #ifdef CONFIG_DEBUG_LOCK_ALLOC
 diff -Nurb linux-2.6.22-580/include/linux/sched.h linux-2.6.22-590/include/linux/sched.h
 --- linux-2.6.22-580/include/linux/sched.h     2008-04-29 17:04:54.000000000 -0400
 +++ linux-2.6.22-590/include/linux/sched.h     2008-04-29 17:05:11.000000000 -0400
@@ -407,7 +421,7 @@ diff -Nurb linux-2.6.22-580/kernel/mutex.c linux-2.6.22-590/kernel/mutex.c
  
 diff -Nurb linux-2.6.22-580/kernel/sched.c linux-2.6.22-590/kernel/sched.c
 --- linux-2.6.22-580/kernel/sched.c    2008-04-29 17:04:54.000000000 -0400
-+++ linux-2.6.22-590/kernel/sched.c    2008-04-29 17:05:11.000000000 -0400
++++ linux-2.6.22-590/kernel/sched.c    2008-04-30 09:14:33.000000000 -0400
 @@ -10,7 +10,7 @@
   *  1998-11-19        Implemented schedule_timeout() and related stuff
   *            by Andrea Arcangeli
@@ -505,7 +519,7 @@ diff -Nurb linux-2.6.22-580/kernel/sched.c linux-2.6.22-590/kernel/sched.c
                }
        }
  
-@@ -3765,6 +3793,38 @@
+@@ -3765,6 +3793,39 @@
                prev->sleep_avg = 0;
        prev->timestamp = prev->last_ran = now;
  
@@ -514,19 +528,20 @@ diff -Nurb linux-2.6.22-580/kernel/sched.c linux-2.6.22-590/kernel/sched.c
 +      if (rec_event) {
 +              prev->last_ran_j = jiffies;
 +              if (next->last_interrupted!=-1) {
++                      if (next->last_interrupted) {
++                              diff = (jiffies-next->last_interrupted);
++                              sampling_reason = 0;
++                      }
++                      else {
++                              diff = jiffies-next->last_ran_j;
++                              sampling_reason = 1;
++                      }
++
 +                      if (diff > HZ/5) {
 +                              struct event event;
 +                              struct event_spec espec;
 +                              unsigned long eip;
 +
-+                              if (next->last_interrupted) {
-+                                      diff = (jiffies-next->last_interrupted);
-+                                      sampling_reason = 0;
-+                              }
-+                              else {
-+                                      diff = jiffies-next->last_ran_j;
-+                                      sampling_reason = 1;
-+                              }
 +                              espec.reason = sampling_reason;
 +                              eip = next->thread.esp & 4095;
 +                              event.event_data=&espec;
@@ -544,7 +559,7 @@ diff -Nurb linux-2.6.22-580/kernel/sched.c linux-2.6.22-590/kernel/sched.c
        sched_info_switch(prev, next);
        if (likely(prev != next)) {
                next->timestamp = next->last_ran = now;
-@@ -4664,6 +4724,7 @@
+@@ -4664,6 +4725,7 @@
        get_task_struct(p);
        read_unlock(&tasklist_lock);
  
@@ -552,7 +567,7 @@ diff -Nurb linux-2.6.22-580/kernel/sched.c linux-2.6.22-590/kernel/sched.c
        retval = -EPERM;
        if ((current->euid != p->euid) && (current->euid != p->uid) &&
                        !capable(CAP_SYS_NICE))
-@@ -5032,6 +5093,7 @@
+@@ -5032,6 +5094,7 @@
        jiffies_to_timespec(p->policy == SCHED_FIFO ?
                                0 : task_timeslice(p), &t);
        read_unlock(&tasklist_lock);
@@ -560,7 +575,7 @@ diff -Nurb linux-2.6.22-580/kernel/sched.c linux-2.6.22-590/kernel/sched.c
        retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0;
  out_nounlock:
        return retval;
-@@ -7275,3 +7337,9 @@
+@@ -7275,3 +7338,9 @@
  }
  
  #endif