Skip to content

Commit 7a7165a

Browse files
author
Laszlo Ersek
committed
AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules
Most module types have standardized entry point function prototypes. They are declared in headers like - MdePkg/Include/Library/PeiCoreEntryPoint.h - MdePkg/Include/Library/PeimEntryPoint.h - MdePkg/Include/Library/DxeCoreEntryPoint.h - MdePkg/Include/Library/UefiDriverEntryPoint.h - MdePkg/Include/Library/UefiApplicationEntryPoint.h These header files also declare matching ProcessLibraryConstructorList() prototypes. The SEC module type does not have a standardized entry point prototype (aka parameter list), therefore no header file like the above ones exists for SEC. Consequently, no header file *declares* ProcessLibraryConstructorList() for SEC modules, even though AutoGen always *defines* ProcessLibraryConstructorList() with the same, empty, parameter list (i.e., just (VOID)). The lack of a central declaration is a problem because in SEC code, ProcessLibraryConstructorList() needs to be called manually, and those calls need a prototype. Most SEC modules in edk2 get around this by declaring ProcessLibraryConstructorList() manually, while some others use an incorrect (PEIM) prototype. Liming suggested in <https://bugzilla.tianocore.org/show_bug.cgi?id=991#c2> that AutoGen provide the declaration as well. Accompanying the upcoming BaseTools patch, document the feature in the Build spec. "INF_VERSION >= 1.30" reflects that the latest (draft) version of the INF specification, as of this writing, is commit a31e3c842bee / version 1.29. 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 Suggested-by: Liming Gao <[email protected]> Suggested-by: Michael D Kinney <[email protected]> Signed-off-by: Laszlo Ersek <[email protected]> Message-Id: <[email protected]> Reviewed-by: Liming Gao <[email protected]>
1 parent c0c047f commit 7a7165a

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

8_pre-build_autogen_stage/83_auto-generated_code.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,31 @@ include_statement(AutoGen.h, "
649649
");
650650
```
651651

652-
#### 8.3.6.5 AutoGen Epilogue
652+
#### 8.3.6.5 `ProcessLibraryConstructorList` function declaration
653+
654+
Entry point functions of non-library SEC modules do not have standardized
655+
parameter lists, therefore edk2 does not offer an
656+
`MdePkg/Include/Library/*EntryPoint.h` header file for such modules.
657+
Consequently, `ProcessLibraryConstructorList` is not declared for them either,
658+
despite the fact that they must call `ProcessLibraryConstructorList` explicitly.
659+
Historically, each such module has declared `ProcessLibraryConstructorList`
660+
internally for itself, compensating for the lack of a central declaration.
661+
662+
The `ProcessLibraryConstructorList` function is declared in `AutoGen.h` for
663+
non-library SEC modules, if `INF_VERSION` in the module's INF file is greater
664+
than or equal to `1.30`.
665+
666+
```c
667+
include_statement (AutoGen.h, "
668+
VOID
669+
EFIAPI
670+
ProcessLibraryConstructorList (
671+
VOID
672+
);
673+
");
674+
```
675+
676+
#### 8.3.6.6 AutoGen Epilogue
653677
654678
```c
655679
#ifdef __cplusplus

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,4 @@ Copyright (c) 2008-2017, Intel Corporation. All rights reserved.
231231
| | [#598](https://bugzilla.tianocore.org/show_bug.cgi?id=598) update supported operators in 8.2.4.6 Expressions | |
232232
| 1.29 | [#1453](https://bugzilla.tianocore.org/show_bug.cgi?id=1453) Update Build spec to remove EDK related contents | Mar 2019 |
233233
| 1.30 | [#1952](https://bugzilla.tianocore.org/show_bug.cgi?id=1952) Update Build spec to support HOST_APPLICATION MODULE_TYPE | July 2019 |
234+
| 1.31 | [#991](https://bugzilla.tianocore.org/show_bug.cgi?id=991) generate ProcessLibraryConstructorList() declaration in AutoGen.h for SEC modules | February 2024 |

0 commit comments

Comments
 (0)