mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: make stat/statfs 64-bit for x86_64 kernels
Date: Wed, 08 May 2013 22:44:48 -0700	[thread overview]
Message-ID: <c63a3480-11e7-4966-ae11-628ef8f1eca5@email.android.com> (raw)
In-Reply-To: <201305090113.19684.vapier@gentoo.org>

Hm... Okay, I'm mistaken then.  I guess it doesn't matter.

Mike Frysinger <vapier@gentoo.org> wrote:

>On Thursday 09 May 2013 00:18:15 H. Peter Anvin wrote:
>> On 05/08/2013 09:08 PM, Mike Frysinger wrote:
>> > On Thursday 09 May 2013 00:04:03 H. Peter Anvin wrote:
>> >> On 05/08/2013 09:00 PM, Mike Frysinger wrote:
>> >>> When including these headers in the x32 ABI, the structs get
>> >>> declared with 32bit sizes which is incorrect.  Use long long
>> >>> and such to make it work both with x32 and x86_64.
>> >> 
>> >> I'm not sure if it is okay to change the types, even within the
>> >> same size.  Perhaps use __u64/__s64?
>> > 
>> > sorry, i don't follow.  changing types isn't ok (unsigned long to
>> > unsigned long long), but changing to __u64 is ok (unsigned long to
>> > __u64 which is typedefed to unsigned long long) ?
>> > 
>> > i don't have a problem using __u64/__s64, i just don't understand
>> > your logic.
>> 
>> In userspace, __u64 is often defined as "unsigned long" on 64 bits.
>
>my tests would seem to indicate otherwise, at least for x86:
>$ gcc -E - <<<"#include <linux/types.h>" | grep '__u64;'
>__extension__ typedef unsigned long long __u64;
>
>$ gcc -m32 -E - <<<"#include <linux/types.h>" | grep '__u64;'
>__extension__ typedef unsigned long long __u64;
>
>$ gcc -mx32 -E - <<<"#include <linux/types.h>" | grep '__u64;'
>__extension__ typedef unsigned long long __u64;
>
>and doing a printf("%i\n", sizeof(__u64)) shows 8 for each of the above
>builds
>-mike

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

  reply	other threads:[~2013-05-09  5:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09  4:00 Mike Frysinger
2013-05-09  4:04 ` H. Peter Anvin
2013-05-09  4:08   ` Mike Frysinger
2013-05-09  4:18     ` H. Peter Anvin
2013-05-09  5:13       ` Mike Frysinger
2013-05-09  5:44         ` H. Peter Anvin [this message]
2013-05-09  4:04 ` H. Peter Anvin
2013-05-09  4:10   ` Mike Frysinger

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=c63a3480-11e7-4966-ae11-628ef8f1eca5@email.android.com \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vapier@gentoo.org \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®