[PATCH 28/29] [AARCH64] Add typesizes.h for ILP32

Chris Metcalf cmetcalf@tilera.com
Mon Oct 27 16:32:00 GMT 2014


On 10/27/2014 3:59 AM, Andrew Pinski wrote:
> +# undef __SIGINFO_INNER
> +# ifdef __AARCH64EB__
> +#  define __SIGINFO_INNER(type, field)		\
> +	__extension__ struct {			\
> +		int __pad_##field;		\
> +		type field;			\
> +	} __attribute__((aligned(8) ))

Since __SIGINFO_INNER is used for a bunch of non-siginfo purposes in this header, I think it would be clearer to define some more generic name (__TYPESIZES_PAD32 or whatever) and then use that name throughout.

In fact I wonder if it would be clearer to require that type (bomb the typesizes.h headers) and just use it directly in places like the linux-generic "struct shmid_ds", etc.  The "64-bit everywhere" model seems to be the new standard (x32 and now aarch64 compat) so we may want to think forward.

A more standard macro model for this would also moot your __RUSAGE_LONG #ifndef (along with __SIGINFO_VOIDPTR, __SIGINFO_BAND, your hand-rolled "struct sigaltstack" and "struct ucontext", etc), and you could just directly use the now-standard macro in that spot.  The more I think about it the more it seems like it does less damage to the header files to switch to a single common macro defined for all platforms that captures ILP32 and endianness conversions from kernel data structures.

Arguably I should have done this originally for linux-generic, but now that we have another 32-bit case to handle here, I think it's time for a more general solution.

> [...]
> +
> +#define __SIGSET_INNER_T __SYSCALL_ULONG_TYPE
> +#define __FD_MASK_TYPE	__SYSCALL_SLONG_TYPE
> +#define __FD_MASK_CONST(a) (__extension__ a##ull)
> +#endif

Missing indent for these #defines.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com



More information about the Libc-alpha mailing list