[PATCH 23/30] efi: define and use new EFI_ERROR_MASK macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Future code may want to differentiate between warnings and errors, so
add a new macro for the error mask and use it.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 include/efi.h | 67 +++++++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 32 deletions(-)

diff --git a/include/efi.h b/include/efi.h
index 51382f5bfea0..c20e7ad2b53a 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -23,38 +23,41 @@
 
 struct efi_device_path;
 
-#define EFI_SUCCESS                             0
-#define EFI_LOAD_ERROR                  ( 1 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_INVALID_PARAMETER           ( 2 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_UNSUPPORTED                 ( 3 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_BAD_BUFFER_SIZE             ( 4 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_BUFFER_TOO_SMALL            ( 5 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_NOT_READY                   ( 6 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_DEVICE_ERROR                ( 7 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_WRITE_PROTECTED             ( 8 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_OUT_OF_RESOURCES            ( 9 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_VOLUME_CORRUPTED            ( 10 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_VOLUME_FULL                 ( 11 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_NO_MEDIA                    ( 12 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_MEDIA_CHANGED               ( 13 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_NOT_FOUND                   ( 14 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_ACCESS_DENIED               ( 15 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_NO_RESPONSE                 ( 16 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_NO_MAPPING                  ( 17 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_TIMEOUT                     ( 18 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_NOT_STARTED                 ( 19 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_ALREADY_STARTED             ( 20 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_ABORTED                     ( 21 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_ICMP_ERROR                  ( 22 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_TFTP_ERROR                  ( 23 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_PROTOCOL_ERROR              ( 24 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_INCOMPATIBLE_VERSION        ( 25 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_SECURITY_VIOLATION          ( 26 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_CRC_ERROR                   ( 27 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_END_OF_MEDIA                ( 28 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_END_OF_FILE                 ( 31 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_INVALID_LANGUAGE            ( 32 | (1UL << (BITS_PER_LONG-1)))
-#define EFI_COMPROMISED_DATA            ( 33 | (1UL << (BITS_PER_LONG-1)))
+/* Bit mask for EFI status code with error */
+#define EFI_ERROR_MASK (1UL << (BITS_PER_LONG-1))
+
+#define EFI_SUCCESS                       0
+#define EFI_LOAD_ERROR                  ( 1 | EFI_ERROR_MASK)
+#define EFI_INVALID_PARAMETER           ( 2 | EFI_ERROR_MASK)
+#define EFI_UNSUPPORTED                 ( 3 | EFI_ERROR_MASK)
+#define EFI_BAD_BUFFER_SIZE             ( 4 | EFI_ERROR_MASK)
+#define EFI_BUFFER_TOO_SMALL            ( 5 | EFI_ERROR_MASK)
+#define EFI_NOT_READY                   ( 6 | EFI_ERROR_MASK)
+#define EFI_DEVICE_ERROR                ( 7 | EFI_ERROR_MASK)
+#define EFI_WRITE_PROTECTED             ( 8 | EFI_ERROR_MASK)
+#define EFI_OUT_OF_RESOURCES            ( 9 | EFI_ERROR_MASK)
+#define EFI_VOLUME_CORRUPTED            (10 | EFI_ERROR_MASK)
+#define EFI_VOLUME_FULL                 (11 | EFI_ERROR_MASK)
+#define EFI_NO_MEDIA                    (12 | EFI_ERROR_MASK)
+#define EFI_MEDIA_CHANGED               (13 | EFI_ERROR_MASK)
+#define EFI_NOT_FOUND                   (14 | EFI_ERROR_MASK)
+#define EFI_ACCESS_DENIED               (15 | EFI_ERROR_MASK)
+#define EFI_NO_RESPONSE                 (16 | EFI_ERROR_MASK)
+#define EFI_NO_MAPPING                  (17 | EFI_ERROR_MASK)
+#define EFI_TIMEOUT                     (18 | EFI_ERROR_MASK)
+#define EFI_NOT_STARTED                 (19 | EFI_ERROR_MASK)
+#define EFI_ALREADY_STARTED             (20 | EFI_ERROR_MASK)
+#define EFI_ABORTED                     (21 | EFI_ERROR_MASK)
+#define EFI_ICMP_ERROR                  (22 | EFI_ERROR_MASK)
+#define EFI_TFTP_ERROR                  (23 | EFI_ERROR_MASK)
+#define EFI_PROTOCOL_ERROR              (24 | EFI_ERROR_MASK)
+#define EFI_INCOMPATIBLE_VERSION        (25 | EFI_ERROR_MASK)
+#define EFI_SECURITY_VIOLATION          (26 | EFI_ERROR_MASK)
+#define EFI_CRC_ERROR                   (27 | EFI_ERROR_MASK)
+#define EFI_END_OF_MEDIA                (28 | EFI_ERROR_MASK)
+#define EFI_END_OF_FILE                 (31 | EFI_ERROR_MASK)
+#define EFI_INVALID_LANGUAGE            (32 | EFI_ERROR_MASK)
+#define EFI_COMPROMISED_DATA            (33 | EFI_ERROR_MASK)
 
 #define EFI_ERROR(a)	(((signed long) a) < 0)
 
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux