From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by mx.groups.io with SMTP id smtpd.web12.2818.1667942174687646811 for ; Tue, 08 Nov 2022 13:16:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=sZEF/Qzw; spf=pass (domain: flex--dionnaglaze.bounces.google.com, ip: 209.85.214.202, mailfrom: 3hsdqywskbxkaflkkxdixwbdlldib.zljabsbibahz.dolrmp.fl@flex--dionnaglaze.bounces.google.com) Received: by mail-pl1-f202.google.com with SMTP id t3-20020a170902e84300b00186ab03043dso12074164plg.20 for ; Tue, 08 Nov 2022 13:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=pN//lnGSlZxrDf9qNXjBPWvSIKc3Tx6V54kbGv5QnnI=; b=sZEF/QzwZYwR355R9u4Qmgt/sixbalnO0HMxktS/AAz7dfO7drc34MWvpWE9X/ZoZY duE/7aSqVJuGUbLN/NAXjMcKrn9MTojAtqiKfDBqu3g7vqNtiWITOgXsezO5qrfFp8KS Bajc8bc4rzCLfOP5Kg2jCDMA+czkKHOy7dy70GlbFPgj447zTPIUMHIKY+9igax8BOdp suv1E5MdyVSYxurH1Vou0/NXdIikKRaO78XYEqnm+pZNSrjQHsL0MwW2yz2YBYv4Q2ID pl70kx5wJgxpEb6+SJK/TMdEqaBWozkG1/QMX97UANsB1ENPD11463GIxMmhs8hQwTYS WSnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pN//lnGSlZxrDf9qNXjBPWvSIKc3Tx6V54kbGv5QnnI=; b=cSR/qJayWpSdjZoVj0iY+iqnBlRn7dmLYjPZ7pD8N5l19x4ubbDlkdSyFcOH7xS5Co lP44lb21dyrq7LV2O44qD7gyrvNjgq10yAImP47gDzdHJ/cTjp4XnGZSkPZ/inhGA5Jy G88CCioQOtr67oDzzd1usPqqnQrCEQQqkoL6CkfM0CCFz+Of8Ilcft0bBc/OmGvk/kjP rFSxUJU66oouz8PkDUEl17vwtmDCLyuO2B7Vewy0IfM47nxYohpzw0gW3+vusPZxKhqA nchBqZm9Ii1QjAIQpTZ6W2CkOpXWG6M3B7Z1DqpE9nMVZjl1VA36QHPnqXjC0xzeGIeE 2uyw== X-Gm-Message-State: ACrzQf2Ipy6EZ3+3Ebk0lJRF86Lksv9u3+6IydC2kw92Ql3poCCSJoSc cLu8TUqm/EJdRtTDnaIlsdO7z7dIJOjMLkSmXFI9meGUVqpL7MaOYMqK1SE1SnVUxEVQS4o4AAI B//g8jmdARtgeaD7DktKI7hZe7t6COpbC9th6Q0/n0UItci5cMS3z6HMXKIttUFCofv2c4Ght X-Google-Smtp-Source: AMsMyM6xJ6E64LQkB80nNFaU9Gv4HrfT/sTbTkbFsICTuEKGyZJHq6+2jW8m85Us32igD97ne93gIaR1h1sBCFCIMQ== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a62:1c85:0:b0:563:3c15:f891 with SMTP id c127-20020a621c85000000b005633c15f891mr1066043pfc.76.1667942174028; Tue, 08 Nov 2022 13:16:14 -0800 (PST) Date: Tue, 8 Nov 2022 21:15:57 +0000 In-Reply-To: <20221108211557.3306520-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20221108211557.3306520-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221108211557.3306520-5-dionnaglaze@google.com> Subject: [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after ReadyToBoot From: "Dionna Glaze" To: devel@edk2.groups.io Cc: Dionna Glaze , Michael D Kinney , Ard Biesheuvel , Gerd Hoffman , Jiewen Yao Content-Type: text/plain; charset="UTF-8" The Uefi v2.9 specification adds this event group in section 3.1.7, with its GUID defined in the Related Definitions section of EFI_BOOT_SERVICES.CreateEventEx() in chapter 7. Cc: "Michael D Kinney" Cc: Ard Biesheuvel Cc: Gerd Hoffman Cc: Jiewen Yao Signed-off-by: Dionna Glaze --- MdePkg/Include/Library/UefiLib.h | 2 ++ MdePkg/Library/UefiLib/UefiLib.inf | 1 + MdePkg/Library/UefiLib/UefiNotTiano.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index be7da7fdf7..2c3342351e 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -890,6 +890,8 @@ UnicodeStringDisplayLength ( /** Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot(). + If successful, then create, signal and close the After Ready to Boot event. + This function abstracts the signaling of the Ready to Boot Event. The Framework moved from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller from how this event is created to prevent to code form having to change with the diff --git a/MdePkg/Library/UefiLib/UefiLib.inf b/MdePkg/Library/UefiLib/UefiLib.inf index 01ed92092d..5c4064eafa 100644 --- a/MdePkg/Library/UefiLib/UefiLib.inf +++ b/MdePkg/Library/UefiLib/UefiLib.inf @@ -60,6 +60,7 @@ gEfiGlobalVariableGuid ## SOMETIMES_CONSUMES ## Variable gEfiAcpi20TableGuid ## SOMETIMES_CONSUMES ## SystemTable gEfiAcpi10TableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiEventAfterReadyToBootGuid ## SOMETIMES_CONSUMES ## Event [Protocols] gEfiDriverBindingProtocolGuid ## SOMETIMES_PRODUCES diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c index d84e91fd01..04fe42f9f7 100644 --- a/MdePkg/Library/UefiLib/UefiNotTiano.c +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c @@ -208,6 +208,8 @@ EfiCreateEventReadyToBootEx ( /** Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot(). + If successful, then create, signal and close the After Ready to Boot event. + This function abstracts the signaling of the Ready to Boot Event. The Framework moved from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller from how this event is created to prevent to code form having to change with the @@ -222,11 +224,27 @@ EfiSignalEventReadyToBoot ( { EFI_STATUS Status; EFI_EVENT ReadyToBootEvent; + EFI_EVENT AfterReadyToBootEvent; Status = EfiCreateEventReadyToBoot (&ReadyToBootEvent); if (!EFI_ERROR (Status)) { gBS->SignalEvent (ReadyToBootEvent); gBS->CloseEvent (ReadyToBootEvent); + return; + } + + /* Then immediately signal the after ready to boot event group */ + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + EfiEventEmptyFunction, + NULL, + &gEfiEventAfterReadyToBootGuid, + AfterReadyToBootEvent + ); + if (!EFI_ERROR(Status)) { + gBS->SignalEvent (AfterReadyToBootEvent); + gBS->CloseEvent (AfterReadyToBootEvent); } } -- 2.38.1.431.g37b22c650d-goog