From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lmcBX-0007tO-Um for mharc-grub-devel@gnu.org; Fri, 28 May 2021 09:05:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmcBW-0007rH-7u for grub-devel@gnu.org; Fri, 28 May 2021 09:05:54 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:46989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmcBR-0002Fx-Lc for grub-devel@gnu.org; Fri, 28 May 2021 09:05:53 -0400 Received: by mail-lf1-f53.google.com with SMTP id i9so5165706lfe.13 for ; Fri, 28 May 2021 06:05:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m5anhQW1XGllLqECgjYhF3B4fkMdK8iAdlL1ESxXX7I=; b=IYvgzJLSe8tuk2tSsP96U14+2mmRgalNUUV5A6ItvCdFXiuQXun0bSNxuHgDAgw5jr Jjfezt3U6h1GeL4lmbSrjC/2+0SqilEA/bgy4zoTnQs3AKIThuLBqZMETd+fMSHYm9Ec foDGuTYhwJVvshZIyJ3TL/N/fe82U/5OySGIPdr6TQPatME3bszUYC6v9lk5ZadAnRYO oMykdlYBFUzrXXMq24fruRoxo202Gl/Sd7BJaK4F8NzeB5oe8wA+F6WshiT63Lb1lVgb VagXNNg0EeA9LEC7sRE2Sq3c+zBf0R0Ya5Bw4UwmgL/PsFhfWSwv3g1N0sLLOcpAkivz /UsQ== X-Gm-Message-State: AOAM533SU/3ViaI4b/hjAfOYiqjNI5tuxodvrnHD7jU5zbp0FewY0grN ovMd8Mn0hLxQRNVTzY+K2/dGxBDK7LGyTas2+r2kHA== X-Google-Smtp-Source: ABdhPJyhG9Ol3Dcb7XbxgjCwhXVFr61rAt6Bwga9e0wUuLFfLRFmwJ+gCyGUt9GjrGHKPNmGcD+nfA== X-Received: by 2002:a05:6512:2393:: with SMTP id c19mr5320956lfv.652.1622207147989; Fri, 28 May 2021 06:05:47 -0700 (PDT) Received: from localhost.localdomain (109-252-124-217.nat.spd-mgts.ru. [109.252.124.217]) by smtp.gmail.com with ESMTPSA id m25sm468129lfr.288.2021.05.28.06.05.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 May 2021 06:05:47 -0700 (PDT) From: Nikita Ermakov To: GRUB development mailing list Cc: Ard Biesheuvel , Atish Patra , Daniel Kiper , Heinrich Schuchardt , Leif Lindholm , Nikita Ermakov Subject: [PATCH 2/8] efi: add definition of LoadFile2 protocol Date: Fri, 28 May 2021 16:04:51 +0300 Message-Id: <20210528130457.13501-3-arei@altlinux.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210528130457.13501-1-arei@altlinux.org> References: <20210528130457.13501-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: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.25, 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: Fri, 28 May 2021 13:05:54 -0000 From: Ard Biesheuvel Incorporate the EFI_LOAD_FILE2_PROTOCOL GUID and C types from the UEFI spec. Signed-off-by: Ard Biesheuvel --- 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..145cbfcda 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 file 2" }, { 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.31.1