lkml.org 
[lkml]   [2002]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: Linux 2.5.4-dj1
From
Date
On Mon, 2002-02-11 at 20:30, Dave Jones wrote:

> o Fix UP Preempt compilation. (Mikael Pettersson)

I ended up sending the following patch to Linus instead.

Would you merge this into your next release, so we can keep the trees in
sync (and not inadvertently push your fix over Linus's later on). This
approach removes the conditional altogether in the UP+preempt case, so
it is optimal.

Thanks,

Robert Love

diff -urN linux-2.5.4-dj1/include/asm-i386/smplock.h linux/include/asm-i386/smplock.h
--- linux-2.5.4-dj1/include/asm-i386/smplock.h Sun Feb 10 20:50:13 2002
+++ linux/include/asm-i386/smplock.h Mon Feb 11 21:34:18 2002
@@ -12,10 +12,15 @@

#ifdef CONFIG_SMP
#define kernel_locked() spin_is_locked(&kernel_flag)
+#define check_irq_holder(cpu) \
+do { \
+ if (global_irq_holder == (cpu)) \
+ BUG(); \
+} while(0)
#else
#ifdef CONFIG_PREEMPT
#define kernel_locked() preempt_get_count()
-#define global_irq_holder 0xFF /* NO_PROC_ID */
+#define check_irq_holder(cpu) do { } while(0)
#else
#define kernel_locked() 1
#endif
@@ -28,8 +33,7 @@
do { \
if (unlikely(task->lock_depth >= 0)) { \
spin_unlock(&kernel_flag); \
- if (global_irq_holder == (cpu)) \
- BUG(); \
+ check_irq_holder(cpu); \
} \
} while (0)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.039 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site