From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: philmd@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Fri, 27 Sep 2019 03:06:39 -0700 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E697291766 for ; Fri, 27 Sep 2019 10:06:38 +0000 (UTC) Received: by mail-wm1-f70.google.com with SMTP id k67so2021106wmf.3 for ; Fri, 27 Sep 2019 03:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3yfZEW5WrmXYC4VSbz0ZuBmRde+vL2mS33E0MooL0aE=; b=hCaQEqwE7M3WyOQdobCLYCQ8tm6ZZGM/lhqW/SPAl5WQK2wJ/tbCJJtsn8R7KEjiXs uyMA/2dp031dQBndF9Pc0EG1u6WpXqBXwl0AalqBmgh4/IWHVxS7YGOVACdK1HQJ1mVc +QCIqdDAJxF3pMkL8I9f7PniQD7cbw4yTQRRBsXAecI5zrlYVo38mkdKgSdj6xCJEZYa M2hezoBx1qq6vHG7KctWoLSaHFLGdgpRHvPhhsj9LYwPbvX+zMb5Oxi2N0cmdaVY6zbn 5zrg5IQXmfZlxOVg5Qp1ZS0l3TQ70Q50BPJd/Dyqc+pUAkUPqun26UD64rCQtUPCAOfq aHlg== X-Gm-Message-State: APjAAAV9YXAhORjMHSejJpgdyuwo0HNtYQGfqcmuz4CR1NilSrVB72xb QRXKVwSBYz5XYMNn8AyJqq2txEniuqBxmgcie1z+4b2kQhuagnx574RFJM2eaOPVEHGJ1dIGiIA trHgsK2Apj9/VDg== X-Received: by 2002:a5d:4709:: with SMTP id y9mr2384512wrq.129.1569578797710; Fri, 27 Sep 2019 03:06:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5zUlyvBpiYIz07twxwXL3ViFOgsQRxd9hoE7WNQ10Dw2jvUvJMJ1cmFwhKy4VL8e6bC8h8A== X-Received: by 2002:a5d:4709:: with SMTP id y9mr2384490wrq.129.1569578797455; Fri, 27 Sep 2019 03:06:37 -0700 (PDT) Received: from [192.168.1.35] (240.red-88-21-68.staticip.rima-tde.net. [88.21.68.240]) by smtp.gmail.com with ESMTPSA id f186sm6817193wmg.21.2019.09.27.03.06.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Sep 2019 03:06:36 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: use stdint.h for GCC ProcessorBind.h typedefs To: devel@edk2.groups.io, leif.lindholm@linaro.org Cc: Ard Biesheuvel , Bob Feng , Liming Gao , Laszlo Ersek References: <20190926192818.31119-1-leif.lindholm@linaro.org> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: Date: Fri, 27 Sep 2019 12:06:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190926192818.31119-1-leif.lindholm@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 9/26/19 9:28 PM, Leif Lindholm wrote: > The AArch64 definitions of UINT64/INT64 differ from the X64 ones. > Since this is on the tool side, doing like X64 and picking the > definitions from stdint.h feels like a better idea than hardcoding > them. So copy the pattern from X64/ProcesorBind.h. Typo: X64/ProcessorBind.h ('s' missing). > > Cc: Ard Biesheuvel > Cc: Bob Feng > Cc: Liming Gao > Cc: Laszlo Ersek > Signed-off-by: Leif Lindholm > --- > > This was triggered by one of the Risc-V patches which may need to end up > being modified to the point where this issue goes away, but the current > situation seems suboptimal. (Do you use %llx or %lx to print an Elf64_Addr > on a 64-bit LP architecture?) What is the answer? :) > > BaseTools/Source/C/Include/AArch64/ProcessorBind.h | 26 ++++++++++---------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h b/BaseTools/Source/C/Include/AArch64/ProcessorBind.h > index bfaf1e28e446..dfa725b2e363 100644 > --- a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h > +++ b/BaseTools/Source/C/Include/AArch64/ProcessorBind.h > @@ -41,21 +41,21 @@ > typedef signed char INT8; > #else > // > - // Assume standard AARCH64 alignment. > + // Use ANSI C 2000 stdint.h integer width declarations > // > - typedef unsigned long long UINT64; > - typedef long long INT64; > - typedef unsigned int UINT32; > - typedef int INT32; > - typedef unsigned short UINT16; > - typedef unsigned short CHAR16; > - typedef short INT16; > - typedef unsigned char BOOLEAN; > - typedef unsigned char UINT8; > - typedef char CHAR8; > - typedef signed char INT8; > + #include > + typedef uint8_t BOOLEAN; > + typedef int8_t INT8; > + typedef uint8_t UINT8; > + typedef int16_t INT16; > + typedef uint16_t UINT16; > + typedef int32_t INT32; > + typedef uint32_t UINT32; > + typedef int64_t INT64; > + typedef uint64_t UINT64; > + typedef char CHAR8; > + typedef uint16_t CHAR16; > > - #define UINT8_MAX 0xff > #endif > > /// > Reviewed-by: Philippe Mathieu-Daude