[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdWU43OPMaHdG0O6Dg6Li_ca=H1G7NKeMR8JSeWmH0Qq0g@mail.gmail.com>
Date: Thu, 7 Feb 2013 07:39:28 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Rob Landley <rob@...dley.net>
Cc: Stepan Moskovchenko <stepanm@...eaurora.org>,
Andrew Morton <akpm@...ux-foundation.org>,
George Spelvin <linux@...izon.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Stephen Boyd <sboyd@...eaurora.org>,
Andrei Emeltchenko <andrei.emeltchenko@...el.com>,
mingo@...nel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v2] lib: vsprintf: Add %pa format specifier for
phys_addr_t types
Hi Rob,
On Thu, Feb 7, 2013 at 5:39 AM, Rob Landley <rob@...dley.net> wrote:
> On 01/22/2013 06:14:53 PM, Stepan Moskovchenko wrote:
>> Add the %pa format specifier for printing a phys_addr_t
>> type and its derivative types (such as resource_size_t),
>> since the physical address size on some platforms can vary
>> based on build options, regardless of the native integer
>> type.
>>
>> Signed-off-by: Stepan Moskovchenko <stepanm@...eaurora.org>
>
>
> Ok, I know I'm late to the party, but doesn't LP64 apply here? Are we really
> capable of building on a target where "long" and "pointer" are different
> sizes? Last I checked the kernel was full of that assumption because there
> was an actual standard and we demanded that the compiler building us comply
> with it, just like MacOS X and the BSDs do:
>
> Standard:
> http://www.unix.org/whitepapers/64bit.html
>
> Rationale:
> http://www.unix.org/version2/whatsnew/lp64_wp.html
>
> Insane legacy reasons Windows decided to be "special":
> http://blogs.msdn.com/oldnewthing/archive/2005/01/31/363790.aspx
>
> Thus "unsigned long" should by definition be big enough. Using unsigned long
> long means you're doing 64 bit math on 32 bit targets for no apparent
> reason.
>
> What did I miss?
This is about phys_addr_t and resource_size_t, which are _physical_ addresses,
not virtual adresses. Virtual addresses are still 32-bit, so unsigned
long is fine for them.
But these days several CPUs have 36-bit physical addresses, which don't fit in
unsigned long.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists