patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / i386 / kernel / process.c
index 2e61c5d..de22204 100644 (file)
@@ -202,6 +202,10 @@ static int __init idle_setup (char *str)
        if (!strncmp(str, "poll", 4)) {
                printk("using polling idle threads.\n");
                pm_idle = poll_idle;
+#ifdef CONFIG_X86_SMP
+               if (smp_num_siblings > 1)
+                       printk("WARNING: polling idle and HT enabled, performance may degrade.\n");
+#endif
        } else if (!strncmp(str, "halt", 4)) {
                printk("using halt in idle threads.\n");
                pm_idle = default_idle;
@@ -633,11 +637,6 @@ out:
        return error;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
 #define top_esp                (THREAD_SIZE - sizeof(unsigned long))
 #define top_ebp                (THREAD_SIZE - 2*sizeof(unsigned long))
 
@@ -658,14 +657,12 @@ unsigned long get_wchan(struct task_struct *p)
                if (ebp < stack_page || ebp > top_ebp+stack_page)
                        return 0;
                eip = *(unsigned long *) (ebp+4);
-               if (eip < first_sched || eip >= last_sched)
+               if (!in_sched_functions(eip))
                        return eip;
                ebp = *(unsigned long *) ebp;
        } while (count++ < 16);
        return 0;
 }
-#undef last_sched
-#undef first_sched
 
 /*
  * sys_alloc_thread_area: get a yet unused TLS descriptor index.
@@ -744,7 +741,7 @@ asmlinkage int sys_set_thread_area(struct user_desc __user *u_info)
        ((desc)->a & 0x0ffff) | \
         ((desc)->b & 0xf0000) )
        
-#define GET_32BIT(desc)                (((desc)->b >> 23) & 1)
+#define GET_32BIT(desc)                (((desc)->b >> 22) & 1)
 #define GET_CONTENTS(desc)     (((desc)->b >> 10) & 3)
 #define GET_WRITABLE(desc)     (((desc)->b >>  9) & 1)
 #define GET_LIMIT_PAGES(desc)  (((desc)->b >> 23) & 1)