aboutsummaryrefslogtreecommitdiffstats
path: root/Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2021-07-10 02:52:52 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2021-07-10 02:52:52 +0300
commit7fc37763c9210aac932bb6a199d6f2171b8a3036 (patch)
tree5dcaccfb56b72b15bf4041cb9c75028da634e2df /Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor
parent017a590ec6c14e0f5366efd4da9be444b3e62809 (diff)
downloadUEFI-Lessons-7fc37763c9210aac932bb6a199d6f2171b8a3036.tar.gz
UEFI-Lessons-7fc37763c9210aac932bb6a199d6f2171b8a3036.tar.bz2
UEFI-Lessons-7fc37763c9210aac932bb6a199d6f2171b8a3036.zip
Add lesson 37
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor')
-rw-r--r--Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c18
-rw-r--r--Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf16
2 files changed, 34 insertions, 0 deletions
diff --git a/Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c b/Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c
new file mode 100644
index 0000000..5ade80e
--- /dev/null
+++ b/Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c
@@ -0,0 +1,18 @@
+#include <Library/UefiLib.h>
+#include <Library/SimpleLibrary.h>
+
+UINTN Plus2(UINTN number) {
+ return number+2;
+}
+
+EFI_STATUS
+EFIAPI
+SimpleLibraryConstructor(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ Print(L"Hello from library constructor!\n");
+ return EFI_SUCCESS;
+}
+
diff --git a/Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf b/Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf
new file mode 100644
index 0000000..fc56624
--- /dev/null
+++ b/Lessons/Lesson_37/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf
@@ -0,0 +1,16 @@
+[Defines]
+ INF_VERSION = 1.25
+ BASE_NAME = SimpleLibraryWithConstructor
+ FILE_GUID = 96952c1e-86a6-4700-96b0-e7303ac3f92d
+ MODULE_TYPE = UEFI_APPLICATION
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = SimpleLibrary | UEFI_APPLICATION
+ CONSTRUCTOR = SimpleLibraryConstructor
+
+[Sources]
+ SimpleLibraryWithConstructor.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ UefiLessonsPkg/UefiLessonsPkg.dec
+