No description
9b89b1dedb
Currently, in some builds with some checkers, we see: 1. grub-core/disk/efi/efidisk.c:601: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour This is because grub_efi_status_t is defined as grub_efi_intn_t, which is signed, and shifting into the sign bit is not defined behavior. UEFI fixed this in the spec in 2.3: 2.3 | Change the defined type of EFI_STATUS from INTN to UINTN | May 7, 2009 And the current EDK2 code has: MdePkg/Include/Base.h-// MdePkg/Include/Base.h-// Status codes common to all execution phases MdePkg/Include/Base.h-// MdePkg/Include/Base.h:typedef UINTN RETURN_STATUS; MdePkg/Include/Base.h- MdePkg/Include/Base.h-/** MdePkg/Include/Base.h- Produces a RETURN_STATUS code with the highest bit set. MdePkg/Include/Base.h- MdePkg/Include/Base.h- @param StatusCode The status code value to convert into a warning code. MdePkg/Include/Base.h- StatusCode must be in the range 0x00000000..0x7FFFFFFF. MdePkg/Include/Base.h- MdePkg/Include/Base.h- @return The value specified by StatusCode with the highest bit set. MdePkg/Include/Base.h- MdePkg/Include/Base.h-**/ MdePkg/Include/Base.h-#define ENCODE_ERROR(StatusCode) ((RETURN_STATUS)(MAX_BIT | (StatusCode))) MdePkg/Include/Base.h- MdePkg/Include/Base.h-/** MdePkg/Include/Base.h- Produces a RETURN_STATUS code with the highest bit clear. MdePkg/Include/Base.h- MdePkg/Include/Base.h- @param StatusCode The status code value to convert into a warning code. MdePkg/Include/Base.h- StatusCode must be in the range 0x00000000..0x7FFFFFFF. MdePkg/Include/Base.h- MdePkg/Include/Base.h- @return The value specified by StatusCode with the highest bit clear. MdePkg/Include/Base.h- MdePkg/Include/Base.h-**/ MdePkg/Include/Base.h-#define ENCODE_WARNING(StatusCode) ((RETURN_STATUS)(StatusCode)) MdePkg/Include/Base.h- MdePkg/Include/Base.h-/** MdePkg/Include/Base.h- Returns TRUE if a specified RETURN_STATUS code is an error code. MdePkg/Include/Base.h- MdePkg/Include/Base.h- This function returns TRUE if StatusCode has the high bit set. Otherwise, FALSE is returned. MdePkg/Include/Base.h- MdePkg/Include/Base.h- @param StatusCode The status code value to evaluate. MdePkg/Include/Base.h- MdePkg/Include/Base.h- @retval TRUE The high bit of StatusCode is set. MdePkg/Include/Base.h- @retval FALSE The high bit of StatusCode is clear. MdePkg/Include/Base.h- MdePkg/Include/Base.h-**/ MdePkg/Include/Base.h-#define RETURN_ERROR(StatusCode) (((INTN)(RETURN_STATUS)(StatusCode)) < 0) ... Uefi/UefiBaseType.h:typedef RETURN_STATUS EFI_STATUS; This patch makes grub's implementation match the Edk2 declaration with regards to the signedness of the type. Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> |
||
---|---|---|
asm-tests | ||
conf | ||
docs | ||
grub-core | ||
include | ||
po | ||
tests | ||
themes/starfield | ||
unicode | ||
util | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
acinclude.m4 | ||
AUTHORS | ||
autogen.sh | ||
bootstrap | ||
bootstrap.conf | ||
BUGS | ||
ChangeLog-2015 | ||
config.h.in | ||
configure.ac | ||
COPYING | ||
coreboot.cfg | ||
geninit.sh | ||
gentpl.py | ||
INSTALL | ||
linguas.sh | ||
Makefile.am | ||
Makefile.util.def | ||
NEWS | ||
README | ||
THANKS | ||
TODO |
This is GRUB 2, the second version of the GRand Unified Bootloader. GRUB 2 is rewritten from scratch to make GNU GRUB cleaner, safer, more robust, more powerful, and more portable. See the file NEWS for a description of recent changes to GRUB 2. See the file INSTALL for instructions on how to build and install the GRUB 2 data and program files. Please visit the official web page of GRUB 2, for more information. The URL is <http://www.gnu.org/software/grub/grub.html>. More extensive documentation is available in the Info manual, accessible using 'info grub' after building and installing GRUB 2. There are a number of important user-visible differences from the first version of GRUB, now known as GRUB Legacy. For a summary, please see: info grub Introduction 'Changes from GRUB Legacy'