From ea49e59ed0fc50085716e55d66395b6afef8a554 Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Mon, 12 Jul 2021 15:28:51 +0300 Subject: Update UefiLessonsPkg Signed-off-by: Konstantin Aladyshev --- .../Library/SimpleLibrary/SimpleLibrary.c | 5 ++++ .../Library/SimpleLibrary/SimpleLibrary.inf | 15 ++++++++++++ .../SimpleLibraryWithConstructor.c | 18 ++++++++++++++ .../SimpleLibraryWithConstructor.inf | 16 +++++++++++++ .../SimpleLibraryWithConstructorAndDestructor.c | 28 ++++++++++++++++++++++ .../SimpleLibraryWithConstructorAndDestructor.inf | 17 +++++++++++++ 6 files changed, 99 insertions(+) create mode 100644 UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.c create mode 100644 UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.inf create mode 100644 UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c create mode 100644 UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf create mode 100644 UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.c create mode 100644 UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.inf (limited to 'UefiLessonsPkg/Library') diff --git a/UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.c b/UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.c new file mode 100644 index 0000000..acffba4 --- /dev/null +++ b/UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.c @@ -0,0 +1,5 @@ +#include + +UINTN Plus2(UINTN number) { + return number+2; +} diff --git a/UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.inf b/UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.inf new file mode 100644 index 0000000..92027a4 --- /dev/null +++ b/UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.inf @@ -0,0 +1,15 @@ +[Defines] + INF_VERSION = 1.25 + BASE_NAME = SimpleLibrary + FILE_GUID = 826c8951-5bd2-4d72-a9d9-f7ab48684117 + MODULE_TYPE = UEFI_APPLICATION + VERSION_STRING = 1.0 + LIBRARY_CLASS = SimpleLibrary | UEFI_APPLICATION + +[Sources] + SimpleLibrary.c + +[Packages] + MdePkg/MdePkg.dec + UefiLessonsPkg/UefiLessonsPkg.dec + diff --git a/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c b/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c new file mode 100644 index 0000000..5ade80e --- /dev/null +++ b/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.c @@ -0,0 +1,18 @@ +#include +#include + +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/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf b/UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf new file mode 100644 index 0000000..fc56624 --- /dev/null +++ b/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 + diff --git a/UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.c b/UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.c new file mode 100644 index 0000000..f903e99 --- /dev/null +++ b/UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.c @@ -0,0 +1,28 @@ +#include +#include + +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; +} + +EFI_STATUS +EFIAPI +SimpleLibraryDestructor( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + Print(L"Hello from library destructor!\n"); + return EFI_SUCCESS; +} diff --git a/UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.inf b/UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.inf new file mode 100644 index 0000000..3fc3bbe --- /dev/null +++ b/UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.inf @@ -0,0 +1,17 @@ +[Defines] + INF_VERSION = 1.25 + BASE_NAME = SimpleLibraryWithConstructorAndDestructor + FILE_GUID = 96952c1e-86a6-4700-96b0-e7303ac3f92d + MODULE_TYPE = UEFI_APPLICATION + VERSION_STRING = 1.0 + LIBRARY_CLASS = SimpleLibrary | UEFI_APPLICATION + CONSTRUCTOR = SimpleLibraryConstructor + DESTRUCTOR = SimpleLibraryDestructor + +[Sources] + SimpleLibraryWithConstructorAndDestructor.c + +[Packages] + MdePkg/MdePkg.dec + UefiLessonsPkg/UefiLessonsPkg.dec + -- cgit v1.2.3-18-g5258