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 22E012217CE3E for ; Fri, 8 Dec 2017 06:03:10 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id l141so3495750wmg.1 for ; Fri, 08 Dec 2017 06:07:44 -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=UGnqYkOiQ0AX9GviCv/fXF6GnE/C+zF5sBDYKGLf+REeEy/HGSsrMJzXv7g4Pj+uod ypvH7x6yuQAsi/iEe7T0NOHAhfXLt+hXnW0Dtratk4l+eQApH8D2JEXAL3DmSlM70Bji Z0ze/f9+V5CNyiqa7ejMQj9ZClJydQkU2/zMRlpEyQUMVj44SLzV4vnmWl4acMnVbFgW rcT+7dPRryOTg1GZ8VJy0duzEYu2WVoWdwT7tlonsevdCRtBX2pxgX3ANp/zjHzcNWoJ pGYcL1TMEKTlGz5GOXrboSVAxk/pnBivQuv31D3r93FYrC9YIf5weA7yZlBAO3BqGPJT HTew== 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=a/X2OKpYWhxXvSqakwtRacJpEQHoxSID5w9iVaSvUqu0PamofzevLw2rAAHA7j1YxJ kkxr0Eg1WwFgN1Ilw1ErrqcP2Jl2OA4SeqrMELsH9yR0diS8Yr9I7mXYXohjIWPUfqBU n2Z41uGkGtXRqu3CWnWGkYbP/SyGyFSXnBY66XeVnqjjzyqaEsbO29HVLjgn8kidweAs qXT3GVtcTfIqj2yGOphQmYiFN7iJuuFReu3OH8tLRD++r//4jCRoIGcoRBpHq0rdlfwB QrcX9O71etpJmnspCAEYNS++OSyz64r/5Z44+V2BBLNb+qzWhBCv75INcxaHFnDTgV/V RiYg== X-Gm-Message-State: AJaThX6/u5otzzuDcVlReotXxfpqJXXuCREiQHtfCsWXW3xGrngHus4v JCV1TiEX6D8PeGN/lK/IEX9uZJOOB+g= X-Google-Smtp-Source: AGs4zMZxWV6ApNuFbyNIVv7On8fQyxrpdEa8QhwNQFnRnc/wctM2PJc4gUMVptg2Jw2URir6Ums3AA== X-Received: by 10.80.205.156 with SMTP id p28mr51074779edi.255.1512742062942; Fri, 08 Dec 2017 06:07:42 -0800 (PST) Received: from localhost.localdomain ([84.203.66.92]) by smtp.gmail.com with ESMTPSA id c33sm3423442edd.36.2017.12.08.06.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Dec 2017 06:07:42 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Cc: liming.gao@intel.com Date: Fri, 8 Dec 2017 14:06:30 +0000 Message-Id: <20171208140631.4252-6-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20171208140631.4252-1-pete@akeo.ie> References: <20171208140631.4252-1-pete@akeo.ie> Subject: [PATCH v3 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: Fri, 08 Dec 2017 14:03:10 -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