]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/efi.h
Fixup bug in PMIC TPS65217 register address definition
[people/ms/u-boot.git] / include / efi.h
index 1470c0825c4b6f394b5b48cdf42f33acddc95a44..3d587807e8c9bf34d7adc645fa16d8bd41e81335 100644 (file)
 #ifndef _EFI_H
 #define _EFI_H
 
+#include <linux/linkage.h>
 #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 asmlinkage
+#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. EFI_STUB is set
+ * in lib/efi/Makefile, when building the stub.
+ */
+#if defined(CONFIG_EFI_STUB_64BIT) && defined(EFI_STUB)
+#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 +152,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 +163,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
@@ -269,7 +292,7 @@ struct efi_priv {
 extern char image_base[];
 
 /* Start and end of U-Boot image (for payload) */
-extern char _binary_u_boot_dtb_bin_start[], _binary_u_boot_dtb_bin_end[];
+extern char _binary_u_boot_bin_start[], _binary_u_boot_bin_end[];
 
 /**
  * efi_get_sys_table() - Get access to the main EFI system table