Coverity added a new kind of check, and it noticed some minor errors
with some types in two of the apps here, both of the same form:
1. gnu-efi-3.0.6/apps/lfbgrid.c:91: overflow_before_widen: Potentially
overflowing expression "info->VerticalResolution *
info->PixelsPerScanLine" with type "unsigned int" (32 bits, unsigned) is
evaluated using 32-bit arithmetic, and then used in a context that
expects an expression of type "UINTN" (64 bits, unsigned).
1. gnu-efi-3.0.6/apps/bltgrid.c:67: overflow_before_widen: Potentially
overflowing expression "info->VerticalResolution *
info->HorizontalResolution" with type "unsigned int" (32 bits, unsigned)
is evaluated using 32-bit arithmetic, and then used in a context that
expects an expression of type "UINTN" (64 bits, unsigned).
This resolves both issues.
Signed-off-by: Peter Jones <pjones@redhat.com>
Create a new directory called $APPSDIR
which is the default install location of
these examples. apps must be ordered after
gnuefi target.
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
The size of FrameBufferAddr is architecture dependent. Add the missing
definition for the riscv64 architecture.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
EFI_ERROR(EFI_NOT_STARTED) is true. So we can simplify
(EFI_ERROR(rc) && rc == EFI_NOT_STARTED)
to
(rc == EFI_NOT_STARTED)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This adds bltgrid and lfbgrid, which draw checkerboards using GOP's
Blt() and linear framebuffer, respectively, and adds some error checks
to modelist.efi.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
On ISO C90 on i386 4294967294 is a signed integer, and so x can't be
greater (or equal) to that. Make it an unsigned and choose a better type
for the variable.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
The compiler doesn't believe the loop always executes at least once,
even though the data in the first array entry doesn't satisfy the exit
condition. So just initialize the thing to shut it up.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Most of these come from building on i386 with -Wextra, but they're still
incorrect everywhere else; they just happen to have identical typedefs
at other places, so the compiler doesn't care.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Tested:
make all apps + tests apps/ on x86_64
make CC=clang all apps + tests apps/ on x86_64
Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
also remove what looks like garbage inside an #if 0 block.
Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Attaching a patch to fix apps/drv0.efi and apps/drv0_use.efi,
which are both currently not working.
Signed-off-by: David Decotigny <gdaviddecotigny@users.sf.net>
Signed-off-by: Nigel Croxon <noxorc@mac.com>
all of our linker scripts:
_text
_etext
_text_size
_data
_edata
_data_size
There are various things that are slightly different (positions of
.rela*, .dynamic, and similar in relation to .data), but _text and _data
are now always at the beginning of their respective sections with regard
to how a debuger would reference the debug info, and _etext and _edata
are now always extant and guaranteed to be after any of the respective
kind of data the debugger would look for in that section.
This also adds an application example of how it might be used, and a
makefile target for %.efi.debug which will generate a separate debuginfo
file for that example.
This also enables debugging by default (i.e. -g is in CFLAGS) and adds
.note.gnu.build-id sections to our .so files (i.e. --build-id=sha1 is in
LDFLAGS).
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
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>