From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=Qkkc8yUV; spf=pass (domain: linaro.org, ip: 209.85.221.67, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by groups.io with SMTP; Fri, 27 Sep 2019 00:52:17 -0700 Received: by mail-wr1-f67.google.com with SMTP id i18so1530596wru.11 for ; Fri, 27 Sep 2019 00:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EwDDTGc5ZUrsEX76uZXTJjpN8z59oei4ldRMw+4Torg=; b=Qkkc8yUVuSzQyIpzZwwJbK+NeYH5ZMW2X+PVePMdbfG3JSIthplKSbOyo9rsMgqwC4 1fhUSVZ1uvDGNizglIQiRrEzthxcxBBKcPNXN2xTx/OyrhQL1iVdSxF1QkgMEZvo4m3C VFwu2lsKQT9PoswPExcZ8vHOlylZ5vP3N+bYBLUYmBoBJ5Iq5JtZvQC8eFV6rUhNT734 5vytHWEFyRiwDe3DXvDRISaPafswLqIKHhQcuTTPG36ozHLJKWcZktZ8/zC41C4a1CIw y87MrI6cXYadn658ff4OXvfnKg8F/UHY0xnTY+r91suYCW18/xXTxRT8yBaTgGERC89K YhLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EwDDTGc5ZUrsEX76uZXTJjpN8z59oei4ldRMw+4Torg=; b=a/JnyJAS0VUUCibgd+EsPxpxBjtT6Iul6lgERl3OOI7VCAb5WJsU6pFmv/SjGfC7xD 0RFhJ1dCefJmzYT3WhLo9aMpdzck7ecqTfvg3yRaSIQqpnAOwabtEaFbxS+tbDn+FPN5 Iww+kSGgD0Eg83/MGB7MF8XGFa30hvIKi+6Y+tdY6dIEoP4RngzNz86wcoV5UgEkNUcH Wt5cmwI75X70bbMvuQ8Zv4DocwUw6ROVAdlxpnFtwpy27y8xrGeJE9fNEDYpQrtnNcbu qc+g2+F1t3RfCEtJCPDfx0JNrmG83yUsI4TwPQw9bUBaiYgU91/8Qd8TXJR67Wh2HV1l mC4A== X-Gm-Message-State: APjAAAXe4svPpTH5eRS4Z8GvQ8nIAqJr09ISFzYh/cdDtsdcGdZv0I6b Tgz8xfAZLnupY14B5Fijfn9b9uvlX53ER1nJggyy8Q== X-Google-Smtp-Source: APXvYqx7HxYp4RwqtHlbSzO+NDcw6tjKnbHyJmP6E2nZ+XZXjs48xBUXWiLWmJ1orO3pSCDAkV1878LTYJCO4FZVY/4= X-Received: by 2002:adf:fe88:: with SMTP id l8mr1724887wrr.32.1569570735242; Fri, 27 Sep 2019 00:52:15 -0700 (PDT) MIME-Version: 1.0 References: <20190926192818.31119-1-leif.lindholm@linaro.org> In-Reply-To: <20190926192818.31119-1-leif.lindholm@linaro.org> From: "Ard Biesheuvel" Date: Fri, 27 Sep 2019 09:52:03 +0200 Message-ID: Subject: Re: [PATCH 1/1] BaseTools: use stdint.h for GCC ProcessorBind.h typedefs To: Leif Lindholm Cc: edk2-devel-groups-io , Bob Feng , Liming Gao , Laszlo Ersek Content-Type: text/plain; charset="UTF-8" On Thu, 26 Sep 2019 at 21:28, 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. > > Cc: Ard Biesheuvel > Cc: Bob Feng > Cc: Liming Gao > Cc: Laszlo Ersek > Signed-off-by: Leif Lindholm Acked-by: Ard Biesheuvel > --- > > 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?) > > 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 > > /// > -- > 2.20.1 >