From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mgC56-0006X4-SP for mharc-grub-devel@gnu.org; Thu, 28 Oct 2021 16:33:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgC4x-0006V4-Lo for grub-devel@gnu.org; Thu, 28 Oct 2021 16:32:55 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:38439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgC4v-0004W4-Sg for grub-devel@gnu.org; Thu, 28 Oct 2021 16:32:51 -0400 Received: by mail-lf1-f53.google.com with SMTP id x27so16170445lfu.5 for ; Thu, 28 Oct 2021 13:32:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EU69h0Tzgwi+ilottH4fAgNpK0HJsyCFIcz/3NSg+ts=; b=CFN/mINJNIfO3gPCcKjiTi2M/u+ZJigB3BC5USIMjbINurhx1/38QKklSJMn3bdSJ2 8fIhGMerKvW9GBsz24YCbmbnxDbnbWBkRNAn3+3ioJ4v/wopErD0Ft3xhLJIWPBt/fhU YyIjCLvbnemv9xlvyiYYzQflSACcdNuB2ZEDnoR658iKgSikvh5mqu2rlPrIjtA5Ui42 bUb1OZks5YxeoxX/AHY6WGIkW1wUq5jnVOhZptI/9xcNJA9t9onjitmz8xJT6woUPpna fdzu9n4yjNES7ZjEFsosvoPtI+P32fnOx/O02XjVQj8bX2bw9ORk98gGoaGOQFy1cRCT 96RA== X-Gm-Message-State: AOAM531yat+T3wln+XY8+et0eKcyYmQ2kouU2LoJ5csaqbMiY9V6l3wH V1mq5jLDgtGwOkG8tHdWcViW6hKWklZqNl3W X-Google-Smtp-Source: ABdhPJx3KyFsEBY4neHoCmzPf8RDM5Hj66vpi0lhpc1lPR3wTUUwnaHMEEKcT+H7Mn69kHzxERkVOg== X-Received: by 2002:a05:6512:128c:: with SMTP id u12mr6402058lfs.227.1635453168203; Thu, 28 Oct 2021 13:32:48 -0700 (PDT) Received: from amanita.localdomain ([2a00:1370:811f:5cd1:1618:c3ff:fe69:39f3]) by smtp.gmail.com with ESMTPSA id v22sm291719lfr.175.2021.10.28.13.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 13:32:47 -0700 (PDT) From: Nikita Ermakov To: GRUB development mailing list Cc: Ard Biesheuvel , Atish Patra , Daniel Kiper , Heinrich Schuchardt , Leif Lindholm , Fu Wei , Nikita Ermakov Subject: [PATCH v3 2/7] efi: add definition of LoadFile2 protocol Date: Thu, 28 Oct 2021 23:31:15 +0300 Message-Id: <20211028203118.7908-3-arei@altlinux.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211028203118.7908-1-arei@altlinux.org> References: <20211028203118.7908-1-arei@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=209.85.167.53; envelope-from=coffe92@gmail.com; helo=mail-lf1-f53.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 20:32:59 -0000 From: Ard Biesheuvel Incorporate the EFI_LOAD_FILE2_PROTOCOL GUID and C types from the UEFI spec. Signed-off-by: Ard Biesheuvel Reviewed-by: Heinrich Schuchardt Signed-off-by: Nikita Ermakov --- grub-core/commands/efi/lsefi.c | 1 + include/grub/efi/api.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c index d1ce99af4..4085f5df2 100644 --- a/grub-core/commands/efi/lsefi.c +++ b/grub-core/commands/efi/lsefi.c @@ -55,6 +55,7 @@ struct known_protocol { GRUB_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID, "absolute pointer" }, { GRUB_EFI_DRIVER_BINDING_PROTOCOL_GUID, "EFI driver binding" }, { GRUB_EFI_LOAD_FILE_PROTOCOL_GUID, "load file" }, + { GRUB_EFI_LOAD_FILE2_PROTOCOL_GUID, "load file2" }, { GRUB_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID, "simple FS" }, { GRUB_EFI_TAPE_IO_PROTOCOL_GUID, "tape I/O" }, { GRUB_EFI_UNICODE_COLLATION_PROTOCOL_GUID, "unicode collation" }, diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index f1a52210c..3de0a7d12 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -149,6 +149,11 @@ { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ } +#define GRUB_EFI_LOAD_FILE2_PROTOCOL_GUID \ + { 0x4006c0c1, 0xfcb3, 0x403e, \ + { 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \ + } + #define GRUB_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ { 0x0964e5b22, 0x6459, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ @@ -1729,6 +1734,16 @@ struct grub_efi_rng_protocol }; typedef struct grub_efi_rng_protocol grub_efi_rng_protocol_t; +struct grub_efi_load_file2 +{ + grub_efi_status_t (*load_file)(struct grub_efi_load_file2 *this, + grub_efi_device_path_t *file_path, + grub_efi_boolean_t boot_policy, + grub_efi_uintn_t *buffer_size, + void *buffer); +}; +typedef struct grub_efi_load_file2 grub_efi_load_file2_t; + #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \ || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) \ || defined(__riscv) -- 2.33.1