From ae532fe6414a2de079e48d1b83047819241d5e36 Mon Sep 17 00:00:00 2001 From: Masa Nakura Date: Thu, 27 Feb 2025 10:02:06 +0000 Subject: [PATCH] payloads/libpayload: Add fast data types to types.h libpayload stdint.h only supports typedefs for datatypes of exact bits. This makes libpayload less flexible to support libraries that reference different data types. Add fast data types in types.h. BUG=b:386913035 Change-Id: Ie9197866ae9b6c27d3f26c11d8409ecb90321c74 Signed-off-by: Masa Nakura Reviewed-on: https://review.coreboot.org/c/coreboot/+/86632 Reviewed-by: Yu-Ping Wu Reviewed-by: Hsuan-ting Chen Tested-by: build bot (Jenkins) --- payloads/libpayload/include/arm/arch/types.h | 8 ++++++++ payloads/libpayload/include/arm64/arch/types.h | 8 ++++++++ payloads/libpayload/include/mock/arch/types.h | 8 ++++++++ payloads/libpayload/include/x86/arch/types.h | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/payloads/libpayload/include/arm/arch/types.h b/payloads/libpayload/include/arm/arch/types.h index 3f2eeaa466..43ba84ebf8 100644 --- a/payloads/libpayload/include/arm/arch/types.h +++ b/payloads/libpayload/include/arm/arch/types.h @@ -30,23 +30,31 @@ #define _ARCH_TYPES_H typedef unsigned char uint8_t; +typedef unsigned char uint_fast8_t; typedef unsigned char u8; typedef signed char int8_t; +typedef signed char int_fast8_t; typedef signed char s8; typedef unsigned short uint16_t; typedef unsigned short u16; +typedef unsigned short uint_fast16_t; typedef signed short int16_t; +typedef signed short int_fast16_t; typedef signed short s16; typedef unsigned int uint32_t; +typedef unsigned int uint_fast32_t; typedef unsigned int u32; typedef signed int int32_t; +typedef signed int int_fast32_t; typedef signed int s32; typedef unsigned long long uint64_t; +typedef unsigned long long uint_fast64_t; typedef unsigned long long u64; typedef signed long long int64_t; +typedef signed long long int_fast64_t; typedef signed long long s64; typedef long time_t; diff --git a/payloads/libpayload/include/arm64/arch/types.h b/payloads/libpayload/include/arm64/arch/types.h index 3f2eeaa466..43ba84ebf8 100644 --- a/payloads/libpayload/include/arm64/arch/types.h +++ b/payloads/libpayload/include/arm64/arch/types.h @@ -30,23 +30,31 @@ #define _ARCH_TYPES_H typedef unsigned char uint8_t; +typedef unsigned char uint_fast8_t; typedef unsigned char u8; typedef signed char int8_t; +typedef signed char int_fast8_t; typedef signed char s8; typedef unsigned short uint16_t; typedef unsigned short u16; +typedef unsigned short uint_fast16_t; typedef signed short int16_t; +typedef signed short int_fast16_t; typedef signed short s16; typedef unsigned int uint32_t; +typedef unsigned int uint_fast32_t; typedef unsigned int u32; typedef signed int int32_t; +typedef signed int int_fast32_t; typedef signed int s32; typedef unsigned long long uint64_t; +typedef unsigned long long uint_fast64_t; typedef unsigned long long u64; typedef signed long long int64_t; +typedef signed long long int_fast64_t; typedef signed long long s64; typedef long time_t; diff --git a/payloads/libpayload/include/mock/arch/types.h b/payloads/libpayload/include/mock/arch/types.h index 8f090caa9b..63b0e866bf 100644 --- a/payloads/libpayload/include/mock/arch/types.h +++ b/payloads/libpayload/include/mock/arch/types.h @@ -4,23 +4,31 @@ #define _ARCH_TYPES_H typedef unsigned char uint8_t; +typedef unsigned char uint_fast8_t; typedef unsigned char u8; typedef signed char int8_t; +typedef signed char int_fast8_t; typedef signed char s8; typedef unsigned short uint16_t; typedef unsigned short u16; +typedef unsigned short uint_fast16_t; typedef signed short int16_t; +typedef signed short int_fast16_t; typedef signed short s16; typedef unsigned int uint32_t; +typedef unsigned int uint_fast32_t; typedef unsigned int u32; typedef signed int int32_t; +typedef signed int int_fast32_t; typedef signed int s32; typedef unsigned long long uint64_t; +typedef unsigned long long uint_fast64_t; typedef unsigned long long u64; typedef signed long long int64_t; +typedef signed long long int_fast64_t; typedef signed long long s64; typedef long time_t; diff --git a/payloads/libpayload/include/x86/arch/types.h b/payloads/libpayload/include/x86/arch/types.h index 3f2eeaa466..43ba84ebf8 100644 --- a/payloads/libpayload/include/x86/arch/types.h +++ b/payloads/libpayload/include/x86/arch/types.h @@ -30,23 +30,31 @@ #define _ARCH_TYPES_H typedef unsigned char uint8_t; +typedef unsigned char uint_fast8_t; typedef unsigned char u8; typedef signed char int8_t; +typedef signed char int_fast8_t; typedef signed char s8; typedef unsigned short uint16_t; typedef unsigned short u16; +typedef unsigned short uint_fast16_t; typedef signed short int16_t; +typedef signed short int_fast16_t; typedef signed short s16; typedef unsigned int uint32_t; +typedef unsigned int uint_fast32_t; typedef unsigned int u32; typedef signed int int32_t; +typedef signed int int_fast32_t; typedef signed int s32; typedef unsigned long long uint64_t; +typedef unsigned long long uint_fast64_t; typedef unsigned long long u64; typedef signed long long int64_t; +typedef signed long long int_fast64_t; typedef signed long long s64; typedef long time_t;