]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - include/efi.h
clk: arm: snapdragon: add () around macro args and fixup indentation
[karo-tx-uboot.git] / include / efi.h
index f0097017b3ccac06972c4deb3eb98d58b01ed5d4..5a3b8cf69ac101b87b53bcb23d67b79b4b3584d4 100644 (file)
 #include <linux/string.h>
 #include <linux/types.h>
 
+#ifdef CONFIG_EFI_STUB_64BIT
+/* EFI uses the Microsoft ABI which is not the default for GCC */
+#define EFIAPI __attribute__((ms_abi))
+#else
+#define EFIAPI
+#endif
+
 struct efi_device_path;
 
+#define EFI_BITS_PER_LONG      BITS_PER_LONG
+
+/* With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64 */
+#ifdef CONFIG_EFI_STUB_64BIT
+#undef EFI_BITS_PER_LONG
+#define EFI_BITS_PER_LONG      64
+#endif
+
 #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_NOT_FOUND          (14 | (1UL << (BITS_PER_LONG - 1)))
-#define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG - 1)))
+#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)))
 
 typedef unsigned long efi_status_t;
 typedef u64 efi_physical_addr_t;
@@ -132,6 +148,7 @@ enum {
 
 #define EFI_PAGE_SHIFT         12
 #define EFI_PAGE_SIZE          (1UL << EFI_PAGE_SHIFT)
+#define EFI_PAGE_MASK          (EFI_PAGE_SIZE - 1)
 
 struct efi_mem_desc {
        u32 type;
@@ -142,6 +159,8 @@ struct efi_mem_desc {
        u64 attribute;
 };
 
+#define EFI_MEMORY_DESCRIPTOR_VERSION 1
+
 /* Allocation types for calls to boottime->allocate_pages*/
 #define EFI_ALLOCATE_ANY_PAGES         0
 #define EFI_ALLOCATE_MAX_ADDRESS       1
@@ -268,11 +287,15 @@ struct efi_priv {
 /* Base address of the EFI image */
 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[];
+
 /**
  * efi_get_sys_table() - Get access to the main EFI system table
  *
  * @return pointer to EFI system table
  */
+
 struct efi_system_table *efi_get_sys_table(void);
 
 /**