From nobody Fri Apr 26 09:05:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515764029218974.2128758240976; Fri, 12 Jan 2018 05:33:49 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2ABCD21D2BEE5; Fri, 12 Jan 2018 05:28:33 -0800 (PST) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DE270222CF1AA for ; Fri, 12 Jan 2018 05:28:29 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id t8so12105705wmc.3 for ; Fri, 12 Jan 2018 05:33:44 -0800 (PST) Received: from localhost.localdomain ([84.203.42.225]) by smtp.gmail.com with ESMTPSA id c16sm1184952eda.67.2018.01.12.05.33.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 05:33:42 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::241; helo=mail-wm0-x241.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HdYN7DdtPr4H2YuDR7zzPSSL/AliulcNO2vbj0/dPho=; b=QZMr+smA/epYD7HtYKl8gaGY2oQ2NbOwN2Eu0fqMIXllWh1KHWYqMZ07TOMHyLPHXq 66r45rTfeU7pVboakyo4Y+C8Kt468qlFztepb12uJwF+n7gy484+uJDftUkml8WU9knY 04a1cc/FbrwmLgCyEoNP/JLCrHGErGe2DSzl//t2BfBiZGotNDnPnkYzQGZ38BWVjif7 F2rLx7ZNDyRrYgrG8FUULzjHoXA75F5HqgFKiJ12QH8LxsRr0eGDWghz75OytBWgHm8F QTqYN4FNQriU+fpmaAhSJPwFQqc9ZmDqn/W5BNaFE8do3Vzpu31+3m2T3276GX/DtqxG r+cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HdYN7DdtPr4H2YuDR7zzPSSL/AliulcNO2vbj0/dPho=; b=MovCs5xzAIhj1CNjU54c72vOFiaTT6m5e6EMTx+kLzGK9ZX/jysZdshnmfHNZKEYYO LNK2lniyYpzd5kEm6DZRQg1Y84HAm2gRwFlJrIjZadYIPPLyDgUKYOhMCshvNGHTEy59 evinU6uCWI1tL/BwkwyUKsRXAXKOuJfVyfEdgqbdSboO1tOKXFutzj3qFVZbIo+QuCqr mlooaTxC+eOyBsIPgvKiIdOlijUUrCWV2afZl66K24+RGlTC7ywupkmT3yHVJ+vbay1m Ze4ZWb3IwfTwbH3j/M9CwCCoz3pLE19xXiUYdzxtGPIgKawWemdHA4jsB2BNiqEyK5ne V8SQ== X-Gm-Message-State: AKwxyte/eD3Z4H34duy5NpKfLZqaHirjUF0biGsZguz1MAjWRBgyxcKa x86e41KtewNROmikv2Tdl5/rr5Y+YUk= X-Google-Smtp-Source: ACJfBotfTgSno5hyA3cV089s0DyjHO9KiF1UXJqJ3EE1PeIChy3eW2P0Oo5r8WH1QE6+S9TwCeYWsQ== X-Received: by 10.80.149.75 with SMTP id v11mr961704eda.242.1515764022915; Fri, 12 Jan 2018 05:33:42 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Date: Fri, 12 Jan 2018 13:33:26 +0000 Message-Id: <20180112133331.7776-2-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20180112133331.7776-1-pete@akeo.ie> References: <20180112133331.7776-1-pete@akeo.ie> Subject: [edk2] [PATCH v5 1/6] MdePkg: Disable some Level 4 warnings for VS2017/ARM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eugene@hp.com, liming.gao@intel.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We disable the exact same warnings as IA32 and X64. Also create a dummy macro for PRESERVE8, as this is not supported by the Microsoft ARM assembler. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- MdePkg/Include/Arm/ProcessorBind.h | 96 +++++++++++++++----- 1 file changed, 75 insertions(+), 21 deletions(-) diff --git a/MdePkg/Include/Arm/ProcessorBind.h b/MdePkg/Include/Arm/Proces= sorBind.h index 42ea2f3055f3..afb2f05446f0 100644 --- a/MdePkg/Include/Arm/ProcessorBind.h +++ b/MdePkg/Include/Arm/ProcessorBind.h @@ -1,15 +1,15 @@ /** @file Processor or Compiler specific defines and types for ARM. =20 - Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials =20 - are licensed and made available under the terms and conditions of the BS= D License =20 - which accompanies this distribution. The full text of the license may b= e found at =20 - http://opensource.org/licenses/bsd-license.php = =20 + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php =20 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 **/ =20 @@ -28,14 +28,63 @@ #pragma pack() #endif =20 +#if defined(_MSC_EXTENSIONS) + // -// RVCT does not support the __builtin_unreachable() macro +// Disable some level 4 compilation warnings (same as IA32 and X64) // -#ifdef __ARMCC_VERSION + +// +// Disabling bitfield type checking warnings. +// +#pragma warning ( disable : 4214 ) + +// +// Disabling the unreferenced formal parameter warnings. +// +#pragma warning ( disable : 4100 ) + +// +// Disable slightly different base types warning as CHAR8 * can not be set +// to a constant string. +// +#pragma warning ( disable : 4057 ) + +// +// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this war= ning +// +#pragma warning ( disable : 4127 ) + +// +// This warning is caused by functions defined but not used. For precompil= ed header only. +// +#pragma warning ( disable : 4505 ) + +// +// This warning is caused by empty (after preprocessing) source file. For = precompiled header only. +// +#pragma warning ( disable : 4206 ) + +// +// Disable 'potentially uninitialized local variable X used' warnings +// +#pragma warning ( disable : 4701 ) + +// +// Disable 'potentially uninitialized local pointer variable X used' warni= ngs +// +#pragma warning ( disable : 4703 ) + +#endif + +// +// RVCT and MSFT don't support the __builtin_unreachable() macro +// +#if defined(__ARMCC_VERSION) || defined(_MSC_EXTENSIONS) #define UNREACHABLE() #endif =20 -#if _MSC_EXTENSIONS=20 +#if defined(_MSC_EXTENSIONS) // // use Microsoft* C compiler dependent integer width types // @@ -52,7 +101,7 @@ typedef signed char INT8; #else // - // Assume standard ARM alignment.=20 + // Assume standard ARM alignment. // Need to check portability of long long // typedef unsigned long long UINT64; @@ -121,7 +170,7 @@ typedef INT32 INTN; // use the correct C calling convention. All protocol member functions and // EFI intrinsics are required to modify their member functions with EFIAP= I. // -#define EFIAPI =20 +#define EFIAPI =20 // When compiling with Clang, we still use GNU as for the assembler, so we= still // need to define the GCC_ASM* macros. @@ -142,34 +191,39 @@ typedef INT32 INTN; =20 #define GCC_ASM_EXPORT(func__) \ .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\ - .type ASM_PFX(func__), %function =20 + .type ASM_PFX(func__), %function =20 #define GCC_ASM_IMPORT(func__) \ .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__) - =20 + #else // - // .type not supported by Apple Xcode tools=20 + // .type not supported by Apple Xcode tools // - #define INTERWORK_FUNC(func__) =20 + #define INTERWORK_FUNC(func__) =20 #define GCC_ASM_EXPORT(func__) \ .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \ - =20 - #define GCC_ASM_IMPORT(name) =20 + + #define GCC_ASM_IMPORT(name) =20 #endif +#elif defined(_MSC_EXTENSIONS) + // + // PRESERVE8 is not supported by the MSFT assembler. + // + #define PRESERVE8 #endif =20 /** Return the pointer to the first instruction of a function given a functi= on pointer. - On ARM CPU architectures, these two pointer values are the same,=20 + On ARM CPU architectures, these two pointer values are the same, so the implementation of this macro is very simple. - =20 + @param FunctionPointer A pointer to a function. =20 @return The pointer to the first instruction of a function given a funct= ion pointer. - =20 + **/ #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPoin= ter) =20 --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Apr 26 09:05:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515764031574502.2553634476137; Fri, 12 Jan 2018 05:33:51 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 823E121D2BEE8; Fri, 12 Jan 2018 05:28:33 -0800 (PST) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CC9D921D2BEE0 for ; Fri, 12 Jan 2018 05:28:30 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id 141so11793195wme.3 for ; Fri, 12 Jan 2018 05:33:45 -0800 (PST) Received: from localhost.localdomain ([84.203.42.225]) by smtp.gmail.com with ESMTPSA id c16sm1184952eda.67.2018.01.12.05.33.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 05:33:43 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gDDPqx4BKHyEYrENikRcDbEkuwrHaGaZwzv8VDpRG/E=; b=YIWZdiD3NUn+aWkNQnODMUOvlBahVNnWpwrlDcg5iNJA0za2TTV14UvJxXG1Cy8b0d dDelVAx9sWLV8mzXg0INX/jztU1CZS9xvefyWpnsobz2VUS9r49pL5kAa/gBCRNi97aA dTWFc98Vl6bsjbm7UpYbYxCtI055T7TXTRC8MpNhIUHwl83iKNRw+LyF87IAFeal14eu D1PHbwha7f3RtNUjkebo15G4TYtSO/1yHOzFSsdpMYTEPvg0jcSRCNNBth/yArqEfKe7 6tbq0xT3YQfP3UcTMYPM9WEWIwRh7rrMv4nDH69D/561TRbl71crj9o29waCWpeprZLb +Kig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gDDPqx4BKHyEYrENikRcDbEkuwrHaGaZwzv8VDpRG/E=; b=hZalpodH092cRrk3SaVaKIdG3PqnQzOXdLuHgqkda8Bnjx76C5w/AB7KQQZFJc5cRs NGgswI3E++eeyubHo+mZZqll4NE4hVnbDhqGBUj6uOSFEHyq2yRPWFiKf2+j/aCGB8gr Mfro6p8+phuBD3HW/yAjaurDLJjTjO4fpKgRH1WLGUwwFuZ2+kbokvp1gJ1MQnruOgK1 Ws1ZLFGiWTrjfcEIKTeB01AMlRB1DCMAnNfraS6RfFAVGOKT/YhqbSGM0+1yuLA2mQzk nHToRulYTxj4a4ljBWh1Dsi2oyy1+xAS9KBiupaGd3RlxHtetL5fBXMdJUUTlkI2cuCt Pd2w== X-Gm-Message-State: AKGB3mJmC/D42WctR2gP6SiPrE0FWYSy7hCSCuM8Wl1lDBNF1qBrK7Q7 8TzlkXFai00CHRY6ohqtgArLgWmEG2E= X-Google-Smtp-Source: ACJfBoudxzV3HaNyfXcL7HScH4KxR8MGPG/wCiXoXbWA1CEyNK/3Lk6ggxAyylpUSg006+ImVaTtmQ== X-Received: by 10.80.161.167 with SMTP id 36mr35404977edk.38.1515764024057; Fri, 12 Jan 2018 05:33:44 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Date: Fri, 12 Jan 2018 13:33:27 +0000 Message-Id: <20180112133331.7776-3-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20180112133331.7776-1-pete@akeo.ie> References: <20180112133331.7776-1-pete@akeo.ie> Subject: [edk2] [PATCH v5 2/6] MdePkg/Library/BaseStackCheckLib: Add Null handler for VS2017/ARM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eugene@hp.com, liming.gao@intel.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf | 5 +++-- MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c | 18 ++++++++++++++= ++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf b/MdePk= g/Library/BaseStackCheckLib/BaseStackCheckLib.inf index d02d97107b08..e280651b1199 100644 --- a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf +++ b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf @@ -30,8 +30,9 @@ [Defines] # =20 [Sources] - BaseStackCheckGcc.c | GCC - BaseStackCheckGcc.c | RVCT + BaseStackCheckGcc.c | GCC + BaseStackCheckGcc.c | RVCT + BaseStackCheckNull.c | MSFT =20 [Packages] MdePkg/MdePkg.dec diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c b/MdePkg= /Library/BaseStackCheckLib/BaseStackCheckNull.c new file mode 100644 index 000000000000..ebb387fee5e1 --- /dev/null +++ b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c @@ -0,0 +1,18 @@ +/*++ + + Copyright (c) 2018, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD= License + which accompanies this distribution. The full text of the license may be= found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + +Abstract: + + This file is purely empty as a work around for BaseStackCheck to pass MS= VC build. + +**/ + +extern int __BaseStackCheckNull; --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Apr 26 09:05:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 151576403496351.04809737660935; Fri, 12 Jan 2018 05:33:54 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E25EB21D2BEEB; Fri, 12 Jan 2018 05:28:33 -0800 (PST) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B0A5921D2BEE0 for ; Fri, 12 Jan 2018 05:28:31 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id t8so12105883wmc.3 for ; Fri, 12 Jan 2018 05:33:46 -0800 (PST) Received: from localhost.localdomain ([84.203.42.225]) by smtp.gmail.com with ESMTPSA id c16sm1184952eda.67.2018.01.12.05.33.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 05:33:44 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=u4CKXqpFMI2C1FqAFOKC7cbWc6gnlEg0Eh+ov0SoYW8=; b=gNURxPnm2Rl7tgk9fuIGocnQdRvnmE2utOqoUzUGwBhp7kbE/F3zC49x+EHsG5/F73 JvauRrkOzIADmYhKXLQuYPhdY8HxDf04ArRs/jNlyiquCp37M16ApaBMCRngPn4XTE8Q XyghNnUOKYhQpbQYhG5vOjTg7qQDm+bT/+BiVLni80tQe/r5X6XBBinDB5H4EYjhSnY1 9qw6BcLf7rq9tHg55ZqCp3BiUEJWHjou7VxwQoJtSiTgKxUIl6EEVy4zRqzGLQ+Z1fuv FodYGpYTDmcrFb9eI5rrL2A1JZeQmugETtMVUHskFEwTaxYQamuzMCiXQQyxocK/UnJ4 UePw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=u4CKXqpFMI2C1FqAFOKC7cbWc6gnlEg0Eh+ov0SoYW8=; b=QFz0+n7rMIl1oJ1aI2oieiBpieQBK5UqV6YjBmnEaUcJXh9MlH7985Y2nDKCxdHXAe 4zYgkh34GvOL4U7HvqeySbEAYF101FfjguEqQrNbzSpWlsS6Od69X+KdNsy2nEi6ZbZK Rsx4m0RBfLzS+7uJ/LVQNUWDUJy2kttqBqFMNCRd1HPjppwTC9rhQ3ge4Lwpu8VOGcqz PVp1/m6u0kbN8er/poWnA2CfYuxGzbEMQpUULRIIhapJSX46vxbRHIxBns6f54Qih0Mz mX5jK+HaIoxfzO7So9Nsn25gwTQl582YQTg97cg9dlEqSLltFRpv9LAdEg403UD/ocHq Lizw== X-Gm-Message-State: AKGB3mLBWjn2HW5Xf5WuTbLL9O9ZAt2ZkQUuZ1Jh/WUF8NkXgM7NEsuw 9xaQtoPKqkWI2NT0juJQMdumqNh5rEs= X-Google-Smtp-Source: ACJfBotQ7uyMs5WyrDrtyxR36RnosIyftEO3shjhsBcJFxIhjhaGg0ZA8D0RA8RLs+vuchBTYfNQ5A== X-Received: by 10.80.226.139 with SMTP id p11mr37029661edl.151.1515764025150; Fri, 12 Jan 2018 05:33:45 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Date: Fri, 12 Jan 2018 13:33:28 +0000 Message-Id: <20180112133331.7776-4-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20180112133331.7776-1-pete@akeo.ie> References: <20180112133331.7776-1-pete@akeo.ie> Subject: [edk2] [PATCH v5 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eugene@hp.com, liming.gao@intel.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Most of the RVCT assembly can be reused as is for MSFT except for CpuBreakpoint.asm, which we need to force to Arm mode. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm | 5 ++++- MdePkg/Library/BaseLib/BaseLib.inf | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm b/MdePkg/Library/= BaseLib/Arm/CpuBreakpoint.asm index 8a8065159bf2..e7490b09d3dc 100644 --- a/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm +++ b/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm @@ -16,7 +16,10 @@ =20 EXPORT CpuBreakpoint =20 - AREA Cpu_Breakpoint, CODE, READONLY +; Force ARM mode for this section, as MSFT assembler defaults to THUMB + AREA Cpu_Breakpoint, CODE, READONLY, ARM + + ARM =20 ;/** ; Generates a breakpoint on the CPU. diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/Ba= seLib.inf index fbfb0063b75f..3c07e6bad977 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -824,8 +824,9 @@ [Sources.EBC] [Sources.ARM] Arm/InternalSwitchStack.c Arm/Unaligned.c - Math64.c | RVCT=20 - =20 + Math64.c | RVCT + Math64.c | MSFT + Arm/SwitchStack.asm | RVCT Arm/SetJumpLongJump.asm | RVCT Arm/DisableInterrupts.asm | RVCT @@ -834,7 +835,16 @@ [Sources.ARM] Arm/CpuPause.asm | RVCT Arm/CpuBreakpoint.asm | RVCT Arm/MemoryFence.asm | RVCT -=20 + + Arm/SwitchStack.asm | MSFT + Arm/SetJumpLongJump.asm | MSFT + Arm/DisableInterrupts.asm | MSFT + Arm/EnableInterrupts.asm | MSFT + Arm/GetInterruptsState.asm | MSFT + Arm/CpuPause.asm | MSFT + Arm/CpuBreakpoint.asm | MSFT + Arm/MemoryFence.asm | MSFT + Arm/Math64.S | GCC Arm/SwitchStack.S | GCC Arm/EnableInterrupts.S | GCC --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Apr 26 09:05:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515764039017729.6924276640183; Fri, 12 Jan 2018 05:33:59 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4A1B221D2BEE4; Fri, 12 Jan 2018 05:28:36 -0800 (PST) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2B81521D2BEED for ; Fri, 12 Jan 2018 05:28:34 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id b76so11931617wmg.1 for ; Fri, 12 Jan 2018 05:33:49 -0800 (PST) Received: from localhost.localdomain ([84.203.42.225]) by smtp.gmail.com with ESMTPSA id c16sm1184952eda.67.2018.01.12.05.33.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 05:33:46 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TSmqRIe0T7uYlR3QvkxPcg3LFgI4RH+l2HdsjiGAhLw=; b=cD/z7KkCSPFVTDFh0mTF7/S/d3H/ntjCWKL4brz8NgYkoiuwQwGpmMWWUzHaBCO+ma 6QYF8iMQNPw0tFjEVFpAoJQNDJAudLMHx2YytvG5tebf4T8sUDRJ0tUwuXHlx8u0f+Vf qp03A9hgf6XLzWCKYYK34ymXgdBKRthRruKZVqmxzKma54ELZcepSnxP+MkZxOsAbJ10 PHskPJMy0wCXLSIgiVii6SujlHB2jVR4KYJ1dhG/XqbsXGvn7pZxfupZWcyb3jSMAfi5 bK+gAtjl17kII7858SGytjZNAFz2l7DfjGtw9drcsCKKBoiIELd2pqDZQP1mVUxwxhof JEmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TSmqRIe0T7uYlR3QvkxPcg3LFgI4RH+l2HdsjiGAhLw=; b=Oki1/XU21vauJaV2iUBULTsu/hEIVZZ0qH9/sb+fcj5T73Bi1tvPQM+iotigZqcvVk H4cvyh4SKQS3ZC4VshFDaczPaEZE0NAoXTDl8sDATOvGdONdyVareTjc8ZJ310bii8Tc 4l1crHiJpFRkR+XUHkQNUN9+NxVVJgSJhgPm/JegTNUWoDM9Eukxw/lCLe21otMGjuIU UMJENgRoo0yAys+x2r/W0xKO2Izj5/AjXcCO2gILGZfBOChxJBN2Zxo1xmfmduJ4bTkC sYAoAaz3n3avE572C6nMVNMQaQNvcjqX8g+10OD0c0JdYzMlIHaJOifs2BHnnIBjz6JF Gukw== X-Gm-Message-State: AKGB3mJX1GJ3VbiKfmgAGpzE0jzaeeStMhm05Qms4JHqc9nCxK35+IF6 rzn8mC04wCqLofwj7/2hl3PjLFbxqOI= X-Google-Smtp-Source: ACJfBosS7WCX1AtX5DI4hBxN6OS1ZlUBhKUbkUjvKwKPc1E3IVbH0begE55fa3LlhF6X0Mntuus85g== X-Received: by 10.80.175.165 with SMTP id h34mr35051327edd.272.1515764027482; Fri, 12 Jan 2018 05:33:47 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Date: Fri, 12 Jan 2018 13:33:29 +0000 Message-Id: <20180112133331.7776-5-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20180112133331.7776-1-pete@akeo.ie> References: <20180112133331.7776-1-pete@akeo.ie> Subject: [edk2] [PATCH v5 4/6] ArmPkg/Library/CompilerIntrinsicsLib: Enable VS2017/ARM builds X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eugene@hp.com, liming.gao@intel.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Introduce CRT assembly replacements for __rt_sdiv, __rt_udiv, __rt_udiv64, __rt_sdiv64, __rt_srsh (by reusing the RVCT code) as well as memcpy and memset. For MSFT compatibility, some of the code needs to be explicitly forced to ARM, and the /oldit assembly flag needs to be added. Also, while RVCT_ASM_EXPORT macro invocations have been removed, the replacement code is designed to be as close as possible to the one that would have been generated if using the macros. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm | 43 ++++++= +++++++++++--- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm | 40 ++++++= +++++++----- ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm | 22 +++++-= ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm | 29 ++++++= +++++-- ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf | 16 ++++++= +- ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c | 34 ++++++= ++++++++++ ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c | 33 ++++++= +++++++++ 7 files changed, 185 insertions(+), 32 deletions(-) diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm b/ArmPkg/Libr= ary/CompilerIntrinsicsLib/Arm/div.asm index b539e516892d..f9e0107395f2 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm +++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm @@ -1,6 +1,7 @@ //------------------------------------------------------------------------= ------ // // Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+// Copyright (c) 2018, Pete Batard. All rights reserved.
// // This program and the accompanying materials // are licensed and made available under the terms and conditions of the B= SD License @@ -17,18 +18,19 @@ EXPORT __aeabi_uidivmod EXPORT __aeabi_idiv EXPORT __aeabi_idivmod + EXPORT __rt_udiv + EXPORT __rt_sdiv =20 AREA Math, CODE, READONLY =20 ; ;UINT32 ;EFIAPI -;__aeabi_uidivmode ( -; IN UINT32 Dividen +;__aeabi_uidivmod ( +; IN UINT32 Dividend ; IN UINT32 Divisor ; ); ; - __aeabi_uidiv __aeabi_uidivmod RSBS r12, r1, r0, LSR #4 @@ -40,10 +42,40 @@ __aeabi_uidivmod B __arm_div_large =20 ; +;UINT64 +;EFIAPI +;__rt_udiv ( +; IN UINT32 Divisor, +; IN UINT32 Dividend +; ); +; +__rt_udiv + ; Swap R0 and R1 + MOV r12, r0 + MOV r0, r1 + MOV r1, r12 + B __aeabi_uidivmod + +; +;UINT64 +;EFIAPI +;__rt_sdiv ( +; IN INT32 Divisor, +; IN INT32 Dividend +; ); +; +__rt_sdiv + ; Swap R0 and R1 + MOV r12, r0 + MOV r0, r1 + MOV r1, r12 + B __aeabi_idivmod + +; ;INT32 ;EFIAPI -;__aeabi_idivmode ( -; IN INT32 Dividen +;__aeabi_idivmod ( +; IN INT32 Dividend ; IN INT32 Divisor ; ); ; @@ -152,4 +184,3 @@ __aeabi_idiv0 BX r14 =20 END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm b/ArmPkg/= Library/CompilerIntrinsicsLib/Arm/ldivmod.asm index c71bd59e4520..115a2b9c0e3c 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm +++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm @@ -1,6 +1,7 @@ //------------------------------------------------------------------------= ------ // // Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+// Copyright (c) 2018, Pete Batard. All rights reserved.
// // This program and the accompanying materials // are licensed and made available under the terms and conditions of the B= SD License @@ -13,20 +14,41 @@ //------------------------------------------------------------------------= ------ =20 =20 - EXTERN __aeabi_uldivmod + IMPORT __aeabi_uldivmod + EXPORT __aeabi_ldivmod + EXPORT __rt_sdiv64 =20 - INCLUDE AsmMacroExport.inc + AREA s___aeabi_ldivmod, CODE, READONLY, ARM + + ARM =20 ; -;UINT32 +;INT64 ;EFIAPI -;__aeabi_uidivmode ( -; IN UINT32 Dividen -; IN UINT32 Divisor +;__rt_sdiv64 ( +; IN INT64 Divisor +; IN INT64 Dividend ; ); ; +__rt_sdiv64 + ; Swap r0-r1 and r2-r3 + MOV r12, r0 + MOV r0, r2 + MOV r2, r12 + MOV r12, r1 + MOV r1, r3 + MOV r3, r12 + B __aeabi_ldivmod =20 - RVCT_ASM_EXPORT __aeabi_ldivmod +; +;INT64 +;EFIAPI +;__aeabi_ldivmod ( +; IN INT64 Dividend +; IN INT64 Divisor +; ); +; +__aeabi_ldivmod PUSH {r4,lr} ASRS r4,r1,#1 EOR r4,r4,r3,LSR #1 @@ -39,7 +61,7 @@ L_Test1 RSBS r2,r2,#0 RSC r3,r3,#0 L_Test2 - BL __aeabi_uldivmod ; + BL __aeabi_uldivmod TST r4,#0x40000000 BEQ L_Test3 RSBS r0,r0,#0 @@ -53,5 +75,3 @@ L_Exit POP {r4,pc} =20 END - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm b/ArmPkg/Lib= rary/CompilerIntrinsicsLib/Arm/llsr.asm index 881db106d9d7..abfd7ab64a79 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm +++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm @@ -1,6 +1,7 @@ //------------------------------------------------------------------------= ------ // // Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+// Copyright (c) 2018, Pete Batard. All rights reserved.
// // This program and the accompanying materials // are licensed and made available under the terms and conditions of the B= SD License @@ -12,32 +13,33 @@ // //------------------------------------------------------------------------= ------ =20 + EXPORT __aeabi_llsr + EXPORT __rt_srsh =20 + AREA s___aeabi_llsr, CODE, READONLY, ARM =20 - INCLUDE AsmMacroExport.inc + ARM =20 ; ;VOID ;EFIAPI ;__aeabi_llsr ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINT32 Size -; ); +; IN UINT64 Value, +; IN UINT32 Shift +;) ; - RVCT_ASM_EXPORT __aeabi_llsr +__aeabi_llsr +__rt_srsh SUBS r3,r2,#0x20 - BPL {pc} + 0x18 ; 0x1c + BPL __aeabi_llsr_label1 RSB r3,r2,#0x20 LSR r0,r0,r2 ORR r0,r0,r1,LSL r3 LSR r1,r1,r2 BX lr +__aeabi_llsr_label1 LSR r0,r1,r3 MOV r1,#0 BX lr =20 END - - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm b/ArmPkg/Li= brary/CompilerIntrinsicsLib/Arm/uldiv.asm index 6b6184ebd3fc..aedaac8c6c7f 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm +++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm @@ -1,6 +1,7 @@ //------------------------------------------------------------------------= ------ // // Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+// Copyright (c) 2018, Pete Batard. All rights reserved.
// // This program and the accompanying materials // are licensed and made available under the terms and conditions of the B= SD License @@ -13,9 +14,30 @@ //------------------------------------------------------------------------= ------ =20 =20 + EXPORT __aeabi_uldivmod + EXPORT __rt_udiv64 =20 + AREA s___aeabi_uldivmod, CODE, READONLY, ARM =20 - INCLUDE AsmMacroExport.inc + ARM + +; +;UINT64 +;EFIAPI +;__rt_udiv64 ( +; IN UINT64 Divisor +; IN UINT64 Dividend +; ) +; +__rt_udiv64 + ; Swap r0-r1 and r2-r3 + mov r12, r0 + mov r0, r2 + mov r2, r12 + mov r12, r1 + mov r1, r3 + mov r3, r12 + b __aeabi_uldivmod =20 ; ;UINT64 @@ -25,7 +47,7 @@ ; IN UINT64 Divisor ; ) ; - RVCT_ASM_EXPORT __aeabi_uldivmod +__aeabi_uldivmod stmdb sp!, {r4, r5, r6, lr} mov r4, r1 mov r5, r0 @@ -261,7 +283,6 @@ _ll_div0 b __aeabi_ldiv0 =20 __aeabi_ldiv0 - BX r14 + bx r14 =20 END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf= b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf index 44333141a70a..14e88da7ce06 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf +++ b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf @@ -23,8 +23,12 @@ [Defines] LIBRARY_CLASS =3D CompilerIntrinsicsLib =20 [Sources] - memcpy.c - memset.c + memcpy.c | RVCT + memcpy.c | GCC + memcpy_ms.c | MSFT + memset.c | RVCT + memset.c | GCC + memset_ms.c | MSFT =20 [Sources.ARM] Arm/mullu.asm | RVCT @@ -94,6 +98,10 @@ [Sources.ARM] Arm/llsr.S | GCC Arm/llsl.S | GCC =20 + Arm/div.asm | MSFT + Arm/uldiv.asm | MSFT + Arm/ldivmod.asm | MSFT + Arm/llsr.asm | MSFT =20 [Packages] MdePkg/MdePkg.dec @@ -101,3 +109,7 @@ [Packages] =20 [LibraryClasses] =20 +[BuildOptions] + MSFT:*_*_ARM_CC_FLAGS =3D /GL- + MSFT:*_*_ARM_ASM_FLAGS =3D /oldit + MSFT:*_*_AARCH64_CC_FLAGS =3D /GL- diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c b/ArmPkg/Libr= ary/CompilerIntrinsicsLib/memcpy_ms.c new file mode 100644 index 000000000000..90bbbb930d31 --- /dev/null +++ b/ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------= ------ +// +// Copyright (c) 2017, Pete Batard. All rights reserved.
+// +// This program and the accompanying materials are licensed and made +// available under the terms and conditions of the BSD License which +// accompanies this distribution. The full text of the license may be +// found at http://opensource.org/licenses/bsd-license.php +// +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR +// IMPLIED. +// +//------------------------------------------------------------------------= ------ + +#if defined(_M_ARM64) +typedef unsigned __int64 size_t; +#else +typedef unsigned __int32 size_t; +#endif + +void* memcpy(void *, const void *, size_t); +#pragma intrinsic(memcpy) +#pragma function(memcpy) +void* memcpy(void *dest, const void *src, size_t n) +{ + unsigned char *d =3D dest; + unsigned char const *s =3D src; + + while (n--) + *d++ =3D *s++; + + return dest; +} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c b/ArmPkg/Libr= ary/CompilerIntrinsicsLib/memset_ms.c new file mode 100644 index 000000000000..64205e5d1012 --- /dev/null +++ b/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------= ------ +// +// Copyright (c) 2017, Pete Batard. All rights reserved.
+// +// This program and the accompanying materials are licensed and made +// available under the terms and conditions of the BSD License which +// accompanies this distribution. The full text of the license may be +// found at http://opensource.org/licenses/bsd-license.php +// +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR +// IMPLIED. +// +//------------------------------------------------------------------------= ------ + +#if defined(_M_ARM64) +typedef unsigned __int64 size_t; +#else +typedef unsigned __int32 size_t; +#endif + +void* memset(void *, int, size_t); +#pragma intrinsic(memset) +#pragma function(memset) +void *memset(void *s, int c, size_t n) +{ + unsigned char *d =3D s; + + while (n--) + *d++ =3D (unsigned char)c; + + return s; +} --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Apr 26 09:05:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515764042772397.2353488155637; Fri, 12 Jan 2018 05:34:02 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A6F2E21D2BEF2; Fri, 12 Jan 2018 05:28:36 -0800 (PST) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3240321D2BEE4 for ; Fri, 12 Jan 2018 05:28:35 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id i11so11811074wmf.4 for ; Fri, 12 Jan 2018 05:33:50 -0800 (PST) Received: from localhost.localdomain ([84.203.42.225]) by smtp.gmail.com with ESMTPSA id c16sm1184952eda.67.2018.01.12.05.33.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 05:33:48 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sfHhI01b4vuiWOtzDgw0fXq4bbCIrusOw6A5PKblTFs=; b=rdROhk5dWOF2RtcEs+sZPwtdFDWLtbw52OxeeriDehee8Aurch8k0h1Qq41umbcQnJ 5awGMaQqkH4dQ2mCFAMoUSBlrGhENbu+4dVM4qp02xUvcqx1SoiS45kY1ArvhXt3QHSv f7JAWfMxzDpNnw22SnzVrG/XPUrxUePCkMsKfuZpY5Ru//GVatODsAOXNNbOP2rCms5c GqAL/z84Fi+TexGGwVYsfaVprFcfphCCKSvck8OKWP1fpsDEPnf4rgePEI4AY4MiHEp6 Iot0NdfDucgxqUIX6Co55Sm9PxKFAaVd2YcyLIlC93jZDz8HoMJ/uTvSsdBMBM2a7tdO O3ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sfHhI01b4vuiWOtzDgw0fXq4bbCIrusOw6A5PKblTFs=; b=iUtIkGCNLxDgVEwXoXgVUxTC4TsFGIuDs2Hp6hhN7ttGPq/L11++7lp349QF/LLQ+k +saMuXIZUM9qzqqbdKCmHAqIixADV54gujeZcEKb8WxIuJmRRXyZ5Qc4+arYFdnSj/xQ b4Es4/xPAjrYSm+SK89aKXnodMMXt4DcL1xX3P5ekd+WbigYkChzytyTzBs0j+clPxQa ixDOpsxTJysV5au4ibQosa+W53n/2v0BRY+bBjf7BOTjrrUISIunXrKQ2n8tnLlp8QqY d+VZflHmbYp7UWeK7OfuX4n9o0vq/oTKKF7CAoVh2DSHLE+QEl4mLYbGD/j3zi3qOcLb qWgw== X-Gm-Message-State: AKGB3mKEE9q5Y3fHhBxybO90Bdrnb8+ingi9CEkYwgXQs5rkQdlHaBNT U5iM9fyxG1Ns7jpfiEkzuFfeH+C8Yiw= X-Google-Smtp-Source: ACJfBoshXEgp3qD8hnfgJXv/FzBHHQP/xzmIs2fpkxZp2xiThm4OHa3QRXXMi4snXjIsDNFwPo6EBQ== X-Received: by 10.80.179.45 with SMTP id q42mr36191907edd.71.1515764028659; Fri, 12 Jan 2018 05:33:48 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Date: Fri, 12 Jan 2018 13:33:30 +0000 Message-Id: <20180112133331.7776-6-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20180112133331.7776-1-pete@akeo.ie> References: <20180112133331.7776-1-pete@akeo.ie> Subject: [edk2] [PATCH v5 5/6] MdePkg/Include: Add VA list support for VS2017/ARM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eugene@hp.com, liming.gao@intel.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" VA_START, VA_END and VA_COPY are the same as the generic macros. VA_ARG was reverse engineered from MS ARM assembly output. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- MdePkg/Include/Base.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 29db8a253e2f..7152ccda9764 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -660,6 +660,19 @@ struct _LIST_ENTRY { =20 #define VA_COPY(Dest, Start) __va_copy (Dest, Start) =20 +#elif defined(_M_ARM) +// +// MSFT ARM variable argument list support. +// Same as the generic macros below, except for VA_ARG that needs extra ad= justment. +// + +typedef char* VA_LIST; + +#define VA_START(Marker, Parameter) (Marker =3D (VA_LIST) ((UINTN) & (= Parameter) + _INT_SIZE_OF(Parameter))) +#define VA_ARG(Marker, TYPE) (*(TYPE *) ((Marker +=3D _INT_SIZE= _OF(TYPE) + ((-(INTN)Marker) & (sizeof(TYPE) - 1))) - _INT_SIZE_OF (TYPE))) +#define VA_END(Marker) (Marker =3D (VA_LIST) 0) +#define VA_COPY(Dest, Start) ((void)((Dest) =3D (Start))) + #elif defined(__GNUC__) =20 #if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS) --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Apr 26 09:05:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515764047283321.6528796402754; Fri, 12 Jan 2018 05:34:07 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0FFBF21D2BEF3; Fri, 12 Jan 2018 05:28:38 -0800 (PST) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AD1FF21D2BEF3 for ; Fri, 12 Jan 2018 05:28:36 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id b76so11931907wmg.1 for ; Fri, 12 Jan 2018 05:33:51 -0800 (PST) Received: from localhost.localdomain ([84.203.42.225]) by smtp.gmail.com with ESMTPSA id c16sm1184952eda.67.2018.01.12.05.33.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 05:33:49 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IFvJzy0081KNc0CIuzj8zaQxoUjssOhJ9JyLfsEMoww=; b=KvhbmMk+ACO3lHWUPkXkf29MMG/iskAGE1nIQjjKPPN1s5MLSbgAsRzTkpW6SYE94K d3ewvFoo2MFZ0mIx1ns9cWaGdKWOJqJSLMEKmMv5xMfUXz16rXz1BPAqPCrMH2bQ7PNn EtYZvSk4TAYfKuBzWTE2D7t6LTLkxvmWN8vXChYiigumVhGp14yoJSMhXmB9h/DpWG7t fIJS0mLctkUbhcfBsQRi37A+T4pX4AItPbtbT5a9IxCNQvLMRRPw7Y+PGLjgS6Hu2nkr TFfuRqe8UVKQkNFBqFWgQB5+SeQQeiIkoNSWpM9G67KAVwnZtVcVW/Dw4iOlNaMh0eZF V0qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IFvJzy0081KNc0CIuzj8zaQxoUjssOhJ9JyLfsEMoww=; b=VfdhQHasPJ2cIUF230qMBR5IwYKOrpSZJ4q8r01wFvf4kGaLWECMkjeOgvXndthIu4 7mXg0zuWNDhnPttoQfGekbIXjYausEIrzbAlB+CfPJ8dZtxaa5tJgv2s2Mv1Z9OL2qTS qUA41V9un4FODweM59WF1Kj7/EOfdy96Di0weEWdjPdD5kpaqNoNtRw1oDcabS/HHyld ergWHaci92cuXcGzNeKfw4e2+GTpMsxmVj2PUIWN22CG03jz1XlmnJFHO8KOMcJcAbe7 jjkg/fgFMdrLfekovOBsUSFrhbnR0UNh7zFCm1CujnY3gybKcGiXt9uVp1seGpsby2hx 7LNQ== X-Gm-Message-State: AKwxytfeeoAThKFGKTacNKHb5Hb8LRO0Yq0jwOv/ALl9iQBQGsnHB9X5 z98/T0wpeWtfYim629Tqk2hm8x8QvHk= X-Google-Smtp-Source: ACJfBotNTfGRuKR/j+65DsYE/7KkVhuNe3RYwAY5T4T543MZv1ZXzuQ7pmSRceNXEjM0GtSwCnsRVQ== X-Received: by 10.80.135.205 with SMTP id 13mr7047242edz.253.1515764029946; Fri, 12 Jan 2018 05:33:49 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Date: Fri, 12 Jan 2018 13:33:31 +0000 Message-Id: <20180112133331.7776-7-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20180112133331.7776-1-pete@akeo.ie> References: <20180112133331.7776-1-pete@akeo.ie> Subject: [edk2] [PATCH v5 6/6] BaseTools/Conf: Add VS2017/ARM support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eugene@hp.com, liming.gao@intel.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We duplicate the Assembly-Code-File section from build_rule.template because --convert-hex cannot be used with the MSFT ARM assembler. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- BaseTools/Conf/build_rule.template | 31 +++++++++++++++++++- BaseTools/Conf/tools_def.template | 31 ++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule= .template index 3e6aa8ff0f34..6ea14fb7aa02 100755 --- a/BaseTools/Conf/build_rule.template +++ b/BaseTools/Conf/build_rule.template @@ -182,7 +182,6 @@ =20 =20 - [Assembly-Code-File.COMMON.COMMON] ?.asm, ?.Asm, ?.ASM @@ -207,6 +206,36 @@ # For RVCTCYGWIN ASM_FLAGS must be first to work around pathing is= sues "$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii =20 +[Assembly-Code-File.COMMON.ARM] + # Remove --convert-hex for ARM as it breaks MSFT assemblers + + ?.asm, ?.Asm, ?.ASM + + + ?.S, ?.s + + + $(MAKE_FILE) + + + $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj + + + "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i + Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_ba= se}.iii ${d_path}(+)${s_base}.i + "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s= _base}.iii + + + "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i + Trim --source-code --trim-long -o ${d_path}(+)${s_base}.iii ${d_pa= th}(+)${s_base}.i + "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s= _base}.iii + + + "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i + Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iii ${d_pa= th}(+)${s_base}.i + # For RVCTCYGWIN ASM_FLAGS must be first to work around pathing is= sues + "$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii + [Nasm-Assembly-Code-File.COMMON.COMMON] ?.nasm diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate index 98ab6dd45e81..f76c4da05938 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -79,6 +79,7 @@ DEFINE VS2017_HOST =3D x86 DEFINE VS2017_BIN_HOST =3D DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\DEF(VS2= 017_HOST) DEFINE VS2017_BIN_IA32 =3D DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x86 DEFINE VS2017_BIN_X64 =3D DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x64 +DEFINE VS2017_BIN_ARM =3D DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm =20 DEFINE WINSDK_BIN =3D ENV(WINSDK_PREFIX) DEFINE WINSDKx86_BIN =3D ENV(WINSDKx86_PREFIX) @@ -335,6 +336,9 @@ DEFINE DTC_BIN =3D ENV(DTC_PREFIX)dtc # Required to build platforms or ACPI tables: # Intel(r) ACPI Compiler (iasl.exe) from # https://acpica.org/downloads +# Note: +# Building of XIP firmware images for ARM is n= ot currently supported (only applications). +# /FILEALIGN:4096 and other changes are needed= for ARM firmware builds. # DDK3790 -win32- Requires: # Microsoft Windows Server 2003 Driver Develop= ment Kit (Microsoft WINDDK) version 3790.1830 # Optional: @@ -4169,6 +4173,33 @@ NOOPT_VS2017_X64_NASM_FLAGS =3D -O0 -f win64 -g RELEASE_VS2017_X64_DLINK_FLAGS =3D /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IG= NORE:4254 /OPT:REF /OPT:ICF=3D10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:= .pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI= _BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=3D.data NOOPT_VS2017_X64_DLINK_FLAGS =3D /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OP= T:REF /OPT:ICF=3D10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Mac= hine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE= _DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG =20 +################# +# ARM definitions +################# +*_VS2017_ARM_CC_PATH =3D DEF(VS2017_BIN_ARM)\cl.exe +*_VS2017_ARM_VFRPP_PATH =3D DEF(VS2017_BIN_ARM)\cl.exe +*_VS2017_ARM_SLINK_PATH =3D DEF(VS2017_BIN_ARM)\lib.exe +*_VS2017_ARM_DLINK_PATH =3D DEF(VS2017_BIN_ARM)\link.exe +*_VS2017_ARM_APP_PATH =3D DEF(VS2017_BIN_ARM)\cl.exe +*_VS2017_ARM_PP_PATH =3D DEF(VS2017_BIN_ARM)\cl.exe +*_VS2017_ARM_ASM_PATH =3D DEF(VS2017_BIN_ARM)\armasm.exe +*_VS2017_ARM_ASLCC_PATH =3D DEF(VS2017_BIN_ARM)\cl.exe +*_VS2017_ARM_ASLPP_PATH =3D DEF(VS2017_BIN_ARM)\cl.exe +*_VS2017_ARM_ASLDLINK_PATH =3D DEF(VS2017_BIN_ARM)\link.exe + + *_VS2017_ARM_MAKE_FLAGS =3D /nologo + DEBUG_VS2017_ARM_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D = UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw /Oi- +RELEASE_VS2017_ARM_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D = UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /Oi- +NOOPT_VS2017_ARM_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D = UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od /Oi- + + DEBUG_VS2017_ARM_ASM_FLAGS =3D /nologo /g +RELEASE_VS2017_ARM_ASM_FLAGS =3D /nologo +NOOPT_VS2017_ARM_ASM_FLAGS =3D /nologo + + DEBUG_VS2017_ARM_DLINK_FLAGS =3D /NOLOGO /NODEFAULTLIB /IGNORE:4001 /= OPT:REF /OPT:ICF=3D10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM= /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER = /SAFESEH:NO /BASE:0 /DRIVER /DEBUG +RELEASE_VS2017_ARM_DLINK_FLAGS =3D /NOLOGO /NODEFAULTLIB /IGNORE:4001 /= IGNORE:4254 /OPT:REF /OPT:ICF=3D10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D= /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SE= RVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=3D.data +NOOPT_VS2017_ARM_DLINK_FLAGS =3D /NOLOGO /NODEFAULTLIB /IGNORE:4001 /= OPT:REF /OPT:ICF=3D10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM= /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER = /SAFESEH:NO /BASE:0 /DRIVER /DEBUG + ################## # EBC definitions ################## --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel