RFC: Changing sizeof(MemType) to be greater than sizeof(void *)

Ian Romanick idr at us.ibm.com
Wed Jul 5 19:43:02 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Currently memType is typedef'ed to be 'unsigned long'.  As part of my
pci_rework branch, I'm going to need to bump it to be uint64_t on some
platforms (e.g., PowerPC and possibly others).

Would doing this *now* in the main tree cause ABI problems?  If not, I'd
like to go ahead and do it now.  Some of the drivers appear to use
'unsigned int' where they should be using memType, but if that caused an
ABI problem, those drivers would already be broken on some existing
64-bit platforms (of course, they might be).

My proposal is to change the current typedef of memType to something like:

#if NEED_BIG_MEMTYPE
typedef uint64_t memType;
#else
#include <inttypes.h>
typedef intptr_t memType;
#endif

IMO, memType is actually used for two different purposes.  One of those
purposes seem to be as an integer big enough to hold a pointer.  The
other use seems to be an integer big enough to hold a bus address.  On
most platforms those are the same size, but there are some platforms
(e.g., 32-bit binaries on 64-bit PowerPC) where they are not.  In an
idea world (ha!) I'd like to see the former uses converted to intptr_t,
and the later uses converted to a new type called bus_addr_t or similar.

Thoughts / opinions?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFErHi2X1gOwKyEAw8RAoLoAJ9no8F2HljmrpPVNtXXuuseiw0/UQCeIyny
UkkNfQg/WlFh0TbZr1twON8=
=TFfm
-----END PGP SIGNATURE-----



More information about the xorg mailing list