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::22c; helo=mail-wm0-x22c.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 6ECB322436929 for ; Fri, 23 Feb 2018 01:44:13 -0800 (PST) Received: by mail-wm0-x22c.google.com with SMTP id x7so1176693wmc.0 for ; Fri, 23 Feb 2018 01:50:14 -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; bh=oDySkUtQ0SwAj3zhTfklDe/Bus71mJdV3d9EBCYXE94=; b=yI+YpHT3eD9oz3PckBuxRva0lFQJ8lQYZAz6kNj0p2cO+GwJ/FfoJl18+FOkd/JOTe tbqqoh/plGxjULCtm9r0AlQOpTf3LsN9anS1U+uN7g6INWWHhUknk6Zm4NkBYIBDpiP9 h9M2l03DSmdJYJWSDPWk8zksDd3hibMaINuCoeFOkuiUUucLsXzSXCoC5gsgCAd3S+yD B5KzvnuhxnJSobJavqLz11m2h7EciO7Oqmo5c+SYkt87jiveE96XCa6YkZS7Im1dYuDf gEuKpFodOhlKyICOBXAju0RAPftq4YWkhUZ0mCc5MH3g87l8eL/19Jh3Ga/9lO58R9ly h0vA== 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; bh=oDySkUtQ0SwAj3zhTfklDe/Bus71mJdV3d9EBCYXE94=; b=YpzqA5aqWpKtv4cVw3S2yLA8gpg8n2DjFFj6keYRFmzJMgoD3ZFYiZEBM0ZUMmvhOb JCMW7F9k89WKJccBUj6+8lGBuKGkj05M0r8PqVtYTzT1b2Uh3r4ay4hkQ7ZZuNu7c9E7 5HvvKFDKXecihLR5PhF5L8Az+qbf5Gv3RBTj3iSu4lFzIOKH7W6tNrIUPE+FiufQG4rZ RQkEmIaBP+rIc0OdfPhwZvV3JqEDnLhlJcg33Rim90aT1P5T78V90pN0ZCgUkTzyK8nL ELAiXU+ZoLNUkyWPdmjjQ+nGP3IuE+zVcyCorzCZZ0ZHUgXfAbzuIZwH2a/S7xPh8L3Q LeVQ== X-Gm-Message-State: APf1xPA9caZo7tIpJsFjuBmLCIMpDkz5ALKqEp9e3JpGFndY/IcVY+8+ TFZTUBme9qAiX9w++ySB7Te47hC90ZM= X-Google-Smtp-Source: AH8x227JUCyCbBH9KxB88FkYVzm1qumeSQ2XgxsSd5URDJn+AN7i2Ykg/HjOsdcBizGXgWgKev4Zfg== X-Received: by 10.80.219.201 with SMTP id s9mr2075771edk.198.1519379412753; Fri, 23 Feb 2018 01:50:12 -0800 (PST) Received: from localhost.localdomain ([84.203.54.151]) by smtp.gmail.com with ESMTPSA id z11sm1640521edh.94.2018.02.23.01.50.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Feb 2018 01:50:12 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Cc: liming.gao@intel.com, ard.biesheuvel@linaro.org Date: Fri, 23 Feb 2018 09:49:59 +0000 Message-Id: <20180223095003.6012-1-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 Subject: [PATCH 0/4] Add ARM64 support for VS2017 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, 23 Feb 2018 09:44:15 -0000 This is v2, which just removes a redundant #if defined(_MSC_EXTENSIONS) in 1/4. This series completes VS2017 support by enabling AARCH64 compilation. * PATCH 1 targets the disabling of VS Level 4 warnings. The disabled warnings for ARM64 are the same as the ones for IA32, X64 and ARM. * PATCH 2 adds assembly source in MdePkg/Library/BaseLib for various low level required functions. These new assembly files were converted from their GCC version, with minor changes applied to make them palatable to the MSFT assembler. * PATCH 3 adds variable argument handlers for print output. This is achieved without relying on any external toolchain headers. However a call to the __va_start() compiler intrinsic function is now being used for the VA_START macros, which we apply for ARM as well. * PATCH 4 enables the selection of ARM64 in the conf templates. One item of note is that the build options for ARM64 are the same as for ARM, except for /BASE:0 which was removed to avoid error: 'invalid base address 0x0; ARM64 image cannot have base address below 4GB' With these patches, VS2017 toolchain users should be able to compile regular UEFI ARM64 applications using EDK2. Note however that ARM64 support requires the use of Visual Studio 2017 Update 4 or later (a.k.a. v15.4), as native ARM64 compilation was not included in any version of Visual Studio prior to that. Additional notes: We tested compiling and running the full UEFI Shell with this series, as well as a small set of applications and drivers, and saw no issues. Since we also modified the VA_START() macro for ARM, we also re-ran similar tests for ARM, to confirm that there was no regression there. Finally, we did not test the generation of a complete QEMU ARM64 firmware as it requires porting a handful of assembly sources, that don't exist yet, and our focus is with the generation of working AARCH64 drivers or applications. Hopefully, this can be tackled as VS2017/ARM64 sees more usage... Regards, /Pete Pete Batard (4): MdePkg: Disable some Level 4 warnings for VS2017/ARM64 MdePkg/Library/BaseLib: Enable VS2017/ARM64 builds MdePkg/Include: Add VA list support for VS2017/ARM64 BaseTools/Conf: Add VS2017/ARM64 support BaseTools/Conf/build_rule.template | 2 +- BaseTools/Conf/tools_def.template | 32 ++++++- MdePkg/Include/AArch64/ProcessorBind.h | 53 +++++++++- MdePkg/Include/Base.h | 7 +- MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm | 39 ++++++++ MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm | 37 +++++++ MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm | 37 +++++++ MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm | 49 ++++++++++ MdePkg/Library/BaseLib/AArch64/MemoryFence.asm | 38 ++++++++ MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 101 ++++++++++++++++++++ MdePkg/Library/BaseLib/AArch64/SwitchStack.asm | 69 +++++++++++++ MdePkg/Library/BaseLib/BaseLib.inf | 8 ++ 12 files changed, 463 insertions(+), 9 deletions(-) create mode 100644 MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm create mode 100644 MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm create mode 100644 MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm create mode 100644 MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm create mode 100644 MdePkg/Library/BaseLib/AArch64/MemoryFence.asm create mode 100644 MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm create mode 100644 MdePkg/Library/BaseLib/AArch64/SwitchStack.asm -- 2.9.3.windows.2