public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: edk2-devel-groups-io <devel@edk2.groups.io>
Cc: Bob Feng <bob.c.feng@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Rebecca Cran <rebecca@bsdio.com>,
	Yuwei Chen <yuwei.chen@intel.com>
Subject: [edk2-devel] [edk2-BuildSpecification PATCH 2/3] AutoGen.c: list the SEC module type for <CONSTRUCTOR>/<DESTRUCTOR> (VOID)
Date: Sat, 24 Feb 2024 22:23:37 +0100	[thread overview]
Message-ID: <20240224212338.42671-3-lersek@redhat.com> (raw)
In-Reply-To: <20240224212338.42671-1-lersek@redhat.com>

Minimally as of edk2 commit edc6681206c1, the

- CreateLibraryConstructorCode()
- CreateLibraryDestructorCode()

methods in "BaseTools/Source/Python/AutoGen/GenC.py" generate declarations
and calls of the form

- <CONSTRUCTOR> (VOID)
- <DESTRUCTOR> (VOID)

(respectively), for pre-requisite libraries that have type BASE or SEC:

   1340         if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
   1341             ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))
   1342             ConstructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))

   1403         if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
   1404             DestructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))
   1405             DestructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))

The build spec only lists BASE thus far; cover SEC now.

This patch is best viewed with "git show -W".

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 8_pre-build_autogen_stage/83_auto-generated_code.md | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/8_pre-build_autogen_stage/83_auto-generated_code.md b/8_pre-build_autogen_stage/83_auto-generated_code.md
index b9a40ef44435..3e1da3809000 100644
--- a/8_pre-build_autogen_stage/83_auto-generated_code.md
+++ b/8_pre-build_autogen_stage/83_auto-generated_code.md
@@ -756,7 +756,7 @@ library instances that are being linked to.
 ```c
 If (CONSTRUCTOR defined in INF) {
 
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
     include_statement (AutoGen.c, "
       EFI_STATUS
       EFIAPI
@@ -798,7 +798,7 @@ If (CONSTRUCTOR defined in INF) {
 
 } // End CONSTRUCTOR defined in INF
 
-If (MODULE_TYPE == "BASE") {
+If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
   include_statement (AutoGen.c, "
     VOID
     EFIAPI
@@ -841,11 +841,11 @@ include_statement (AutoGen.c, "
 ");
 
 If (CONSTRUCTOR defined in INF) {
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
     include_statement (AutoGen.c, "
        EFI_STATUS Status;
 
-       Status = <CONSTRUCTOR>();
+       Status = <CONSTRUCTOR> ();
        ASSERT_EFI_ERROR (Status);
 
     ");
@@ -889,7 +889,7 @@ of the library instances that are being linked to.
 
 ```c
 If (DESTRUCTOR defined in INF) {
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
     include_statement (AutoGen.c, "
       EFI_STATUS
       EFIAPI
@@ -925,7 +925,7 @@ If (DESTRUCTOR defined in INF) {
   }
 } // End DESTRUCTOR defined in INF
 
-If (MODULE_TYPE == "BASE") {
+If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
   include_statement (AutoGen.c, "
     VOID
     EFIAPI
@@ -971,11 +971,11 @@ include_statement (AutoGen.c, "
 ");
 
 If (DESTRUCTOR defined in INF) {
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
     include_statement (AutoGen.c, "
       EFI_STATUS Status;
 
-      Status = <DESTRUCTOR>();
+      Status = <DESTRUCTOR> ();
       ASSERT_EFI_ERROR (Status);
 
     ");



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115914): https://edk2.groups.io/g/devel/message/115914
Mute This Topic: https://groups.io/mt/104554008/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2024-02-24 21:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24 20:59 [edk2-devel] [v2] BaseTools/AutoGen: declare ProcessLibraryConstructorList() for SEC modules Laszlo Ersek
2024-02-24 21:05 ` [edk2-devel] [PATCH] " Laszlo Ersek
2024-02-25  3:32   ` [edk2-devel] 回复: " gaoliming via groups.io
2024-02-29 10:17     ` Laszlo Ersek
2024-02-24 21:23 ` [edk2-devel] [edk2-BuildSpecification PATCH 0/3] AutoGen.h: " Laszlo Ersek
2024-02-24 21:23   ` [edk2-devel] [edk2-BuildSpecification PATCH 1/3] README.md: fix revision history whitespace Laszlo Ersek
2024-02-24 21:23   ` Laszlo Ersek [this message]
2024-02-24 21:23   ` [edk2-devel] [edk2-BuildSpecification PATCH 3/3] AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules Laszlo Ersek
2024-02-24 21:49   ` [edk2-devel] [edk2-BuildSpecification PATCH 0/3] " Laszlo Ersek
2024-03-01 12:53   ` 回复: " gaoliming via groups.io
2024-03-01 13:40     ` Laszlo Ersek
2024-02-24 21:28 ` [edk2-devel] [edk2-InfSpecification PATCH 0/2] README: INF_VERSION >= 1.30: declare ProcessLibraryCon...() " Laszlo Ersek
2024-02-24 21:28   ` [edk2-devel] [edk2-InfSpecification PATCH 1/2] README.md: fix revision history whitespace Laszlo Ersek
2024-02-24 21:28   ` [edk2-devel] [edk2-InfSpecification PATCH 2/2] README: INF_VERSION >= 1.30: declare ProcessLibraryCon...() for SEC modules Laszlo Ersek
2024-02-24 21:51   ` [edk2-devel] [edk2-InfSpecification PATCH 0/2] " Laszlo Ersek
2024-03-01 12:52   ` 回复: " gaoliming via groups.io
2024-03-01 13:46     ` Laszlo Ersek
2024-02-27 23:41 ` [edk2-devel] [v2] BaseTools/AutoGen: declare ProcessLibraryConstructorList() " Rebecca Cran
2024-03-02 18:14   ` Laszlo Ersek
2024-03-01 11:30 ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240224212338.42671-3-lersek@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox