#include <linux/string.h>
#include <linux/types.h>
+/* Type INTN in UEFI specification */
+#define efi_intn_t ssize_t
+/* Type UINTN in UEFI specification*/
+#define efi_uintn_t size_t
+
/*
* EFI on x86_64 uses the Microsoft ABI which is not the default for GCC.
*
#define EFI_IP_ADDRESS_CONFLICT (EFI_ERROR_MASK | 34)
#define EFI_HTTP_ERROR (EFI_ERROR_MASK | 35)
-#define EFI_WARN_DELETE_FAILURE 2
+#define EFI_WARN_UNKNOWN_GLYPH 1
+#define EFI_WARN_DELETE_FAILURE 2
+#define EFI_WARN_WRITE_FAILURE 3
+#define EFI_WARN_BUFFER_TOO_SMALL 4
+#define EFI_WARN_STALE_DATA 5
+#define EFI_WARN_FILE_SYSTEM 6
+#define EFI_WARN_RESET_REQUIRED 7
typedef unsigned long efi_status_t;
typedef u64 efi_physical_addr_t;
u32 reserved;
};
+/* Allocation types for calls to boottime->allocate_pages*/
+/**
+ * enum efi_allocate_type - address restriction for memory allocation
+ */
+enum efi_allocate_type {
+ /**
+ * @EFI_ALLOCATE_ANY_PAGES:
+ * Allocate any block of sufficient size. Ignore memory address.
+ */
+ EFI_ALLOCATE_ANY_PAGES,
+ /**
+ * @EFI_ALLOCATE_MAX_ADDRESS:
+ * Allocate a memory block with an uppermost address less or equal
+ * to the indicated address.
+ */
+ EFI_ALLOCATE_MAX_ADDRESS,
+ /**
+ * @EFI_ALLOCATE_ADDRESS:
+ * Allocate a memory block starting at the indicatged adress.
+ */
+ EFI_ALLOCATE_ADDRESS,
+ /**
+ * @EFI_MAX_ALLOCATE_TYPE:
+ * Value use for range checking.
+ */
+ EFI_MAX_ALLOCATE_TYPE,
+};
+
/* Enumeration of memory types introduced in UEFI */
-enum efi_mem_type {
+enum efi_memory_type {
EFI_RESERVED_MEMORY_TYPE,
/*
* The code portions of a loaded application.
* part of the processor.
*/
EFI_PAL_CODE,
+ /*
+ * Byte addressable non-volatile memory.
+ */
+ EFI_PERSISTENT_MEMORY_TYPE,
+ /*
+ * Unaccepted memory must be accepted by boot target before usage.
+ */
+ EFI_UNACCEPTED_MEMORY_TYPE,
EFI_MAX_MEMORY_TYPE,
- EFI_TABLE_END, /* For efi_build_mem_table() */
};
/* Attribute values */
#define EFI_MEMORY_MORE_RELIABLE \
((u64)0x0000000000010000ULL) /* higher reliability */
#define EFI_MEMORY_RO ((u64)0x0000000000020000ULL) /* read-only */
+#define EFI_MEMORY_SP ((u64)0x0000000000040000ULL) /* specific-purpose memory (SPM) */
+#define EFI_MEMORY_CPU_CRYPTO ((u64)0x0000000000080000ULL) /* cryptographically protectable */
#define EFI_MEMORY_RUNTIME ((u64)0x8000000000000000ULL) /* range requires runtime mapping */
#define EFI_MEM_DESC_VERSION 1
#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
-#define EFI_ALLOCATE_ADDRESS 2
-#define EFI_MAX_ALLOCATE_TYPE 3
-
/* Types and defines for Time Services */
#define EFI_TIME_ADJUST_DAYLIGHT 0x1
#define EFI_TIME_IN_DAYLIGHT 0x2
*/
int efi_info_get(enum efi_entry_t type, void **datap, int *sizep);
-/**
- * efi_build_mem_table() - make a sorted copy of the memory table
- *
- * @map: Pointer to EFI memory map table
- * @size: Size of table in bytes
- * @skip_bs: True to skip boot-time memory and merge it with conventional
- * memory. This will significantly reduce the number of table
- * entries.
- * @return pointer to the new table. It should be freed with free() by the
- * caller
- */
-void *efi_build_mem_table(struct efi_entry_memmap *map, int size, bool skip_bs);
-
#endif /* _LINUX_EFI_H */