From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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) 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) 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) From: Pete Batard To: edk2-devel@lists.01.org Cc: liming.gao@intel.com, ard.biesheuvel@linaro.org, eugene@hp.com 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: [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: , X-List-Received-Date: Fri, 12 Jan 2018 13:28:35 -0000 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 --- 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 { #define VA_COPY(Dest, Start) __va_copy (Dest, Start) +#elif defined(_M_ARM) +// +// MSFT ARM variable argument list support. +// Same as the generic macros below, except for VA_ARG that needs extra adjustment. +// + +typedef char* VA_LIST; + +#define VA_START(Marker, Parameter) (Marker = (VA_LIST) ((UINTN) & (Parameter) + _INT_SIZE_OF(Parameter))) +#define VA_ARG(Marker, TYPE) (*(TYPE *) ((Marker += _INT_SIZE_OF(TYPE) + ((-(INTN)Marker) & (sizeof(TYPE) - 1))) - _INT_SIZE_OF (TYPE))) +#define VA_END(Marker) (Marker = (VA_LIST) 0) +#define VA_COPY(Dest, Start) ((void)((Dest) = (Start))) + #elif defined(__GNUC__) #if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS) -- 2.9.3.windows.2