Re: bitops.h ifdef __KERNEL__ cleanup.

From: Russell King (
Date: Thu Jul 19 2001 - 13:37:23 EST

On Thu, Jul 19, 2001 at 07:21:48PM +0000, Petr Vandrovec wrote:
> Maybe because of I do not know ARM assembler? If you do not want
> kernel headers to be used in apps, just move them from asm and linux
> into msa and xunil. Then you can simple remove all #ifdef __KERNEL__
> from them...

Why should the kernel change to please a problem minority in user space
who shouldn't be including kernel headers in the first place?

> It will still work. Only resulting binary will be slower. That's what
> autoconf is for. If ncpfs does not compile for you, better to contact
> me directly, as I'm ncpfs maintainer...

No. The binary _will_ not do what you expect - these functions are
not atomic in user space on all architecture types. Yes they may work,
but not with the atomic side effects. You won't get this from a simple
autoconf test.

I'll give you credit though - you're at least checking that they appear
to exist; I have come across many programs which rely on them existing,
and do not check that they exist.

It is these that David and myself wish to target, and this along with
the general rule of "Never include kernel headers in user code", it
seems to be the most appropriate solution.

Now, there is a nice clean solution to your problem - bug the glibc
people to provide equivalents in their library, hopefully as inline
asm in the systems header files. Systems which need to do extra stuff
can then have them implemented in the C library.

Russell King (                The developer of ARM Linux

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:12 EST