[U-Boot] [PATCH v3 2/3] efi_loader: define all known status codes

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Jul 4 21:15:22 UTC 2017


efi.h held only a few EFI status codes.

The patch adds the missing definitions for later usage.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
v3
	Create a define of the error bit mask.
v2
        This patch was split of version 1 of
        efi_loader: provide meaningful status code
---
 include/efi.h | 50 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/include/efi.h b/include/efi.h
index 3d587807e8..02b78b31b1 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -39,19 +39,43 @@ struct efi_device_path;
 #define EFI_BITS_PER_LONG	64
 #endif
 
-#define EFI_SUCCESS		0
-#define EFI_LOAD_ERROR		(1 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_INVALID_PARAMETER	(2 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_UNSUPPORTED		(3 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_BAD_BUFFER_SIZE	(4 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_BUFFER_TOO_SMALL	(5 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_NOT_READY		(6 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_DEVICE_ERROR	(7 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_WRITE_PROTECTED	(8 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_OUT_OF_RESOURCES	(9 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_NOT_FOUND		(14 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_ACCESS_DENIED	(15 | (1UL << (EFI_BITS_PER_LONG - 1)))
-#define EFI_SECURITY_VIOLATION	(26 | (1UL << (EFI_BITS_PER_LONG - 1)))
+/* Bit mask for EFI status code with error */
+#define EFI_ERROR_MASK (1UL << (EFI_BITS_PER_LONG - 1))
+/* Status codes returned by EFI protocols */
+#define EFI_SUCCESS			0
+#define EFI_LOAD_ERROR			(EFI_ERROR_MASK | 1)
+#define EFI_INVALID_PARAMETER		(EFI_ERROR_MASK | 2)
+#define EFI_UNSUPPORTED			(EFI_ERROR_MASK | 3)
+#define EFI_BAD_BUFFER_SIZE		(EFI_ERROR_MASK | 4)
+#define EFI_BUFFER_TOO_SMALL		(EFI_ERROR_MASK | 5)
+#define EFI_NOT_READY			(EFI_ERROR_MASK | 6)
+#define EFI_DEVICE_ERROR		(EFI_ERROR_MASK | 7)
+#define EFI_WRITE_PROTECTED		(EFI_ERROR_MASK | 8)
+#define EFI_OUT_OF_RESOURCES		(EFI_ERROR_MASK | 9)
+#define EFI_VOLUME_CORRUPTED		(EFI_ERROR_MASK | 10)
+#define EFI_VOLUME_FULL			(EFI_ERROR_MASK | 11)
+#define EFI_NO_MEDIA			(EFI_ERROR_MASK | 12)
+#define EFI_MEDIA_CHANGED		(EFI_ERROR_MASK | 13)
+#define EFI_NOT_FOUND			(EFI_ERROR_MASK | 14)
+#define EFI_ACCESS_DENIED		(EFI_ERROR_MASK | 15)
+#define EFI_NO_RESPONSE			(EFI_ERROR_MASK | 16)
+#define EFI_NO_MAPPING			(EFI_ERROR_MASK | 17)
+#define EFI_TIMEOUT			(EFI_ERROR_MASK | 18)
+#define EFI_NOT_STARTED			(EFI_ERROR_MASK | 19)
+#define EFI_ALREADY_STARTED		(EFI_ERROR_MASK | 20)
+#define EFI_ABORTED			(EFI_ERROR_MASK | 21)
+#define EFI_ICMP_ERROR			(EFI_ERROR_MASK | 22)
+#define EFI_TFTP_ERROR			(EFI_ERROR_MASK | 23)
+#define EFI_PROTOCOL_ERROR		(EFI_ERROR_MASK | 24)
+#define EFI_INCOMPATIBLE_VERSION	(EFI_ERROR_MASK | 25)
+#define EFI_SECURITY_VIOLATION		(EFI_ERROR_MASK | 26)
+#define EFI_CRC_ERROR			(EFI_ERROR_MASK | 27)
+#define EFI_END_OF_MEDIA		(EFI_ERROR_MASK | 28)
+#define EFI_END_OF_FILE			(EFI_ERROR_MASK | 31)
+#define EFI_INVALID_LANGUAGE		(EFI_ERROR_MASK | 32)
+#define EFI_COMPROMISED_DATA		(EFI_ERROR_MASK | 33)
+#define EFI_IP_ADDRESS_CONFLICT		(EFI_ERROR_MASK | 34)
+#define EFI_HTTP_ERROR			(EFI_ERROR_MASK | 35)
 
 typedef unsigned long efi_status_t;
 typedef u64 efi_physical_addr_t;
-- 
2.11.0



More information about the U-Boot mailing list