From patchwork Sun Jul 17 10:34:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 72169 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp175516qga; Sun, 17 Jul 2016 03:35:03 -0700 (PDT) X-Received: by 10.66.138.74 with SMTP id qo10mr46834154pab.135.1468751702021; Sun, 17 Jul 2016 03:35:02 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id ww2si20557486pac.48.2016.07.17.03.35.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jul 2016 03:35:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6D7FC1A1E31; Sun, 17 Jul 2016 03:35:47 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 E993B1A1E03 for ; Sun, 17 Jul 2016 03:35:45 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id f65so72597340wmi.0 for ; Sun, 17 Jul 2016 03:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l3uT1aeuhJV4uWWH54+Lo7oc4QsK3GJZxaUSaGxC6/8=; b=T1cOSFbRt2Tmb00ESJUimjfnxvm16a4AD+uCpN8OlAKvRyEmQKZTSL3Mw0ZkAkfe4M LSD2A+ghhlN1WyO5sgiDIJdBXlktyBFXwIFQrIZNx6LkO1e4NR25TFiSvU4TPv9O3yqs Ua95voJNR+jAWKSpKgd94jQ9RpX46IcLKMlek= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l3uT1aeuhJV4uWWH54+Lo7oc4QsK3GJZxaUSaGxC6/8=; b=JSAjBc4FnV6lOlZpDlDoexR2VSNSwVEzgot3VoOgCDB4kl1CGy6S+7I86PtXfZDyld cjfddMHGmQtmml7J+r/IqUYn7OukQRqGOZAe9H75StPHlKQWbfghpxD+5DFPsBZqCn/R shs6Uv2dBDSAR0MLbg7mfpWXUDze/cbRYEP/7nQl3ja8njFqC/a5PDEt3Xc8jaxUO0uR piGwSxiR9fIbyjvoy/2EatywnWaA/dgHPirvIgPjH8UPmVYk+mjXg1wI5TD3S6fArA1O y8ffONN00ApCN5QrMuiKUBbsPTFI3P8ITGBlavdwW9c+Wz0e3Gb9U2yU2gpGlIUrVP46 iwCQ== X-Gm-Message-State: ALyK8tJqptk8lSXHQ2n6pRC6gG8x9k8QzFED2eBChfgemgv8TTNlJ0D0EsbWBYCR9P6RMDt/ X-Received: by 10.28.130.208 with SMTP id e199mr873063wmd.14.1468751696172; Sun, 17 Jul 2016 03:34:56 -0700 (PDT) Received: from localhost.localdomain (ip16-2-212-87.adsl2.static.versatel.nl. [87.212.2.16]) by smtp.gmail.com with ESMTPSA id d64sm7075922wmc.22.2016.07.17.03.34.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Jul 2016 03:34:55 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com, afish@apple.com, liming.gao@intel.com, steven.shi@intel.com, yonghong.zhu@intel.com, michael.d.kinney@intel.com, jordan.l.justen@intel.com Date: Sun, 17 Jul 2016 12:34:41 +0200 Message-Id: <1468751686-28047-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468751686-28047-1-git-send-email-ard.biesheuvel@linaro.org> References: <1468751686-28047-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v3 4/9] EdkCompatibilityPkg: Enable new MS VA intrinsics for GNUC x86 64bits build X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: bruce@cran.org.uk, pbonzini@redhat.com, Ard Biesheuvel , ting.ye@intel.com, qin.long@intel.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Align EdkCompatibilityPkg with this change from MdePkg Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) -- 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h b/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h index 94b93ea4d17b..cd3255310556 100644 --- a/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h +++ b/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h @@ -93,6 +93,30 @@ Abstract: #define VA_COPY(Dest, Start) __va_copy (Dest, Start) #elif defined(__GNUC__) && !defined(NO_BUILTIN_VA_FUNCS) + +#if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS) +// +// X64 only. Use MS ABI version of GCC built-in macros for variable argument lists. +// +/// +/// Both GCC and LLVM 3.8 for X64 support new variable argument intrinsics for Microsoft ABI +/// + +/// +/// Variable used to traverse the list of arguments. This type can vary by +/// implementation and could be an array or structure. +/// +typedef __builtin_ms_va_list VA_LIST; + +#define VA_START(Marker, Parameter) __builtin_ms_va_start (Marker, Parameter) + +#define VA_ARG(Marker, TYPE) ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE))) + +#define VA_END(Marker) __builtin_ms_va_end (Marker) + +#define VA_COPY(Dest, Start) __builtin_ms_va_copy (Dest, Start) + +#else // // Use GCC built-in macros for variable argument lists. // @@ -111,6 +135,8 @@ typedef __builtin_va_list VA_LIST; #define VA_COPY(Dest, Start) __builtin_va_copy (Dest, Start) +#endif + #else #ifndef VA_START