]> git.sur5r.net Git - u-boot/blobdiff - include/efi.h
x86: doc: Fix reference to EFI doc in U-Boot
[u-boot] / include / efi.h
index 1bc22ccdf88c430d7ffb6c29a0b0e4979e4cde5a..e30a3c51c676f3777eb399de981cafd2ee6ffe80 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/string.h>
 #include <linux/types.h>
 
-#ifdef CONFIG_EFI_STUB_64BIT
+#if CONFIG_EFI_STUB_64BIT || (!defined(CONFIG_EFI_STUB) && defined(__x86_64__))
 /* EFI uses the Microsoft ABI which is not the default for GCC */
 #define EFIAPI __attribute__((ms_abi))
 #else
 
 struct efi_device_path;
 
+typedef struct {
+       u8 b[16];
+} efi_guid_t;
+
 #define EFI_BITS_PER_LONG      BITS_PER_LONG
 
 /*
@@ -77,18 +81,19 @@ struct efi_device_path;
 #define EFI_IP_ADDRESS_CONFLICT                (EFI_ERROR_MASK | 34)
 #define EFI_HTTP_ERROR                 (EFI_ERROR_MASK | 35)
 
+#define EFI_WARN_DELETE_FAILURE        2
+
 typedef unsigned long efi_status_t;
 typedef u64 efi_physical_addr_t;
 typedef u64 efi_virtual_addr_t;
 typedef void *efi_handle_t;
 
 #define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
-       ((efi_guid_t) \
        {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, \
                ((a) >> 24) & 0xff, \
                (b) & 0xff, ((b) >> 8) & 0xff, \
                (c) & 0xff, ((c) >> 8) & 0xff, \
-               (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })
+               (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } }
 
 /* Generic EFI table header */
 struct efi_table_hdr {
@@ -221,9 +226,9 @@ struct efi_time_cap {
 };
 
 enum efi_locate_search_type {
-       all_handles,
-       by_register_notify,
-       by_protocol
+       ALL_HANDLES,
+       BY_REGISTER_NOTIFY,
+       BY_PROTOCOL
 };
 
 struct efi_open_protocol_info_entry {
@@ -318,6 +323,25 @@ extern char image_base[];
 /* Start and end of U-Boot image (for payload) */
 extern char _binary_u_boot_bin_start[], _binary_u_boot_bin_end[];
 
+/*
+ * Variable Attributes
+ */
+#define EFI_VARIABLE_NON_VOLATILE       0x0000000000000001
+#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
+#define EFI_VARIABLE_RUNTIME_ACCESS     0x0000000000000004
+#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000000000008
+#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x0000000000000010
+#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020
+#define EFI_VARIABLE_APPEND_WRITE      0x0000000000000040
+
+#define EFI_VARIABLE_MASK      (EFI_VARIABLE_NON_VOLATILE | \
+                               EFI_VARIABLE_BOOTSERVICE_ACCESS | \
+                               EFI_VARIABLE_RUNTIME_ACCESS | \
+                               EFI_VARIABLE_HARDWARE_ERROR_RECORD | \
+                               EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | \
+                               EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \
+                               EFI_VARIABLE_APPEND_WRITE)
+
 /**
  * efi_get_sys_table() - Get access to the main EFI system table
  *