[U-Boot] RFA: libfdt: using missing type uintptr_t

David Gibson david at gibson.dropbear.id.au
Wed Aug 20 03:11:11 CEST 2008


On Tue, Aug 19, 2008 at 08:40:27PM -0400, Jerry Van Baren wrote:
> Hello all,  I have a Request For Advice.
>
> I've pulled down the dtc/libfdt updates and applied them to my personal  
> working git repository.  It turns out that David Gibson added a use of  
> the typedef "uintptr_t" found in linux-land in /usr/include/stdint.h.
>
> <http://thread.gmane.org/gmane.linux.ports.ppc64.devel/43379>
>
> The problem is, currently u-boot doesn't have stdint.h.  It looks like  
> we have three options:
> 1) Hack in the typedef for uintptr_t into "libfdt_env.h"

This doesn't strike me as a hack.  It's exactly the sort of thing that
libfdt_env.h is for.  In fact, I think I already did this when I
updated the in-kernel dtc/libfdt to a recent version (the kernel has a
stdint.h, but the bootwrapper environment doesn't, or not a complete
one).

> 2) Add the linux stdint.h to u-boot

Doesn't have to be the Linux one, though that's probably easy as any.
Any more-or-less C99ish stdint.h will do.

> 3) Find an alternative for uintptr_t and convince David and Jon that it  
> is A Better Thing to use.
>
> As I see it, #3 is extremely unlikely, especially since David is using  
> uintptr_t for exactly the purpose for which it was created.  #1 is,  
> well, a hack.  #2 (add linux' stdint.h to u-boot) seems like the best  
> approach, but my initial try caused redefinitions between stdint.h and  
> types.h as well as missing files:
>   #include <features.h>
>   #include <bits/wchar.h>
>   #include <bits/wordsize.h>
> Sigh.
>
> At this point, adding stdint.h seems to be the best option.  Anybody  
> have a better approach?
>
> Thanks,
> gvb
>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson


More information about the U-Boot mailing list