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::244; helo=mail-wm0-x244.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org 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 2AC1522152380 for ; Mon, 4 Dec 2017 05:07:53 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id g130so14620616wme.0 for ; Mon, 04 Dec 2017 05:12:22 -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=6uGsx09Moxlje/UZ5Hx9/V3qszP2nhoPszGNmatid/A=; b=AqDMhwolii95OLk0OeRoQqBIVjR61DxrAXC+gye+pBtaLigv0ci8f2/XxEPicOPCLJ tB+ecaovWT+ysDNnjr3yBzTvIlGmw+oMs7BIyp9XgngYon7+wC6Outz+a6sBlQlpz4JN +rcoAt8JSyASmeAkJ5xcpOe7wSFTk/xA6gvxWumUOnlt2L54DMga+oFMf/isV03ZoFSv GZ5omd4kV91/7bilypfsRhQYGuaYBusk5OWEl2DGlG2sRz40xVJnOtzP2TiNgctI5dDr yuiZeCXPBgFZ0IrJ2MbtR/ckIL69qh8d5hT26NHHLTtoY0S1kd+NP8TjD2Gs5yzFrpxg V7Nw== 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=6uGsx09Moxlje/UZ5Hx9/V3qszP2nhoPszGNmatid/A=; b=DZFRgY9Qwe6iKGmDqT0xnLvUTj7j2w4POXj0K9updm16kMB8sAVkSKODyIhTZmqOl4 poSjG81MS5e4ULfQvvGajV+w/MOveYp+2+R8qvEWOUckwWs0tN12yIzB/mnA7coWLre5 4lBgenhv1USoYboqG68ZD+YFjnvf5MhS0Zgf/zrLEBNkfi6KZjC+EfYmHwZTVkUz0ewd MnOMlABWyT5w+mp7GtVW8R7jJGP0iSRHi0zAVvoIPYfSn3dU8/pNsLSbWwEh2nW+ILCA lIV/GPGEyfxN30cSNtKsiKRNdB5boRzRqBAwA+AfjIAcMEbwofCTzHtHL9LWBDvEcs0/ UWHA== X-Gm-Message-State: AJaThX4GW2EgPxt8ugifj1qzYHwCQDL33mJYX1SfiKBxjCW+m2aeQA1Y QKMysybhYJBJ4xsF/cYKHkSirIEIHw8= X-Google-Smtp-Source: AGs4zMYIicyo4OnSEf9VUu/eAgRWb08vQWIjKb3Ff/TD2+y1urOQFQyzZgDTh5Tcxtx2EiKT0kCVbA== X-Received: by 10.80.137.106 with SMTP id f39mr31444912edf.148.1512393141522; Mon, 04 Dec 2017 05:12:21 -0800 (PST) Received: from localhost.localdomain ([84.203.42.156]) by smtp.gmail.com with ESMTPSA id y3sm7936797edb.37.2017.12.04.05.12.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 05:12:20 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Cc: liming.gao@intel.com Date: Mon, 4 Dec 2017 13:12:04 +0000 Message-Id: <20171204131205.11304-6-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20171204131205.11304-1-pete@akeo.ie> References: <20171204131205.11304-1-pete@akeo.ie> Subject: [PATCH 5/6] MdePkg/Include: Add VA list support for VS2017/ARM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2017 13:07:53 -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 02140a5ac2ee..f3467ecdc22f 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -631,6 +631,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