Commit Graph

20 Commits

Author SHA1 Message Date
Nigel Croxon
5ff74ecae8 Commit 3dd05c and subsequent ones introduced the use of the GNU
specific __attribute__((__unused__)), which breaks MSVC compilation...

I'll use this as a reminder that gnu-efi is compiled with more than
GNU toolchains, and that contributors might want to be careful about
adding GNU-specific extensions...

This patch does the following:
Create a new eficompiler.h header that sets all compiler-specific
options and extensions
Create a new EFI_UNUSED macro to be used in lieu of
__attribute__((__unused__)) and applies it to the relevant sources
Move the ALIGN(x) macro, previously defined in efisetjmp.h to the new header

Oh, and it also fixes a bunch of trailing whitespaces (because my code
editor is set to do just that by default).

Signed-off-by: Pete Batard <pbatard@users.sf.net>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-25 13:32:54 -04:00
Nigel Croxon
1acb1d9dae %d now represents signed decimal, %u represents unsigned decimal.
This patch changes the behavior of Print() slightly. %d is now signed decimal,
and %u (new) is unsigned decimal. Previously, although ValueToString supports
signed decimal printing, %d always read args as UINTxx.

Old behavior:
Print(L"%d\n", -4) -> "4294967292"

New behavior:
Print(L"%d\n, -4) -> "-4"
Print(L"%u\n", -4) -> "4294967292"

If you want to keep complete backwards compatibility you could leave %d alone
and make something else (probably shouldn't be %u to avoid confusion) be
signed decimal. But this way it agrees with the usual use of %d and %u.

Signed-off-by: Nathan Blythe <nblythe@lgsinnovations.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-25 10:28:02 -04:00
Nigel Croxon
8c29617e0b Added definitions for EFI HASH PROTOCOL
Signed-off-by: Nathan Blythe <nblythe@lgsinnovations.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-17 09:31:29 -04:00
Nigel Croxon
883702e813 Add definitions for EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL
Signed-off-by: Nathan Blythe <nblythe@lgsinnovations.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-15 14:52:12 -04:00
Nigel Croxon
0f78eb65fe Global GUID for DRIVER_BINDING_PROTOCOL
Signed-off-by: Nathan Blythe <nblythe@lgsinnovations.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-10 09:32:52 -05:00
Nigel Croxon
ab6c6ef7f3 This -Wall -Wextra thing actually caught a real bug.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-03 16:36:45 -05:00
Nigel Croxon
087d22af38 Don't pass a pointer-to-(LoadedImage *) as a void **;
pass in a real void pointer's address and cast it reasonably.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-03 16:24:31 -05:00
Nigel Croxon
1ecae7d44c This makes "-Werror=unused-but-set-variable" work.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-03 16:19:24 -05:00
Nigel Croxon
3dd05c7b21 This makes "-Werror=unused-parameter" not fail.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-03 13:40:08 -05:00
Nigel Croxon
d119b0d759 From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 2/2] Replace ARM arithmetic support routines
with EDK2 versions.

Replace the incomplete GPL licensed ARM arithmetic support routines
with the ones from the EDK2 project. These cover long long multiplication
and long long logical shift as well.

Also remove the special case for small dividends in DivU64x32: we can
simply let the compiler handle this, and emit calls to the support
routines where appropriate.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2015-12-23 08:33:02 -05:00
Nigel Croxon
88e3cf9535 From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 1/2] Relicense ARM and AARCH64 source files as
both BSD and GPL

This updates the licenses of the files authored by me under lib/arm
and lib/aarch64 to be both 2-clause BSD and GPL v2+

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2015-12-23 08:19:46 -05:00
Nigel Croxon
1ae8baefca From: Julian Andres Klode <jak@debian.org>
Subject: [PATCH gnu-efi] lib/arm/setjmp.S: Use %function instead of @function

@ is a comment character on ARM, so use % instead.

Nigel adjusted the wordwrap on the copyright header.

Signed-off-by: Julian Andres Klode <jak@degian.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2015-11-30 08:52:25 -05:00
Nigel Croxon
ad7f0d4ba2 From: Gary Ching-Pang Lin <chingpang@gmail.com>
Date: Mon, 17 Aug 2015 17:00:11 +0800
Subject: [PATCH] Add URI Device Path

Add the definition of URI Device Path according to UEFI 2.4c.

Signed-off-by: Gary Ching-Pang Lin <chingpang@gmail.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2015-08-17 16:00:33 -04:00
Nigel Croxon
37d7bee82a Added some missing error code descriptions
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-05-14 12:38:39 -04:00
Nigel Croxon
dae0b4b0b0 Turns out we actually need setjmp in one of gnu-efi's prominent
users, and it seems to make more sense to put it here than in
the application.

All of these are derived from the Tiano code, but I re-wrote the
x86_64 one because we use the ELF psABI calling conventions instead
of the MS ABI calling conventions.  Which is to say you probably
shouldn't setjmp()/longjmp() between functions with EFIAPI (aka
__attribute__((ms_abi))) and those without.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-05-14 12:20:51 -04:00
Nigel Croxon
01c9f11ed5 Fix ARM32 and AARCH64 builds
Without these added into SUBDIRS the initplat.c compilation will fail.

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-04-10 08:46:40 -04:00
Nigel Croxon
dada63fd3d [PATCH] _SPrint: fix NULL termination
maxlen is the maximum string length not the buffer size.

Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-03-23 10:41:43 -04:00
Nigel Croxon
ce7098fb52 Enable out-of-tree building
This patch enables building gnu-efi outside of the source tree.
That in turn enables building for multiple architectures in parallel.

The build directory is controlled by the OBJDIR make variable.  It
defaults to the value of ARCH, and can be overridden from the command
line.

This patch also cleans up some doubled slashes between INSTALLROOT
and PREFIX.

Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-02-19 11:22:45 -05:00
Nigel Croxon
09027207f7 From: Pete Batard <pete@akeo.ie>
Date: Wed, 10 Dec 2014 21:08:34 +0000
Subject: [PATCH] fixes for MSVC compilation

These fixes are needed to address the following error and warnings when compiling the library part
using Visual Studio 2013 Community Edition (as in https://github.com/pbatard/uefi-simple):
* "lib\x86_64\math.c(49): error C4235: nonstandard extension used : '_asm' keyword not supported
  on this architecture"
* "lib\print.c(98): error C2059: syntax error : '('" due to placement of EFIAPI macro
* "lib\cmdline.c(94): warning C4090: 'function' : different 'const' qualifiers"
* "lib\smbios.c(25): warning C4068: unknown pragma"
* Also update macro definitions in "inc\<arch>\efibind.h" for MSVC

Signed-off-by: Pete Batard <pete@akeo.ie>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-01-05 13:13:22 -05:00
Nigel Croxon
530d68ba19 The gnu-efi-3.0 toplevel subdirectory is really annoying. Kill it.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2014-11-25 10:09:50 -05:00