Inconsistent "#ifdef __KERNEL__" on different architectures

Adrian Bunk (bunk@fs.tum.de)
Sun, 27 May 2001 19:25:33 +0200 (CEST)


Hi,

while looking for the reason of a build failure of the ALSA libraries on
ARM [1] I discovered the following strange thing:

On some architectures a function is inside an "#ifdef __KERNEL__" in the
header file and on others not. Is there a reason for this or is this
inconsistency simply a bug?

In this case the following functions are affected (in 2.4.5):

atomic_read, atomic_inc and atomic_dec in include/asm-*/atomic.h

"#ifdef __KERNEL__" only on arm, mips, mips64 and sparc (but not on
sparc64)

rmb and wmb in include/asm-*/system.h

"#ifdef __KERNEL__" only on arm and sparc (but not on sparc64)

not defined on parisc although used to define smp_rmb on SMP systems:
<-- snip -->
#ifdef CONFIG_SMP
#define smp_mb() mb()
#define smp_rmb() rmb()
#define smp_wmb() wmb()
#else
<-- snip -->

cu
Adrian

[1] http://bugs.debian.org/97988

-- 
A "No" uttered from deepest conviction is better and greater than a
"Yes" merely uttered to please, or what is worse, to avoid trouble.
                -- Mahatma Ghandi

- 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/