[U-Boot] [PATCH v3 19/21] Use uintptr_t for 32/64-bit compatibility

Simon Glass sjg at chromium.org
Tue Oct 4 07:24:56 CEST 2011


Hi Mike,

On Mon, Oct 3, 2011 at 11:57 AM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Monday, September 26, 2011 20:10:53 Simon Glass wrote:
>> --- a/common/cmd_mem.c
>> +++ b/common/cmd_mem.c
>>
>>                               printf ("\nMem error @ 0x%08X: "
>>                                       "found %08lX, expected %08lX\n",
>> -                                     (uint)addr, readback, val);
>> +                                     (uint)(uintptr_t)addr, readback, val);
>
> could you change the printf format to %#p instead (and drop the casts
> completely for "addr") ?
> -mike
>

Well it's not complete clear where we want to go with this. My current
thinking is that the emulated memory will be small (in 2011 terms) -
maybe 128MB. The real memory of the machine is not accessible since it
doesn't make sense. So perhaps just because the host happens to be a
64-bit machine we don't suddenly want to be printing 64-bit addresses.

So the answer is 'yes' but for now I'm not sure that's the right thing
to do. I have another patch which enables 'md', etc. but of course
only within the 128MB 'emulated' memory area.

It actually brings up a question - does U-Boot run on 64-machines?

Regards,
Simon


More information about the U-Boot mailing list