All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linuxppc64-dev@ozlabs.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] 1/2 Start header file merger (Was: Re: Beginning Merger Patch)
Date: Fri, 5 Aug 2005 18:24:16 +0200	[thread overview]
Message-ID: <200508051824.17947.arnd@arndb.de> (raw)
In-Reply-To: <20050806005941.5d1fe432.sfr@canb.auug.org.au>

On Freedag 05 August 2005 16:59, Stephen Rothwell wrote:

> Well noone should even include kernel headers from user space :-) and my
> understanding is that glibc "sanitizes" its version of the kernel headers
> anyway.

Glibc doesn't change the header files too much, most of that is done in
the linux-libc-headers package, which is maintained separately from the
kernel and from glibc. There is some effort being put into keeping the
difference between that package and the kernel headers small.

Also, while using kernel headers directly from user space should be
considered a bug, Linus has stated before that he wants source code
that is broken in that way to keep working instead of breaking it
even more.

There is also klibc, which heavily relies on kernel headers by design.

> > Using CONFIG_64BIT instead of __powerpc64__ only within #ifdef __KERNEL=
__
> > would be correct but less consistant.
>=20
> The advantage of using CONFIG_64BIT as much as possible is that it shows
> us places that can be consolidated across the various architectures
> (which is a bit of a passion of mine :-)). =A0And more consolidation shou=
ld
> make life easier for the glibc folks in the long run.

AFAIK, in linux-libc-headers every usage of CONFIG_* outside of __KERNEL__
is a bug that needs to be fixed by the maintainer, so we really should not
do that.

I think it might be ok to use CONFIG_64BIT for files that are completely
inside #ifdef __KERNEL__, but I'd like to avoid stuff like:

#ifndef __powerpc64__
#define __NR_sendfile64=AD=AD		226 /* only for 32 bit */
#endif /* __powerpc64__ */
=2E..
#ifdef __KERNEL__
#ifndef CONFIG_64BIT
#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
#else  /* CONFIG_64BIT */
#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscal=
l")
#endif /* CONFIG_64BIT */
#endif /* __KERNEL__ */

in a single file. Using __powerpc64__ consistantly has the advantage that
the casual reader can easily find all places that rely on 32/64 bit
definitions without having to understand why there are two different ways
to do the same thing.

Perhaps it works out better if this is combined with the split into
include/asm-powerpc/ and include/asm-powerpc/user, as mentioned in the
thread around http://www.ussg.iu.edu/hypermail/linux/kernel/0411.3/1663.htm=
l.
Then we could have CONFIG_64BIT everywhere in the real kernel headers and
__powerpc64__ in the user interface headers.

	Arnd <><

  reply	other threads:[~2005-08-05 18:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-02 22:59 Beginning Merger Patch Jon Loeliger
2005-08-02 23:05 ` Eugene Surovegin
2005-08-02 23:12   ` Dan Malek
2005-08-02 23:17     ` Eugene Surovegin
2005-08-03  3:08     ` Paul Mackerras
2005-08-03  2:38   ` Josh Boyer
2005-08-02 23:10 ` Dan Malek
2005-08-05  7:47   ` [PATCH] 1/2 Start header file merger (Was: Re: Beginning Merger Patch) Stephen Rothwell
2005-08-05  7:50     ` [PATCH] 2/2 merge the easy ones Stephen Rothwell
2005-08-05  8:37     ` [PATCH] 1/2 Start header file merger (Was: Re: Beginning Merger Patch) Stephen Rothwell
2005-08-05  9:08     ` Michael Ellerman
2005-08-05 11:53     ` Arnd Bergmann
2005-08-05 14:59       ` Stephen Rothwell
2005-08-05 16:24         ` Arnd Bergmann [this message]
2005-08-26 20:55         ` Jon Loeliger
2005-08-29 15:44           ` Segher Boessenkool
2005-08-29 18:41           ` Christopher Friesen
2005-08-17  5:39     ` Kumar Gala
2005-08-17 11:05       ` Arnd Bergmann
2005-08-03  2:17 ` Beginning Merger Patch Nathan Lynch
2005-08-03  2:58   ` Eugene Surovegin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200508051824.17947.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.