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.f...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kin...@intel.com>
Cc: Rebecca Cran <rebe...@bsdio.com>
Cc: Yuwei Chen <yuwei.c...@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Signed-off-by: Laszlo Ersek <ler...@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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to