diff --git a/CompilerIntrinsicsLib.inf b/CompilerIntrinsicsLib.inf deleted file mode 100644 index 1472bec..0000000 --- a/CompilerIntrinsicsLib.inf +++ /dev/null @@ -1,51 +0,0 @@ -#/*++ -# -# Copyright (c) 2017, Pete Batard. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Abstract: -# -# Intrinsics required to compile EfiFs with MSFT. -# -#--*/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = CompilerIntrinsicsLib - FILE_GUID = B11194CC-A4AA-4886-8241-101F3DAD8BEF - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = CompilerIntrinsicsLib - -# -# VALID_ARCHITECTURES = IA32 -# - -[Sources.IA32] - # Compiler helper (C RunTime) functions - ../StdLib/LibC/CRT/Ia32/llmul.c | MSFT # __allmul - ../StdLib/LibC/CRT/Ia32/llshl.c | MSFT # __allshl - ../StdLib/LibC/CRT/Ia32/llshr.c | MSFT # __allshr - ../StdLib/LibC/CRT/Ia32/ulldiv.c | MSFT # __aulldiv - ../StdLib/LibC/CRT/Ia32/ullrem.c | MSFT # __aullrem - ../StdLib/LibC/CRT/Ia32/ullshr.c | MSFT # __aullshr - ../StdLib/LibC/CRT/Ia32/lldiv.c | MSFT # __alldiv - ../StdLib/LibC/CRT/Ia32/llrem.c | MSFT # __allrem - ../StdLib/LibC/CRT/Ia32/lldvrm.c | MSFT # __alldvrm - ../StdLib/LibC/CRT/Ia32/ulldvrm.c | MSFT # __aulldvrm - -[Packages] - MdePkg/MdePkg.dec - ArmPkg/ArmPkg.dec - -[LibraryClasses] - -[BuildOptions] - MSFT:*_*_IA32_CC_FLAGS = /GL- - MSFT:*_*_IA32_DLINK_FLAGS = /INCLUDE:_MultS64x64 \ No newline at end of file diff --git a/CompilerIntrinsicsLib/CRT/Ia32/License.txt b/CompilerIntrinsicsLib/CRT/Ia32/License.txt new file mode 100644 index 0000000..130d11c --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/License.txt @@ -0,0 +1,51 @@ +Copyright (c) 2019, TianoCore and contributors. All rights reserved. + +SPDX-License-Identifier: BSD-2-Clause-Patent + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +Subject to the terms and conditions of this license, each copyright holder +and contributor hereby grants to those receiving rights under this license +a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except for failure to satisfy the conditions of this license) patent +license to make, have made, use, offer to sell, sell, import, and otherwise +transfer this software, where such license applies only to those patent +claims, already acquired or hereafter acquired, licensable by such copyright +holder or contributor that are necessarily infringed by: + +(a) their Contribution(s) (the licensed copyrights of copyright holders and + non-copyrightable additions of contributors, in source or binary form) + alone; or + +(b) combination of their Contribution(s) with the work of authorship to + which such Contribution(s) was added by such copyright holder or + contributor, if, at the time the Contribution is added, such addition + causes such combination to be necessarily infringed. The patent license + shall not apply to any other combinations which include the + Contribution. + +Except as expressly stated above, no rights or licenses from any copyright +holder or contributor is granted under this license, whether expressly, by +implication, estoppel or otherwise. + +DISCLAIMER + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/CompilerIntrinsicsLib/CRT/Ia32/Readme.txt b/CompilerIntrinsicsLib/CRT/Ia32/Readme.txt new file mode 100644 index 0000000..f59cf0d --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/Readme.txt @@ -0,0 +1,4 @@ +These files were taken from the edk2-libc project: +https://github.com/tianocore/edk2-libc/tree/master + +They are licensed under a BSD-2-Clause-Patent license. \ No newline at end of file diff --git a/CompilerIntrinsicsLib/CRT/Ia32/lldiv.c b/CompilerIntrinsicsLib/CRT/Ia32/lldiv.c new file mode 100644 index 0000000..7683af8 --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/lldiv.c @@ -0,0 +1,97 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + + +/* + * Divides a 64-bit signed value with a 64-bit signed value and returns + * a 64-bit signed result. + */ +__declspec(naked) void __cdecl _alldiv (void) +{ + // + // Wrapper Implementation over EDKII DivS64x64Remainder() routine + // INT64 + // EFIAPI + // DivS64x64Remainder ( + // IN UINT64 Dividend, + // IN UINT64 Divisor, + // OUT UINT64 *Remainder OPTIONAL + // ) + // + _asm { + + ;Entry: + ; Arguments are passed on the stack: + ; 1st pushed: divisor (QWORD) + ; 2nd pushed: dividend (QWORD) + ; + ;Exit: + ; EDX:EAX contains the quotient (dividend/divisor) + ; NOTE: this routine removes the parameters from the stack. + ; + ; Original local stack when calling _alldiv + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |-- Divisor --| + ; | | + ; |---------------| + ; | | + ; |-- Dividend --| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + + ; + ; Set up the local stack for NULL Reminder pointer + ; + xor eax, eax + push eax + + ; + ; Set up the local stack for Divisor parameter + ; + mov eax, [esp + 20] + push eax + mov eax, [esp + 20] + push eax + + ; + ; Set up the local stack for Dividend parameter + ; + mov eax, [esp + 20] + push eax + mov eax, [esp + 20] + push eax + + ; + ; Call native DivS64x64Remainder of BaseLib + ; + call DivS64x64Remainder + + ; + ; Adjust stack + ; + add esp, 20 + + ret 16 + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/lldvrm.c b/CompilerIntrinsicsLib/CRT/Ia32/lldvrm.c new file mode 100644 index 0000000..eb06134 --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/lldvrm.c @@ -0,0 +1,100 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + + +/* + * Divides a 64-bit signed value by another 64-bit signed value and returns + * the 64-bit signed result and the 64-bit signed remainder. + */ +__declspec(naked) void __cdecl _alldvrm(void) +{ + // + // Wrapper Implementation over EDKII DivS64x64Remainder() routine + // INT64 + // EFIAPI + // DivS64x64Remainder ( + // IN INT64 Dividend, + // IN INT64 Divisor, + // OUT INT64 *Remainder + // ) + // + _asm { + ; Original local stack when calling _alldvrm + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |-- Divisor --| + ; | | + ; |---------------| + ; | | + ; |-- Dividend --| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + ; + ; On Exit: + ; EDX:EAX contains the quotient (dividend/divisor) + ; EBX:ECX contains the remainder (divided % divisor) + ; NOTE: this routine removes the parameters from the stack. + ; + + ; + ; Set up the local stack for Reminder pointer + ; + sub esp, 8 + push esp + + ; + ; Set up the local stack for Divisor parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Set up the local stack for Dividend parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Call native DivS64x64Remainder of BaseLib + ; + call DivS64x64Remainder + + ; + ; EDX:EAX contains the quotient (dividend/divisor) + ; Put the Remainder in EBX:ECX + ; + mov ecx, [esp + 20] + mov ebx, [esp + 24] + + ; + ; Adjust stack + ; + add esp, 28 + + ret 16 + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/llmul.c b/CompilerIntrinsicsLib/CRT/Ia32/llmul.c new file mode 100644 index 0000000..59da79f --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/llmul.c @@ -0,0 +1,79 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + +/* + * Multiplies a 64-bit signed or unsigned value by a 64-bit signed or unsigned value + * and returns a 64-bit result. + */ +__declspec(naked) void __cdecl _allmul (void) +{ + // + // Wrapper Implementation over EDKII MultS64x64() routine + // INT64 + // EFIAPI + // MultS64x64 ( + // IN INT64 Multiplicand, + // IN INT64 Multiplier + // ) + // + _asm { + ; Original local stack when calling _allmul + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |--Multiplier --| + ; | | + ; |---------------| + ; | | + ; |--Multiplicand-| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + + ; + ; Set up the local stack for Multiplicand parameter + ; + mov eax, [esp + 16] + push eax + mov eax, [esp + 16] + push eax + + ; + ; Set up the local stack for Multiplier parameter + ; + mov eax, [esp + 16] + push eax + mov eax, [esp + 16] + push eax + + ; + ; Call native MulS64x64 of BaseLib + ; + call MultS64x64 + + ; + ; Adjust stack + ; + add esp, 16 + + ret 16 + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/llrem.c b/CompilerIntrinsicsLib/CRT/Ia32/llrem.c new file mode 100644 index 0000000..3720880 --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/llrem.c @@ -0,0 +1,93 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + + +/* + * Divides a 64-bit signed value by another 64-bit signed value and returns + * the 64-bit signed remainder. + */ +__declspec(naked) void __cdecl _allrem(void) +{ + // + // Wrapper Implementation over EDKII DivS64x64Remainder() routine + // UINT64 + // EFIAPI + // DivS64x64Remainder ( + // IN UINT64 Dividend, + // IN UINT64 Divisor, + // OUT UINT64 *Remainder + // ) + // + _asm { + ; Original local stack when calling _allrem + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |-- Divisor --| + ; | | + ; |---------------| + ; | | + ; |-- Dividend --| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + + ; + ; Set up the local stack for Reminder pointer + ; + sub esp, 8 + push esp + + ; + ; Set up the local stack for Divisor parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Set up the local stack for Dividend parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Call native DivS64x64Remainder of BaseLib + ; + call DivS64x64Remainder + + ; + ; Put the Reminder in EDX:EAX as return value + ; + mov eax, [esp + 20] + mov edx, [esp + 24] + + ; + ; Adjust stack + ; + add esp, 28 + + ret 16 + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/llshl.c b/CompilerIntrinsicsLib/CRT/Ia32/llshl.c new file mode 100644 index 0000000..0188b6c --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/llshl.c @@ -0,0 +1,54 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + + +/* + * Shifts a 64-bit signed value left by a particular number of bits. + */ +__declspec(naked) void __cdecl _allshl (void) +{ + _asm { + ; + ; Handle shifting of 64 or more bits (return 0) + ; + cmp cl, 64 + jae short ReturnZero + + ; + ; Handle shifting of between 0 and 31 bits + ; + cmp cl, 32 + jae short More32 + shld edx, eax, cl + shl eax, cl + ret + + ; + ; Handle shifting of between 32 and 63 bits + ; +More32: + mov edx, eax + xor eax, eax + and cl, 31 + shl edx, cl + ret + +ReturnZero: + xor eax,eax + xor edx,edx + ret + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/llshr.c b/CompilerIntrinsicsLib/CRT/Ia32/llshr.c new file mode 100644 index 0000000..e56c82f --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/llshr.c @@ -0,0 +1,58 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + + +/* + * Shifts a 64-bit signed value right by a particular number of bits. + */ +__declspec(naked) void __cdecl _allshr (void) +{ + _asm { + ; + ; Handle shifts of 64 bits or more (if shifting 64 bits or more, the result + ; depends only on the high order bit of edx). + ; + cmp cl,64 + jae short SIGNRETURN + + ; + ; Handle shifts of between 0 and 31 bits + ; + cmp cl, 32 + jae short MORE32 + shrd eax,edx,cl + sar edx,cl + ret + + ; + ; Handle shifts of between 32 and 63 bits + ; +MORE32: + mov eax,edx + sar edx,31 + and cl,31 + sar eax,cl + ret + + ; + ; Return double precision 0 or -1, depending on the sign of edx + ; +SIGNRETURN: + sar edx,31 + mov eax,edx + ret + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/ulldiv.c b/CompilerIntrinsicsLib/CRT/Ia32/ulldiv.c new file mode 100644 index 0000000..92cddd8 --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/ulldiv.c @@ -0,0 +1,88 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + + +/* + * Divides a 64-bit unsigned value with a 64-bit unsigned value and returns + * a 64-bit unsigned result. + */ +__declspec(naked) void __cdecl _aulldiv (void) +{ + // + // Wrapper Implementation over EDKII DivU64x64Reminder() routine + // UINT64 + // EFIAPI + // DivU64x64Remainder ( + // IN UINT64 Dividend, + // IN UINT64 Divisor, + // OUT UINT64 *Remainder OPTIONAL + // ) + // + _asm { + + ; Original local stack when calling _aulldiv + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |-- Divisor --| + ; | | + ; |---------------| + ; | | + ; |-- Dividend --| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + + ; + ; Set up the local stack for NULL Reminder pointer + ; + xor eax, eax + push eax + + ; + ; Set up the local stack for Divisor parameter + ; + mov eax, [esp + 20] + push eax + mov eax, [esp + 20] + push eax + + ; + ; Set up the local stack for Dividend parameter + ; + mov eax, [esp + 20] + push eax + mov eax, [esp + 20] + push eax + + ; + ; Call native DivU64x64Remainder of BaseLib + ; + call DivU64x64Remainder + + ; + ; Adjust stack + ; + add esp, 20 + + ret 16 + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/ulldvrm.c b/CompilerIntrinsicsLib/CRT/Ia32/ulldvrm.c new file mode 100644 index 0000000..fc3522a --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/ulldvrm.c @@ -0,0 +1,100 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + + +/* + * Divides a 64-bit signed value by another 64-bit signed value and returns + * the 64-bit signed result and the 64-bit signed remainder. + */ +__declspec(naked) void __cdecl _aulldvrm(void) +{ + // + // Wrapper Implementation over EDKII DivU64x64Remainder() routine + // UINT64 + // EFIAPI + // DivU64x64Remainder ( + // IN UINT64 Dividend, + // IN UINT64 Divisor, + // OUT UINT64 *Remainder + // ) + // + _asm { + ; Original local stack when calling _aulldvrm + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |-- Divisor --| + ; | | + ; |---------------| + ; | | + ; |-- Dividend --| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + ; + ; On Exit: + ; EDX:EAX contains the quotient (dividend/divisor) + ; EBX:ECX contains the remainder (divided % divisor) + ; NOTE: this routine removes the parameters from the stack. + ; + + ; + ; Set up the local stack for Remainder pointer + ; + sub esp, 8 + push esp + + ; + ; Set up the local stack for Divisor parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Set up the local stack for Dividend parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Call native DivU64x64Remainder of BaseLib + ; + call DivU64x64Remainder + + ; + ; EDX:EAX contains the quotient (dividend/divisor) + ; Put the Remainder in EBX:ECX + ; + mov ecx, [esp + 20] + mov ebx, [esp + 24] + + ; + ; Adjust stack + ; + add esp, 28 + + ret 16 + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/ullrem.c b/CompilerIntrinsicsLib/CRT/Ia32/ullrem.c new file mode 100644 index 0000000..7a614a4 --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/ullrem.c @@ -0,0 +1,93 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + + +/* + * Divides a 64-bit unsigned value by another 64-bit unsigned value and returns + * the 64-bit unsigned remainder. + */ +__declspec(naked) void __cdecl _aullrem(void) +{ + // + // Wrapper Implementation over EDKII DivU64x64Remainder() routine + // UINT64 + // EFIAPI + // DivU64x64Remainder ( + // IN UINT64 Dividend, + // IN UINT64 Divisor, + // OUT UINT64 *Remainder OPTIONAL + // ) + // + _asm { + ; Original local stack when calling _aullrem + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |-- Divisor --| + ; | | + ; |---------------| + ; | | + ; |-- Dividend --| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + + ; + ; Set up the local stack for Reminder pointer + ; + sub esp, 8 + push esp + + ; + ; Set up the local stack for Divisor parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Set up the local stack for Dividend parameter + ; + mov eax, [esp + 28] + push eax + mov eax, [esp + 28] + push eax + + ; + ; Call native DivU64x64Remainder of BaseLib + ; + call DivU64x64Remainder + + ; + ; Put the Reminder in EDX:EAX as return value + ; + mov eax, [esp + 20] + mov edx, [esp + 24] + + ; + ; Adjust stack + ; + add esp, 28 + + ret 16 + } +} diff --git a/CompilerIntrinsicsLib/CRT/Ia32/ullshr.c b/CompilerIntrinsicsLib/CRT/Ia32/ullshr.c new file mode 100644 index 0000000..f397c4c --- /dev/null +++ b/CompilerIntrinsicsLib/CRT/Ia32/ullshr.c @@ -0,0 +1,57 @@ +/** @file + 64-bit Math Worker Function. + The 32-bit versions of C compiler generate calls to library routines + to handle 64-bit math. These functions use non-standard calling conventions. + + Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + + +/* + * Shifts a 64-bit unsigned value right by a certain number of bits. + */ +__declspec(naked) void __cdecl _aullshr (void) +{ + _asm { + ; + ; Checking: Only handle 64bit shifting or more + ; + cmp cl, 64 + jae _Exit + + ; + ; Handle shifting between 0 and 31 bits + ; + cmp cl, 32 + jae More32 + shrd eax, edx, cl + shr edx, cl + ret + + ; + ; Handle shifting of 32-63 bits + ; +More32: + mov eax, edx + xor edx, edx + and cl, 31 + shr eax, cl + ret + + ; + ; Invalid number (less then 32bits), return 0 + ; +_Exit: + xor eax, eax + xor edx, edx + ret + } +} diff --git a/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf new file mode 100644 index 0000000..1df143c --- /dev/null +++ b/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf @@ -0,0 +1,53 @@ +#/*++ +# +# Copyright (c) 2017-2019, Pete Batard. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Abstract: +# +# Intrinsics required to compile EfiFs with MSFT. +# +#--*/ + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = CompilerIntrinsicsLib + FILE_GUID = B11194CC-A4AA-4886-8241-101F3DAD8BEF + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = CompilerIntrinsicsLib + +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Sources] + memset.c | MSFT + memcpy.c | MSFT + memcmp.c | MSFT + memmove.c | MSFT + +[Sources.IA32] + CRT/Ia32/llmul.c | MSFT # __allmul + CRT/Ia32/llshl.c | MSFT # __allshl + CRT/Ia32/llshr.c | MSFT # __allshr + CRT/Ia32/ulldiv.c | MSFT # __aulldiv + CRT/Ia32/ullrem.c | MSFT # __aullrem + CRT/Ia32/ullshr.c | MSFT # __aullshr + CRT/Ia32/lldiv.c | MSFT # __alldiv + CRT/Ia32/llrem.c | MSFT # __allrem + CRT/Ia32/lldvrm.c | MSFT # __alldvrm + CRT/Ia32/ulldvrm.c | MSFT # __aulldvrm + +[Packages] + MdePkg/MdePkg.dec + +[BuildOptions] + MSFT:*_*_*_CC_FLAGS = /GL- diff --git a/CompilerIntrinsicsLib/memcmp.c b/CompilerIntrinsicsLib/memcmp.c new file mode 100644 index 0000000..adbcdd8 --- /dev/null +++ b/CompilerIntrinsicsLib/memcmp.c @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) 2017, Pete Batard. All rights reserved. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +//------------------------------------------------------------------------------ + +#if defined(_M_X64) +typedef unsigned __int64 size_t; +#else +typedef unsigned __int32 size_t; +#endif + +int memcmp(void *, void *, size_t); +#pragma intrinsic(memcmp) +#pragma function(memcmp) +int memcmp(const void *s1, const void *s2, size_t n) +{ + unsigned char const *t1 = s1; + unsigned char const *t2 = s2; + + while (n--) { + if (*t1 != *t2) + return (int)*t1 - (int)*t2; + t1++; + t2++; + } + + return 0; +} diff --git a/CompilerIntrinsicsLib/memcpy.c b/CompilerIntrinsicsLib/memcpy.c new file mode 100644 index 0000000..c0d700c --- /dev/null +++ b/CompilerIntrinsicsLib/memcpy.c @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) 2017, Pete Batard. All rights reserved. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +//------------------------------------------------------------------------------ + +#if defined(_M_X64) +typedef unsigned __int64 size_t; +#else +typedef unsigned __int32 size_t; +#endif + +void* memcpy(void *, const void *, size_t); +#pragma intrinsic(memcpy) +#pragma function(memcpy) +void* memcpy(void *dest, const void *src, size_t n) +{ + unsigned char *d = dest; + unsigned char const *s = src; + + while (n--) + *d++ = *s++; + + return dest; +} diff --git a/CompilerIntrinsicsLib/memmove.c b/CompilerIntrinsicsLib/memmove.c new file mode 100644 index 0000000..e749f66 --- /dev/null +++ b/CompilerIntrinsicsLib/memmove.c @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) 2019, Pete Batard. All rights reserved. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +//------------------------------------------------------------------------------ + +#if defined(_M_X64) +typedef unsigned __int64 size_t; +#else +typedef unsigned __int32 size_t; +#endif + +void* memmove(void *, const void *, size_t); +#pragma intrinsic(memmove) +#pragma function(memmove) +void* memmove(void *dest, const void *src, size_t n) +{ + unsigned char *d = dest; + unsigned char const *s = src; + + if (d < s) { + while (n--) + *d++ = *s++; + } else { + d += n; + s += n; + while (n--) + *--d = *--s; + } + + return dest; +} diff --git a/CompilerIntrinsicsLib/memset.c b/CompilerIntrinsicsLib/memset.c new file mode 100644 index 0000000..3857936 --- /dev/null +++ b/CompilerIntrinsicsLib/memset.c @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) 2017, Pete Batard. All rights reserved. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +//------------------------------------------------------------------------------ + +#if defined(_M_X64) +typedef unsigned __int64 size_t; +#else +typedef unsigned __int32 size_t; +#endif + +void* memset(void *, int, size_t); +#pragma intrinsic(memset) +#pragma function(memset) +void *memset(void *s, int c, size_t n) +{ + unsigned char *d = s; + + while (n--) + *d++ = (unsigned char)c; + + return s; +} diff --git a/EfiFsPkg.dsc b/EfiFsPkg.dsc index 163a897..ae0fee2 100644 --- a/EfiFsPkg.dsc +++ b/EfiFsPkg.dsc @@ -47,11 +47,8 @@ NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf [LibraryClasses.IA32, LibraryClasses.X64] - NULL|EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf - -[LibraryClasses.IA32] !if $(TOOLCHAIN) == "VS2017" - NULL|EfiFsPkg/CompilerIntrinsicsLib.inf + NULL|EfiFsPkg/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !endif ################################################################################################### diff --git a/EfiFsPkg/Affs.inf b/EfiFsPkg/Affs.inf index a26ebba..0423b48 100644 --- a/EfiFsPkg/Affs.inf +++ b/EfiFsPkg/Affs.inf @@ -69,5 +69,5 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Amiga FFS\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 GCC:*_*_*_CC_FLAGS = -Wno-overflow diff --git a/EfiFsPkg/Afs.inf b/EfiFsPkg/Afs.inf index 1c09287..9cbe83e 100644 --- a/EfiFsPkg/Afs.inf +++ b/EfiFsPkg/Afs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"AFS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Bfs.inf b/EfiFsPkg/Bfs.inf index cb2221a..e81c381 100644 --- a/EfiFsPkg/Bfs.inf +++ b/EfiFsPkg/Bfs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"BFS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Btrfs.inf b/EfiFsPkg/Btrfs.inf index e1215b3..3bc8530 100644 --- a/EfiFsPkg/Btrfs.inf +++ b/EfiFsPkg/Btrfs.inf @@ -75,4 +75,5 @@ *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"Btrfs\" *_*_*_CC_FLAGS = -DEXTRAMODULE=gzio - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + GCC:*_*_*_CC_FLAGS = -Wno-unused-function + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Cbfs.inf b/EfiFsPkg/Cbfs.inf index cbcbbda..9458c19 100644 --- a/EfiFsPkg/Cbfs.inf +++ b/EfiFsPkg/Cbfs.inf @@ -71,4 +71,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"CBFS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Cpio.inf b/EfiFsPkg/Cpio.inf index 718923c..1a2a47b 100644 --- a/EfiFsPkg/Cpio.inf +++ b/EfiFsPkg/Cpio.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (LE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/CpioBe.inf b/EfiFsPkg/CpioBe.inf index 70204ff..de5d226 100644 --- a/EfiFsPkg/CpioBe.inf +++ b/EfiFsPkg/CpioBe.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (BE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/ExFat.inf b/EfiFsPkg/ExFat.inf index e52dc59..2a16d05 100644 --- a/EfiFsPkg/ExFat.inf +++ b/EfiFsPkg/ExFat.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ExFAT\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ext2.inf b/EfiFsPkg/Ext2.inf index 1b618a8..e5a8d1f 100644 --- a/EfiFsPkg/Ext2.inf +++ b/EfiFsPkg/Ext2.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ext2/3/4\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/F2fs.inf b/EfiFsPkg/F2fs.inf index 22106c9..fcbbb2b 100644 --- a/EfiFsPkg/F2fs.inf +++ b/EfiFsPkg/F2fs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"F2FS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Fat.inf b/EfiFsPkg/Fat.inf index f13b8f3..090d285 100644 --- a/EfiFsPkg/Fat.inf +++ b/EfiFsPkg/Fat.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ExFAT\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Hfs.inf b/EfiFsPkg/Hfs.inf index e0febee..4152399 100644 --- a/EfiFsPkg/Hfs.inf +++ b/EfiFsPkg/Hfs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"HFS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/HfsPlus.inf b/EfiFsPkg/HfsPlus.inf index 1ea0c7e..4181444 100644 --- a/EfiFsPkg/HfsPlus.inf +++ b/EfiFsPkg/HfsPlus.inf @@ -73,4 +73,4 @@ *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"HFS+\" # HFS+ has a compressed driver *_*_*_CC_FLAGS = -DCOMPRESSED_DRIVERNAME=$(BASE_NAME)comp -DEXTRAMODULE=gzio - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Iso9660.inf b/EfiFsPkg/Iso9660.inf index 3997048..b4f8833 100644 --- a/EfiFsPkg/Iso9660.inf +++ b/EfiFsPkg/Iso9660.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ISO9660\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Jfs.inf b/EfiFsPkg/Jfs.inf index 7f12028..d0acb30 100644 --- a/EfiFsPkg/Jfs.inf +++ b/EfiFsPkg/Jfs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"JFS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix.inf b/EfiFsPkg/Minix.inf index 2b34981..42601f5 100644 --- a/EfiFsPkg/Minix.inf +++ b/EfiFsPkg/Minix.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix (LE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix2.inf b/EfiFsPkg/Minix2.inf index b5b8fac..c26417f 100644 --- a/EfiFsPkg/Minix2.inf +++ b/EfiFsPkg/Minix2.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix2 (LE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix2Be.inf b/EfiFsPkg/Minix2Be.inf index 93376d3..d9f6b04 100644 --- a/EfiFsPkg/Minix2Be.inf +++ b/EfiFsPkg/Minix2Be.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix2 (BE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix3.inf b/EfiFsPkg/Minix3.inf index ecd1509..85dcbe4 100644 --- a/EfiFsPkg/Minix3.inf +++ b/EfiFsPkg/Minix3.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix3 (LE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix3Be.inf b/EfiFsPkg/Minix3Be.inf index 95b0ffd..5fe2bcc 100644 --- a/EfiFsPkg/Minix3Be.inf +++ b/EfiFsPkg/Minix3Be.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix3 (BE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/MinixBe.inf b/EfiFsPkg/MinixBe.inf index 3a4e73a..a690a96 100644 --- a/EfiFsPkg/MinixBe.inf +++ b/EfiFsPkg/MinixBe.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix (BE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/NewC.inf b/EfiFsPkg/NewC.inf index 8acaec3..db4cf44 100644 --- a/EfiFsPkg/NewC.inf +++ b/EfiFsPkg/NewC.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (newc)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/NilFs2.inf b/EfiFsPkg/NilFs2.inf index 7d81dcc..ef5994b 100644 --- a/EfiFsPkg/NilFs2.inf +++ b/EfiFsPkg/NilFs2.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"NILFS2\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ntfs.inf b/EfiFsPkg/Ntfs.inf index 2e52f18..12844b5 100644 --- a/EfiFsPkg/Ntfs.inf +++ b/EfiFsPkg/Ntfs.inf @@ -72,4 +72,4 @@ *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"NTFS\" # NTFS has a compressed driver *_*_*_CC_FLAGS = -DCOMPRESSED_DRIVERNAME=$(BASE_NAME)comp - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Odc.inf b/EfiFsPkg/Odc.inf index a6bb8f3..63f9b8b 100644 --- a/EfiFsPkg/Odc.inf +++ b/EfiFsPkg/Odc.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (odc)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/ProcFs.inf b/EfiFsPkg/ProcFs.inf index 299a633..ef2007f 100644 --- a/EfiFsPkg/ProcFs.inf +++ b/EfiFsPkg/ProcFs.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"procfs\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/ReiserFs.inf b/EfiFsPkg/ReiserFs.inf index 6161990..3ba426e 100644 --- a/EfiFsPkg/ReiserFs.inf +++ b/EfiFsPkg/ReiserFs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ReiserFS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/RomFs.inf b/EfiFsPkg/RomFs.inf index a4d8aac..6b92047 100644 --- a/EfiFsPkg/RomFs.inf +++ b/EfiFsPkg/RomFs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"romfs\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Sfs.inf b/EfiFsPkg/Sfs.inf index 7ad962a..a50b017 100644 --- a/EfiFsPkg/Sfs.inf +++ b/EfiFsPkg/Sfs.inf @@ -69,4 +69,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Amiga SFS\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/SquashFs.inf b/EfiFsPkg/SquashFs.inf index 4c9764f..f963bcb 100644 --- a/EfiFsPkg/SquashFs.inf +++ b/EfiFsPkg/SquashFs.inf @@ -80,4 +80,4 @@ *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"SquashFS\" # SquashFS uses additional modules *_*_*_CC_FLAGS = -DEXTRAMODULE=gzio -DEXTRAMODULE2=lzopio -DEXTRAMODULE3=xzio - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Tar.inf b/EfiFsPkg/Tar.inf index 11e1c7b..4eeeb8c 100644 --- a/EfiFsPkg/Tar.inf +++ b/EfiFsPkg/Tar.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"tar\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Udf.inf b/EfiFsPkg/Udf.inf index 1865700..f8afbf7 100644 --- a/EfiFsPkg/Udf.inf +++ b/EfiFsPkg/Udf.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"UDF\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ufs.inf b/EfiFsPkg/Ufs.inf index 78af2f9..41aaa50 100644 --- a/EfiFsPkg/Ufs.inf +++ b/EfiFsPkg/Ufs.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"UFS (LE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ufs2.inf b/EfiFsPkg/Ufs2.inf index 9b180e7..27ce359 100644 --- a/EfiFsPkg/Ufs2.inf +++ b/EfiFsPkg/Ufs2.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"UFS2\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/UfsBe.inf b/EfiFsPkg/UfsBe.inf index c75abc9..857c5a9 100644 --- a/EfiFsPkg/UfsBe.inf +++ b/EfiFsPkg/UfsBe.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"UFS (BE)\"" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Xfs.inf b/EfiFsPkg/Xfs.inf index 2c0e132..d147d36 100644 --- a/EfiFsPkg/Xfs.inf +++ b/EfiFsPkg/Xfs.inf @@ -70,4 +70,4 @@ *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"XFS\" - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Zfs.inf b/EfiFsPkg/Zfs.inf index d666313..8c2f993 100644 --- a/EfiFsPkg/Zfs.inf +++ b/EfiFsPkg/Zfs.inf @@ -76,4 +76,4 @@ *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ZFS\" # ZFS has an extra module *_*_*_CC_FLAGS = -DEXTRAMODULE=gzio - MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + MSFT:*_*_*_CC_FLAGS = /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/README.md b/README.md index 979f5e2..4707dac 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ For additional info as well as precompiled drivers, see https://efi.akeo.ie Where `` is one of `ia32`, `x64`, `arm` or `aarch64`. Note that you __MUST__ invoke the `set_grub_cpu` script __every time you switch target__. -* After having invoked `Edk2Setup.bat` (Windows) or `edksetup.sh` (Linux) run +* After having invoked `edksetup.bat` (Windows) or `edksetup.sh` (Linux) run something like: ``` build -a X64 -b RELEASE -t -p EfiFsPkg/EfiFsPkg.dsc @@ -67,8 +67,8 @@ For additional info as well as precompiled drivers, see https://efi.akeo.ie ``` build -a AARCH64 -b RELEASE -t VS2017 -p EfiFsPkg/EfiFsPkg.dsc ``` -* A Windows script to build all the drivers for all architectures, using EDK2 + - VS2017 is also provided as `edk2_build_all_drivers.cmd`. +* A Windows script to build the drivers, using EDK2 with VS2017 is also provided + as `edk2_build_drivers.cmd`. ## Testing @@ -118,7 +118,9 @@ git clone https://github.com/pbatard/efifs.git cd efifs git submodule init git submodule update -cd edk2 +cd grub +patch -Np1 -i ../0000-GRUB-fixes.patch +cd ../../edk2 ln -s ../efifs EfiFsPkg make -C /usr/src/edk2/BaseTools/Source/C export GCC5_ARM_PREFIX=arm-linux-gnueabihf- diff --git a/edk2_build_all_drivers.cmd b/edk2_build_drivers.cmd similarity index 72% rename from edk2_build_all_drivers.cmd rename to edk2_build_drivers.cmd index 09642d6..995319c 100644 --- a/edk2_build_all_drivers.cmd +++ b/edk2_build_drivers.cmd @@ -4,6 +4,7 @@ setlocal enabledelayedexpansion set EDK2_PATH=D:\edk2 set EFIFS_PATH=%~dp0 +set NASM_PREFIX=%EDK2_PATH%\BaseTools\Bin\Win32\ rem cd /d "%~dp0" @@ -13,8 +14,8 @@ if not exist "%EDK2_PATH%\edksetup.bat" ( exit 1 ) -if not exist "%EDK2_PATH%\BaseTools\Bin\Win32\nasm.exe" ( - echo ERROR: You must have nasm.exe in BaseTools\Bin\Win32 +if not exist "%NASM_PREFIX%nasm.exe" ( + echo ERROR: You must have nasm.exe in %NASM_PREFIX%nasm.exe pause exit 1 ) @@ -30,32 +31,52 @@ if not exist "%EDK2_PATH%\EfiFsPkg\set_grub_cpu.cmd" ( cd /d "%EDK2_PATH%" +set ARCH= +if /I "%1"=="win32" set ARCH=ia32 +if /I "%1"=="ia32" set ARCH=ia32 +if /I "%1"=="x86" set ARCH=ia32 +if /I "%1"=="x64" set ARCH=x64 +if /I "%1"=="win64" set ARCH=x64 +if /I "%1"=="arm" set ARCH=arm +if /I "%1"=="arm64" set ARCH=aarch64 +if /I "%1"=="aa64" set ARCH=aarch64 +if /I "%1"=="aarch64" set ARCH=aarch64 +if not "%ARCH%"=="" goto %ARCH% + +:arm if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" ( call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" - call edksetup.bat + call edksetup.bat reconfig call EfiFsPkg\set_grub_cpu.cmd ARM build -a ARM -b RELEASE -t VS2017 -p EfiFsPkg/EfiFsPkg.dsc ) +if not "%ARCH%"=="" goto out +:aarch64 if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" ( call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" - call edksetup.bat + call edksetup.bat reconfig call EfiFsPkg\set_grub_cpu.cmd AARCH64 build -a AARCH64 -b RELEASE -t VS2017 -p EfiFsPkg/EfiFsPkg.dsc ) +if not "%ARCH%"=="" goto out +:ia32 if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" ( call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" - call edksetup.bat + call edksetup.bat reconfig call EfiFsPkg\set_grub_cpu.cmd IA32 build -a IA32 -b RELEASE -t VS2017 -p EfiFsPkg/EfiFsPkg.dsc ) +if not "%ARCH%"=="" goto out +:x64 if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" ( call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" - call edksetup.bat + call edksetup.bat reconfig call EfiFsPkg\set_grub_cpu.cmd X64 build -a X64 -b RELEASE -t VS2017 -p EfiFsPkg/EfiFsPkg.dsc ) +:out pause \ No newline at end of file diff --git a/set_grub_cpu.cmd b/set_grub_cpu.cmd index 612dacf..488209f 100644 --- a/set_grub_cpu.cmd +++ b/set_grub_cpu.cmd @@ -12,7 +12,7 @@ if /I "%1"=="aa64" set ARCH=arm64 if /I "%1"=="aarch64" set ARCH=arm64 if "%ARCH%"=="" ( echo Unsupported arch %1 - exit 1 + goto out ) echo Setting GRUB for %ARCH%... @@ -22,3 +22,5 @@ if not exist "%~dp0\grub\include\grub\cpu\%ARCH%" ( xcopy "%~dp0\grub\include\grub\%ARCH%" "%~dp0\grub\include\grub\cpu" /i /q /s /y /z echo %ARCH% > "%~dp0\grub\include\grub\cpu\%ARCH%" ) + +:out diff --git a/src/missing.c b/src/missing.c index ce080ba..54130ae 100644 --- a/src/missing.c +++ b/src/missing.c @@ -20,30 +20,11 @@ #include "driver.h" -// EDK2 specifics -#if !defined(__MAKEWITH_GNUEFI) - -#if defined(_M_IX86) +// Needed to avoid a LNK2043 error with EDK2/MSVC/IA32 +#if !defined(__MAKEWITH_GNUEFI) && defined(_M_IX86) #pragma comment(linker, "/INCLUDE:_MultS64x64") #endif -// Microsoft's intrinsics are a major pain in the ass -#if defined(_MSC_VER) -#include // For size_t -int memcmp(const void *s1, const void *s2, size_t n) -{ - return (int)CompareMem(s1, s2, (UINTN)n); -} - -void* memmove(void *s1, const void *s2, size_t n) -{ - CopyMem(s1, s2, n); - return s1; -} -#endif - -#endif - VOID strcpya(CHAR8 *dst, CONST CHAR8 *src) {