lkml.org 
[lkml]   [2009]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] asm-generic/{unistd,types,posix_types}.h for new arch
Date
On Wednesday 01 April 2009, Will Newton wrote:
> > + * There seems to be no way of detecting this automatically from user
> > + * space, so 64 bit architectures should override this in their types.h.
> > + */
> > +#ifndef __BITS_PER_LONG
> > +#define __BITS_PER_LONG 32
> > +#endif
>
> Why is this define required? It doesn't seem to be in any existing headers.

Unfortunately, there is no generic way to detect the word size yet,
but every architecture uses its own preprocessor macro (__x86_64__,
__s390x__, __ppc64__). We also can't use CONFIG_64BIT in an user-exported
interface header file, because the use space can also be compiled for
32 bits when the kernel uses 64 bits.

__BITS_PER_LONG is actually defined in parisc now, and was the result
of the last time we had this discussion. I'm still thinking about
making a separate <asm/bitsperlong.h> header, or a <asm/bits.h> that
also contains the respective __BIG_ENDIAN/__LITTLE_ENDIAN macros
which have the same problem. The advantage would be that other header
files (e.g. unistd.h) can known the word size without getting the
whole types.h name space.

Arnd <><


\
 
 \ /
  Last update: 2009-04-01 17:07    [W:0.488 / U:0.236 seconds]
©2003-2011 Jasper Spaans. Advertise on this site