Skip to content

Commit c0c047f

Browse files
author
Laszlo Ersek
committed
AutoGen.c: list the SEC module type for <CONSTRUCTOR>/<DESTRUCTOR> (VOID)
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 <[email protected]> Cc: Liming Gao <[email protected]> Cc: Michael D Kinney <[email protected]> Cc: Rebecca Cran <[email protected]> Cc: Yuwei Chen <[email protected]> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991 Signed-off-by: Laszlo Ersek <[email protected]> Message-Id: <[email protected]> Reviewed-by: Liming Gao <[email protected]>
1 parent c8fbb7b commit c0c047f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

8_pre-build_autogen_stage/83_auto-generated_code.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ library instances that are being linked to.
756756
```c
757757
If (CONSTRUCTOR defined in INF) {
758758
759-
If (MODULE_TYPE == "BASE") {
759+
If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
760760
include_statement (AutoGen.c, "
761761
EFI_STATUS
762762
EFIAPI
@@ -798,7 +798,7 @@ If (CONSTRUCTOR defined in INF) {
798798
799799
} // End CONSTRUCTOR defined in INF
800800
801-
If (MODULE_TYPE == "BASE") {
801+
If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
802802
include_statement (AutoGen.c, "
803803
VOID
804804
EFIAPI
@@ -841,11 +841,11 @@ include_statement (AutoGen.c, "
841841
");
842842
843843
If (CONSTRUCTOR defined in INF) {
844-
If (MODULE_TYPE == "BASE") {
844+
If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
845845
include_statement (AutoGen.c, "
846846
EFI_STATUS Status;
847847
848-
Status = <CONSTRUCTOR>();
848+
Status = <CONSTRUCTOR> ();
849849
ASSERT_EFI_ERROR (Status);
850850
851851
");
@@ -889,7 +889,7 @@ of the library instances that are being linked to.
889889

890890
```c
891891
If (DESTRUCTOR defined in INF) {
892-
If (MODULE_TYPE == "BASE") {
892+
If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
893893
include_statement (AutoGen.c, "
894894
EFI_STATUS
895895
EFIAPI
@@ -925,7 +925,7 @@ If (DESTRUCTOR defined in INF) {
925925
}
926926
} // End DESTRUCTOR defined in INF
927927

928-
If (MODULE_TYPE == "BASE") {
928+
If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
929929
include_statement (AutoGen.c, "
930930
VOID
931931
EFIAPI
@@ -971,11 +971,11 @@ include_statement (AutoGen.c, "
971971
");
972972

973973
If (DESTRUCTOR defined in INF) {
974-
If (MODULE_TYPE == "BASE") {
974+
If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
975975
include_statement (AutoGen.c, "
976976
EFI_STATUS Status;
977977

978-
Status = <DESTRUCTOR>();
978+
Status = <DESTRUCTOR> ();
979979
ASSERT_EFI_ERROR (Status);
980980

981981
");

0 commit comments

Comments
 (0)