]> git.sur5r.net Git - u-boot/commitdiff
efi_loader: add missing runtime services stubs
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 9 Feb 2018 19:41:21 +0000 (20:41 +0100)
committerAlexander Graf <agraf@suse.de>
Fri, 9 Feb 2018 23:25:49 +0000 (00:25 +0100)
Add stubs for UpdateCapsule, QueryCapsuleCapabilities, and
QueryVariableInfo.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_api.h
lib/efi_loader/efi_runtime.c

index 10598a22d55f37fce7f76b76afc58067af623c0d..3ba650e57e6dae5b6cb5e533a9ba9caab8166db1 100644 (file)
@@ -187,6 +187,17 @@ enum efi_reset_type {
 #define EFI_RUNTIME_SERVICES_SIGNATURE 0x5652453544e5552ULL
 #define EFI_RUNTIME_SERVICES_REVISION  0x00010000
 
+#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET     0x00010000
+#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE    0x00020000
+#define CAPSULE_FLAGS_INITIATE_RESET           0x00040000
+
+struct efi_capsule_header {
+       efi_guid_t *capsule_guid;
+       u32 header_size;
+       u32 flags;
+       u32 capsule_image_size;
+};
+
 struct efi_runtime_services {
        struct efi_table_hdr hdr;
        efi_status_t (EFIAPI *get_time)(struct efi_time *time,
@@ -216,9 +227,20 @@ struct efi_runtime_services {
        void (EFIAPI *reset_system)(enum efi_reset_type reset_type,
                                    efi_status_t reset_status,
                                    unsigned long data_size, void *reset_data);
-       void *update_capsule;
-       void *query_capsule_caps;
-       void *query_variable_info;
+       efi_status_t (EFIAPI *update_capsule)(
+                       struct efi_capsule_header **capsule_header_array,
+                       efi_uintn_t capsule_count,
+                       u64 scatter_gather_list);
+       efi_status_t (EFIAPI *query_capsule_caps)(
+                       struct efi_capsule_header **capsule_header_array,
+                       efi_uintn_t capsule_count,
+                       u64 maximum_capsule_size,
+                       u32 reset_type);
+       efi_status_t (EFIAPI *query_variable_info)(
+                       u32 attributes,
+                       u64 maximum_variable_storage_size,
+                       u64 remaining_variable_storage_size,
+                       u64 maximum_variable_size);
 };
 
 /* EFI Configuration Table and GUID definitions */
index 8104e08c466ca1853bcc6461cb696c99b15814b7..ccb4fc6141b8d45a19675a7eb8d78f455de3ddc2 100644 (file)
@@ -381,6 +381,32 @@ static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void)
        return EFI_INVALID_PARAMETER;
 }
 
+efi_status_t __efi_runtime EFIAPI efi_update_capsule(
+                       struct efi_capsule_header **capsule_header_array,
+                       efi_uintn_t capsule_count,
+                       u64 scatter_gather_list)
+{
+       return EFI_UNSUPPORTED;
+}
+
+efi_status_t __efi_runtime EFIAPI efi_query_capsule_caps(
+                       struct efi_capsule_header **capsule_header_array,
+                       efi_uintn_t capsule_count,
+                       u64 maximum_capsule_size,
+                       u32 reset_type)
+{
+       return EFI_UNSUPPORTED;
+}
+
+efi_status_t __efi_runtime EFIAPI efi_query_variable_info(
+                       u32 attributes,
+                       u64 maximum_variable_storage_size,
+                       u64 remaining_variable_storage_size,
+                       u64 maximum_variable_size)
+{
+       return EFI_UNSUPPORTED;
+}
+
 struct efi_runtime_services __efi_runtime_data efi_runtime_services = {
        .hdr = {
                .signature = EFI_RUNTIME_SERVICES_SIGNATURE,
@@ -398,4 +424,7 @@ struct efi_runtime_services __efi_runtime_data efi_runtime_services = {
        .set_variable = efi_set_variable,
        .get_next_high_mono_count = (void *)&efi_device_error,
        .reset_system = &efi_reset_system_boottime,
+       .update_capsule = efi_update_capsule,
+       .query_capsule_caps = efi_query_capsule_caps,
+       .query_variable_info = efi_query_variable_info,
 };