lkml.org 
[lkml]   [2004]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectStrange in_atomic() definition in include/linux/hardirq.h
Date
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello.

In linux 2.6.9, in include/linux/hardirq.h, if CONFIG_PREEMPT is set,
isw_atomic() is defines as

#define in_atomic()
((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())

preempt_count (after PREEMPT_ACTIVE is cleared out) looks to be an integer
counter, increased in preempt_disable() and increased in preempt_enable().

kernel_locked() is defined in include/linux/smp_lock.h as
#define kernel_locked() (current->lock_depth >= 0)

So in in_atomic() definition, integer counter is compared with boolean
value. Looks like a bug.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBn5vOv3x5OskTLdsRAkr1AJ9lqX/U58rahDFAP7v9dIf30ZzPSACfcU4u
4JzBcBAuqdrghmgeRnWfBds=
=E9Hd
-----END PGP SIGNATURE-----
-
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 14:08    [W:0.874 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site