From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by mx.groups.io with SMTP id smtpd.web08.963.1664579194388537241 for ; Fri, 30 Sep 2022 16:06:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=phyOYoTm; spf=pass (domain: flex--dionnaglaze.bounces.google.com, ip: 209.85.214.201, mailfrom: 3exy3ywskbwqfkqppcincbgiqqing.eqofgxgngfme.itqwru.kq@flex--dionnaglaze.bounces.google.com) Received: by mail-pl1-f201.google.com with SMTP id d7-20020a170903230700b00177f6dd8472so4089055plh.6 for ; Fri, 30 Sep 2022 16:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date; bh=qS5n+G+gYHpSmTJsfwaWnaPULtdl2b0YmYATgHJzGJA=; b=phyOYoTmadiRataxPmBCJZFGcuGfWhW2qB41YKle65z0TREl5/Mpq9JAa6enLUeOOE c7/qHeT0+/16Qn13J+mKq9cgU+dUhCfQMD/E/bstRunknRAdeuS99nmkeWRgLE2XHBJ4 x8CUzYae1Nty9YYkFZj1rs7siZH/W2faiR6Hr/Ou4HQNpYsYt5TeZMO4pFwpcFXpvT4E +UTi+ut8zF85coVj4Ehe4qejSuiskTn1dZzNTb+W58fvTsRAEBqEMm1uEMIfOnmSWNSC VbWulCE78nyvAvgz2ZWb2vwmJ1Pou+DZDuTjTEDxQ3gbq6d/DQNaAmxhwA2PDFDd8V4R ljkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date; bh=qS5n+G+gYHpSmTJsfwaWnaPULtdl2b0YmYATgHJzGJA=; b=DF/gVkVaZBTYNuz+6MTPy0MfiSBe9kRwbrOOfHQ7N455DwbsMb5ZZw4QrPiuECPGuZ Lky+nRn1xSsbnsqvLkqDTYlLVAGx2ZoFrb77jxayTbDKJ5YkRPm/QrsxMABrs5CHlTAE zHfozTjDyM8y1s2pv/bj6c7y2DccyYfO8YIqFzbgAdL+mX0hPEJjybz3upxq+Dzc3Idi nah/cDmtevGM1naNM7EuhFPpkoA2IfQjJU/oUH4EuW2Gg7zbU1kbRz4Rb9Cg45Rp0zrv YWWb9whkr36hrk/Affdiwyg1WU/UJr0wr3HYKeGByegFOjIlCJpTgSJFD/j/dS8WCsZw gcHg== X-Gm-Message-State: ACrzQf0h1TRi5l3AZ+iLHBiXsYJcnQ4NMG5SvcML63G6deCndhPRDkBS DoChzMYsLIf4VSo0fgbc5PU9QnyNjdQSxo8nuZpzMDWzIMHRZXOL8wpOtyyQl3uAFjAIErfxalt h5nmGZxKklMxweFY/U/S0D42j2iUyOL3+dJ/AWr854pdL5lNnDvH7zBpSsVeHYqqkhiZ6iyZs X-Google-Smtp-Source: AMsMyM4GXFiw67kuFWFpliPsYsY9yRdEUxsKI1ATkpbo2zbFRENg7zLEwLApLwMZErz/KOj7ZZ1LXAwPK1ZHAvQALQ== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a05:6a00:e8f:b0:536:c98e:8307 with SMTP id bo15-20020a056a000e8f00b00536c98e8307mr11424985pfb.73.1664579193795; Fri, 30 Sep 2022 16:06:33 -0700 (PDT) Date: Fri, 30 Sep 2022 23:06:22 +0000 In-Reply-To: <20220930230627.3371754-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20220930230627.3371754-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog Message-ID: <20220930230627.3371754-3-dionnaglaze@google.com> Subject: [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCallbackProtocol From: "Dionna Glaze" To: devel@edk2.groups.io Cc: Dionna Glaze , Gerd Hoffmann , "Min M. Xu" , James Bottomley , Jiewen Yao , Tom Lendacky , Ard Biesheuvel , Andrew Fish , "Michael D. Kinney" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This introduces a callback after the time that the timer is disabled and be= fore the MemoryMap is finalized. This callback is useful to make final changes to the memory map due to prot= ocols initiated (or not initiated) by the OS loader. Cc: Gerd Hoffmann Cc: "Min M. Xu" Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by: Dionna Glaze --- MdePkg/Include/Protocol/ExitBootServicesCallback.h | 38 ++++++++++++++++++= ++ MdePkg/MdePkg.dec | 3 ++ 2 files changed, 41 insertions(+) diff --git a/MdePkg/Include/Protocol/ExitBootServicesCallback.h b/MdePkg/In= clude/Protocol/ExitBootServicesCallback.h new file mode 100644 index 0000000000..d21d7700f7 --- /dev/null +++ b/MdePkg/Include/Protocol/ExitBootServicesCallback.h @@ -0,0 +1,38 @@ +/** @file + The file provides the protocol that allows callbacks in ExitBootServices + immediately before TerminateMemoryMap. + + Copyright (c) 2022, Google LLC. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef EXIT_BOOT_SERVICES_CALLBACK_H_ +#define EXIT_BOOT_SERVICES_CALLBACK_H_ + +/* This protocol is internal to EDK2 only */ + +#define EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL_GUID {0xf5684799, = 0x9a33, = 0x40f7, = {0xa1, 0x5c, 0x10, 0x8e, 0x0e, 0x6b, 0x45, 0x25}} + +typedef struct _EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL + EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL; + +/** + @param This A pointer to a EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL. +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_TERMINATE_MEMORY_MAP_PREHOOK)( + IN EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL *This + ); + +/// +/// The EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL allows callbacks in +/// ExitBootServices immediately before TerminateMemoryMap. +/// +struct _EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL { + EDKII_TERMINATE_MEMORY_MAP_PREHOOK TerminateMemoryMapPrehook; + BOOLEAN Disabled; +}; + +extern EFI_GUID gEdkiiExitBootServicesCallbackProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index de3c56758b..43b099b396 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1019,6 +1019,9 @@ gEfiPeiDelayedDispatchPpiGuid =3D { 0x869c711d, 0x649c, 0x44fe, { 0x8b,= 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }} =20 [Protocols] + ## Include/Protocol/ExitBootServicesCallback.h + gEdkiiExitBootServicesCallbackProtocolGuid =3D { 0xf5684799, 0x9a33, 0x4= 0f7, {0xa1, 0x5c, 0x10, 0x8e, 0x0e, 0x6b, 0x45, 0x25 }} + ## Include/Protocol/MemoryAccept.h gEfiMemoryAcceptProtocolGuid =3D { 0x38c74800, 0x5590, 0x4db4, { 0xa0,= 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }} =20 --=20 2.38.0.rc1.362.ged0d419d3c-goog