From 4c0d03907652fdf9c66a02cec9ea7137ccccd2e9 Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Thu, 16 Jun 2016 14:52:04 +0100 Subject: Rework type usage in Trusted Firmware This patch reworks type usage in generic code, drivers and ARM platform files to make it more portable. The major changes done with respect to type usage are as listed below: * Use uintptr_t for storing address instead of uint64_t or unsigned long. * Review usage of unsigned long as it can no longer be assumed to be 64 bit. * Use u_register_t for register values whose width varies depending on whether AArch64 or AArch32. * Use generic C types where-ever possible. In addition to the above changes, this patch also modifies format specifiers in print invocations so that they are AArch64/AArch32 agnostic. Only files related to upcoming feature development have been reworked. Change-Id: I9f8c78347c5a52ba7027ff389791f1dad63ee5f8 --- include/lib/stdlib/machine/_stdint.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'include/lib/stdlib/machine/_stdint.h') diff --git a/include/lib/stdlib/machine/_stdint.h b/include/lib/stdlib/machine/_stdint.h index e36c6598..9a4f35fd 100644 --- a/include/lib/stdlib/machine/_stdint.h +++ b/include/lib/stdlib/machine/_stdint.h @@ -30,6 +30,11 @@ * $FreeBSD$ */ +/* + * Portions copyright (c) 2016, ARM Limited and Contributors. + * All rights reserved. + */ + #ifndef _MACHINE__STDINT_H_ #define _MACHINE__STDINT_H_ @@ -38,12 +43,12 @@ #define INT8_C(c) (c) #define INT16_C(c) (c) #define INT32_C(c) (c) -#define INT64_C(c) (c ## L) +#define INT64_C(c) (c ## LL) #define UINT8_C(c) (c) #define UINT16_C(c) (c) #define UINT32_C(c) (c ## U) -#define UINT64_C(c) (c ## UL) +#define UINT64_C(c) (c ## ULL) #define INTMAX_C(c) INT64_C(c) #define UINTMAX_C(c) UINT64_C(c) @@ -60,19 +65,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-0x7fffffffffffffffL-1) +#define INT64_MIN (-0x7fffffffffffffffLL-1) /* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX 0x7fffffffffffffffL +#define INT64_MAX 0x7fffffffffffffffLL /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffffU -#define UINT64_MAX 0xffffffffffffffffUL +#define UINT64_MAX 0xffffffffffffffffULL /* * ISO/IEC 9899:1999 -- cgit