RFC: Changing sizeof(MemType) to be greater than sizeof(void *)
idr at us.ibm.com
Wed Jul 5 19:43:02 PDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
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:
typedef uint64_t memType;
typedef intptr_t memType;
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 v22.214.171.124 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the xorg