#include <charset.h>
#include <pe.h>
-#ifdef CONFIG_EFI_LOADER
-#include <asm/setjmp.h>
-#endif
-
/* UEFI spec version 2.8 */
#define EFI_SPECIFICATION_VERSION (2 << 16 | 80)
EFI_TIMER_RELATIVE = 2
};
-#define efi_intn_t ssize_t
-#define efi_uintn_t size_t
typedef void *efi_hii_handle_t;
typedef u16 *efi_string_t;
typedef u16 efi_string_id_t;
struct efi_memory_range_capsule {
struct efi_capsule_header *header;
/* EFI_MEMORY_TYPE: 0x80000000-0xFFFFFFFF */
- enum efi_mem_type os_requested_memory_type;
+ enum efi_memory_type os_requested_memory_type;
u64 number_of_memory_ranges;
struct efi_memory_range memory_ranges[];
} __packed;
# define DEVICE_PATH_SUB_TYPE_MSG_SCSI 0x02
# define DEVICE_PATH_SUB_TYPE_MSG_USB 0x05
# define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR 0x0b
+# define DEVICE_PATH_SUB_TYPE_MSG_UART 0x0e
# define DEVICE_PATH_SUB_TYPE_MSG_USB_CLASS 0x0f
# define DEVICE_PATH_SUB_TYPE_MSG_SATA 0x12
# define DEVICE_PATH_SUB_TYPE_MSG_NVME 0x17
+# define DEVICE_PATH_SUB_TYPE_MSG_URI 0x18
# define DEVICE_PATH_SUB_TYPE_MSG_SD 0x1a
# define DEVICE_PATH_SUB_TYPE_MSG_MMC 0x1d
u16 logical_unit_number;
} __packed;
+struct efi_device_path_uart {
+ struct efi_device_path dp;
+ u32 reserved;
+ u64 baud_rate;
+ u8 data_bits;
+ u8 parity;
+ u8 stop_bits;
+} __packed;
+
struct efi_device_path_usb {
struct efi_device_path dp;
u8 parent_port_number;
u8 eui64[8];
} __packed;
+struct efi_device_path_uri {
+ struct efi_device_path dp;
+ u8 uri[];
+} __packed;
+
#define DEVICE_PATH_TYPE_MEDIA_DEVICE 0x04
# define DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH 0x01
# define DEVICE_PATH_SUB_TYPE_CDROM_PATH 0x02
char extended_verification);
efi_status_t (EFIAPI *output_string)(
struct efi_simple_text_output_protocol *this,
- const efi_string_t str);
+ const u16 *str);
efi_status_t (EFIAPI *test_string)(
struct efi_simple_text_output_protocol *this,
- const efi_string_t str);
+ const u16 *str);
efi_status_t(EFIAPI *query_mode)(
struct efi_simple_text_output_protocol *this,
unsigned long mode_number, unsigned long *columns,
struct efi_file_handle {
u64 rev;
- efi_status_t (EFIAPI *open)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *open)(struct efi_file_handle *this,
struct efi_file_handle **new_handle,
u16 *file_name, u64 open_mode, u64 attributes);
- efi_status_t (EFIAPI *close)(struct efi_file_handle *file);
- efi_status_t (EFIAPI *delete)(struct efi_file_handle *file);
- efi_status_t (EFIAPI *read)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *close)(struct efi_file_handle *this);
+ efi_status_t (EFIAPI *delete)(struct efi_file_handle *this);
+ efi_status_t (EFIAPI *read)(struct efi_file_handle *this,
efi_uintn_t *buffer_size, void *buffer);
- efi_status_t (EFIAPI *write)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *write)(struct efi_file_handle *this,
efi_uintn_t *buffer_size, void *buffer);
- efi_status_t (EFIAPI *getpos)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *getpos)(struct efi_file_handle *this,
u64 *pos);
- efi_status_t (EFIAPI *setpos)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *setpos)(struct efi_file_handle *this,
u64 pos);
- efi_status_t (EFIAPI *getinfo)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *getinfo)(struct efi_file_handle *this,
const efi_guid_t *info_type, efi_uintn_t *buffer_size,
void *buffer);
- efi_status_t (EFIAPI *setinfo)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *setinfo)(struct efi_file_handle *this,
const efi_guid_t *info_type, efi_uintn_t buffer_size,
void *buffer);
- efi_status_t (EFIAPI *flush)(struct efi_file_handle *file);
- efi_status_t (EFIAPI *open_ex)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *flush)(struct efi_file_handle *this);
+ efi_status_t (EFIAPI *open_ex)(struct efi_file_handle *this,
struct efi_file_handle **new_handle,
u16 *file_name, u64 open_mode, u64 attributes,
struct efi_file_io_token *token);
- efi_status_t (EFIAPI *read_ex)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *read_ex)(struct efi_file_handle *this,
struct efi_file_io_token *token);
- efi_status_t (EFIAPI *write_ex)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *write_ex)(struct efi_file_handle *this,
struct efi_file_io_token *token);
- efi_status_t (EFIAPI *flush_ex)(struct efi_file_handle *file,
+ efi_status_t (EFIAPI *flush_ex)(struct efi_file_handle *this,
struct efi_file_io_token *token);
};
efi_handle_t driver_binding_handle;
};
-/* Deprecated version of the Unicode collation protocol */
-#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
- EFI_GUID(0x1d85cd7f, 0xf43d, 0x11d2, \
- 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
/* Current version of the Unicode collation protocol */
#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
EFI_GUID(0xa4c751fc, 0x23ae, 0x4c3e, \
void *buffer);
};
+struct efi_system_resource_entry {
+ efi_guid_t fw_class;
+ u32 fw_type;
+ u32 fw_version;
+ u32 lowest_supported_fw_version;
+ u32 capsule_flags;
+ u32 last_attempt_version;
+ u32 last_attempt_status;
+} __packed;
+
+struct efi_system_resource_table {
+ u32 fw_resource_count;
+ u32 fw_resource_count_max;
+ u64 fw_resource_version;
+ struct efi_system_resource_entry entries[];
+} __packed;
+
/* Boot manager load options */
#define LOAD_OPTION_ACTIVE 0x00000001
#define LOAD_OPTION_FORCE_RECONNECT 0x00000002
#define ESRT_FW_TYPE_DEVICEFIRMWARE 0x00000002
#define ESRT_FW_TYPE_UEFIDRIVER 0x00000003
+#define EFI_SYSTEM_RESOURCE_TABLE_GUID\
+ EFI_GUID(0xb122a263, 0x3661, 0x4f68,\
+ 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80)
+
/* Last Attempt Status Values */
#define LAST_ATTEMPT_STATUS_SUCCESS 0x00000000
#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL 0x00000001