All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@XenSource.com>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>,
	John Levon <levon@movementarian.org>,
	xen-devel <xen-devel@lists.xensource.com>,
	xen-ppc-devel@lists.xensource.com
Subject: Re: [patch] [3/3] dom0_ops explicitly sized types
Date: Fri, 26 May 2006 17:27:33 +0100	[thread overview]
Message-ID: <1148660853.24768.97.camel@localhost.localdomain> (raw)
In-Reply-To: <1148657437.26643.5.camel@basalt.austin.ibm.com>

On Fri, 2006-05-26 at 10:30 -0500, Hollis Blanchard wrote:
> On Fri, 2006-05-26 at 15:28 +0100, Ian Campbell wrote:
> > On Fri, 2006-05-26 at 16:32 +0300, Muli Ben-Yehuda wrote:
> > > > I assume you're referring specifically to the privcmd structure change,
> > > > which is the only Linux-specific part of the patch. The privcmd
> > > > structure is shared between userspace and the kernel. Since "u64" is a
> > > > kernel type, we need to use "uint64_t", which has meaning in
> > > > userspace.
> > > 
> > > Oh well, I didn't realize it was shared with userspace... sorry for
> > > the false alarm.
> > 
> > I think Linus' opinion[0] is that kernel headers which are shared with
> > userspace cannot assume that stdint.h has been included so you need to
> > use __u64 and friends.
> > 
> > Ian.
> > 
> > [0] http://www.ussg.iu.edu/hypermail/linux/kernel/0412.1/1456.html.
> > There's been plenty of other traffic in lkml about it too.
> 
> There certainly has been plenty of traffic, but I have seen no clear
> statements (other than "THIS IS BAD" with little explanation). In fact
> there was just a thread about it this month
> (http://www.ussg.iu.edu/hypermail/linux/kernel/0605.0/0146.html), and I
> still don't understand the objections.
> 
> If you use __u64, you'd need to include some header defining what __u64
> is, so you're requiring another header anyways. You might as well use
> the standard stdint.h rather than inventing your own.

As I understand it the issue is that the C spec makes the __* namespace
available for the kernel to pollute and reserves the non-prefixed
namespace for application usage. (Single underscore is for compiler or
libc internals or something).

An application which has not included stdint.h itself can expect to use
uint64_t however it wishes, including making it a struct, a function or
even something as gross as a 32 bit signed int etc. Exporting some other
idea of what uint64_t should be via the kernel headers breaks this. I
guess this is more of a problem when a kernel header gets indirectly
included -- presumably an app which includes a kernel header directly
knows what it is doing.

Anyway, regardless of any opinion expressed here the Linux gatekeepers
will no doubt insist on __uN. We might as well do it now as change it
later.

Ian.

  reply	other threads:[~2006-05-26 16:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1148509900.26460.22.camel@basalt.austin.ibm.com>
2006-05-24 23:08 ` [patch] [1/3] global build configuration file Hollis Blanchard
2006-05-25 16:28   ` [XenPPC] " Hollis Blanchard
     [not found] ` <1148511175.26460.35.camel@basalt.austin.ibm.com>
     [not found]   ` <1148511400.26460.39.camel@basalt.austin.ibm.com>
2006-05-24 23:04     ` [patch] [3/3] dom0_ops explicitly sized types Hollis Blanchard
2006-05-25 15:39       ` Muli Ben-Yehuda
2006-05-25 19:02         ` Hollis Blanchard
2006-05-26 13:32           ` Muli Ben-Yehuda
2006-05-26 14:28             ` Ian Campbell
2006-05-26 15:30               ` Hollis Blanchard
2006-05-26 16:27                 ` Ian Campbell [this message]
2006-05-26 17:32                   ` Anthony Liguori
2006-05-26 18:21                     ` Markus Armbruster
2006-05-26 17:37                   ` Hollis Blanchard
2006-05-26 18:57                     ` Chris Wright
2006-05-26 19:38                       ` John Levon
2006-05-26 19:57                         ` Chris Wright
2006-05-27  0:42                           ` John Levon
2006-05-24 23:09   ` [patch] [2/3] use new 'xen_pfn_t' type to represent PFNs in the Xen ABI Hollis Blanchard

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=1148660853.24768.97.camel@localhost.localdomain \
    --to=ian.campbell@xensource.com \
    --cc=hollisb@us.ibm.com \
    --cc=levon@movementarian.org \
    --cc=muli@il.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ppc-devel@lists.xensource.com \
    /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.