edk2/EmbeddedPkg/Include/Protocol/GblEfiBootMemory.h
Dmitrii Merkurev dfaa76349d EmbeddedPkg: Introduce GBL protocols
GBL (Generic Bootloader) is Google's UEFI-based bootloader for Android.
It runs as an EFI application and delegates board- and platform-specific
operations to the underlying firmware through GBL-defined EFI protocols.

This patch adds only the header definitions (GUIDs, revisions and
interfaces) for those protocols, covering Android Verified Boot, AVF,
A/B boot-control, boot-memory, debug, Fastboot (and its transport) and
OS configuration.

For details, see:
https://cs.android.com/android/kernel/superproject/+/common-android-mainline:bootable/libbootloader/gbl/README.md

Co-authored-by: David Pursell <dpursell@google.com>
Co-authored-by: Dov Shlachter <dovs@google.com>
Co-authored-by: Jakob Vukalović <jakobvukalovic@google.com>
Co-authored-by: Kelvin Zhang <zhangkelvin@google.com>
Co-authored-by: Ram Muthiah <rammuthiah@google.com>
Co-authored-by: Sergii Parubochyi <sergiip@google.com>
Co-authored-by: Yecheng Zhao <zyecheng@google.com>
Co-authored-by: Yi-Yo Chiang <yochiang@google.com>
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2026-06-12 09:38:53 +00:00

74 lines
2.2 KiB
C

/** @file
GBL EFI Boot Memory Protocol.
Provides APIs for retrieving and synchronizing boot and partition buffers.
Related docs:
https://android.googlesource.com/platform/bootable/libbootloader/+/refs/heads/gbl-mainline/gbl/docs/gbl_efi_boot_memory_protocol.md
Copyright (c) 2025, The Android Open Source Project.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#pragma once
#include <Uefi/UefiBaseType.h>
//
// {309f2874-ad59-4fd2-af5e-ce0f4ab401a6}
//
#define GBL_EFI_BOOT_MEMORY_PROTOCOL_GUID \
{ 0x309f2874, 0xad59, 0x4fd2, { 0xaf, 0x5e, 0xce, 0x0f, 0x4a, 0xb4, 0x01, 0xa6 } }
#define GBL_EFI_BOOT_MEMORY_PROTOCOL_REVISION 0x00010000
typedef struct _GBL_EFI_BOOT_MEMORY_PROTOCOL GBL_EFI_BOOT_MEMORY_PROTOCOL;
typedef enum {
GblEfiBootBufferTypeGeneralLoad = 0,
GblEfiBootBufferTypeKernel,
GblEfiBootBufferTypeRamdisk,
GblEfiBootBufferTypeFdt,
GblEfiBootBufferTypePvmfwData,
GblEfiBootBufferTypeFastbootDownload
} GBL_EFI_BOOT_BUFFER_TYPE;
typedef enum {
GblEfiPartitionBufferFlagPreloaded = BIT0
} GBL_EFI_PARTITION_BUFFER_FLAG;
typedef
EFI_STATUS
(EFIAPI *GBL_EFI_BOOT_MEMORY_GET_PARTITION_BUFFER)(
IN GBL_EFI_BOOT_MEMORY_PROTOCOL *This,
IN CONST CHAR8 *BaseName,
OUT UINTN *Size,
OUT VOID **Addr,
OUT UINT32 *Flag // GBL_EFI_PARTITION_BUFFER_FLAG
);
typedef
EFI_STATUS
(EFIAPI *GBL_EFI_BOOT_MEMORY_SYNC_PARTITION_BUFFER)(
IN GBL_EFI_BOOT_MEMORY_PROTOCOL *This,
IN BOOLEAN SyncPreloaded
);
typedef
EFI_STATUS
(EFIAPI *GBL_EFI_BOOT_MEMORY_GET_BOOT_BUFFER)(
IN GBL_EFI_BOOT_MEMORY_PROTOCOL *This,
IN UINT32 BufType, // GBL_EFI_BOOT_BUFFER_TYPE
OUT UINTN *Size,
OUT VOID **Addr
);
struct _GBL_EFI_BOOT_MEMORY_PROTOCOL {
UINT64 Revision;
GBL_EFI_BOOT_MEMORY_GET_PARTITION_BUFFER GetPartitionBuffer;
GBL_EFI_BOOT_MEMORY_SYNC_PARTITION_BUFFER SyncPartitionBuffer;
GBL_EFI_BOOT_MEMORY_GET_BOOT_BUFFER GetBootBuffer;
};
extern EFI_GUID gGblEfiBootMemoryProtocolGuid;