* Strange in_atomic() definition in include/linux/hardirq.h
@ 2004-11-20 19:32 Nikita V. Youshchenko
0 siblings, 0 replies; only message in thread
From: Nikita V. Youshchenko @ 2004-11-20 19:32 UTC (permalink / raw)
To: linux-kernel
-----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-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-11-20 19:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-20 19:32 Strange in_atomic() definition in include/linux/hardirq.h Nikita V. Youshchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®