From 454eef0d67e82b7ce04bee76069b0d69da2deea6 Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Fri, 5 Aug 2022 16:57:53 +0300 Subject: PCDLesson updates Signed-off-by: Konstantin Aladyshev --- .../Lesson_25/UefiLessonsPkg/PCDLesson/PCDLesson.c | 68 +++++++++++++++++++++ .../UefiLessonsPkg/PCDLesson/PCDLesson.inf | 71 ++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 Lessons/Lesson_25/UefiLessonsPkg/PCDLesson/PCDLesson.c create mode 100644 Lessons/Lesson_25/UefiLessonsPkg/PCDLesson/PCDLesson.inf (limited to 'Lessons/Lesson_25/UefiLessonsPkg/PCDLesson') diff --git a/Lessons/Lesson_25/UefiLessonsPkg/PCDLesson/PCDLesson.c b/Lessons/Lesson_25/UefiLessonsPkg/PCDLesson/PCDLesson.c new file mode 100644 index 0000000..0fca03d --- /dev/null +++ b/Lessons/Lesson_25/UefiLessonsPkg/PCDLesson/PCDLesson.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021, Konstantin Aladyshev + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +#include +#include + +EFI_STATUS +EFIAPI +UefiMain ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + Print(L"PcdInt8=0x%x\n", FixedPcdGet8(PcdInt8)); + Print(L"PcdInt16=0x%x\n", FixedPcdGet16(PcdInt16)); + Print(L"PcdInt32=0x%x\n", FixedPcdGet32(PcdInt32)); + Print(L"PcdInt64=0x%x\n", FixedPcdGet64(PcdInt64)); + Print(L"PcdBool=0x%x\n", FixedPcdGetBool(PcdBool)); + Print(L"PcdInt8=0x%x\n", PcdGet8(PcdInt8)); + Print(L"PcdInt16=0x%x\n", PcdGet16(PcdInt16)); + Print(L"PcdInt32=0x%x\n", PcdGet32(PcdInt32)); + Print(L"PcdInt64=0x%x\n", PcdGet64(PcdInt64)); + Print(L"PcdIntBool=0x%x\n", PcdGetBool(PcdBool)); + + Print(L"PcdAsciiStr=%a\n", FixedPcdGetPtr(PcdAsciiStr)); + Print(L"PcdAsciiStrSize=%d\n", FixedPcdGetSize(PcdAsciiStr)); + Print(L"PcdUCS2Str=%s\n", PcdGetPtr(PcdUCS2Str)); + Print(L"PcdUCS2StrSize=%d\n", PcdGetSize(PcdUCS2Str)); + + for (UINTN i=0; i +# +# SPDX-License-Identifier: MIT +## + +[Defines] + INF_VERSION = 1.25 + BASE_NAME = PCDLesson + FILE_GUID = 8c1a6b71-0c4b-4497-aaad-07404edf142c + MODULE_TYPE = UEFI_APPLICATION + VERSION_STRING = 1.0 + ENTRY_POINT = UefiMain + +[Sources] + PCDLesson.c + +[Packages] + MdePkg/MdePkg.dec + UefiLessonsPkg/UefiLessonsPkg.dec + +[LibraryClasses] + UefiApplicationEntryPoint + UefiLib + +[FixedPcd] + gUefiLessonsPkgTokenSpaceGuid.PcdInt8 + gUefiLessonsPkgTokenSpaceGuid.PcdInt16 + gUefiLessonsPkgTokenSpaceGuid.PcdInt32 + gUefiLessonsPkgTokenSpaceGuid.PcdInt64 + gUefiLessonsPkgTokenSpaceGuid.PcdBool + gUefiLessonsPkgTokenSpaceGuid.PcdExpression + gUefiLessonsPkgTokenSpaceGuid.PcdExpression_1 + gUefiLessonsPkgTokenSpaceGuid.PcdExpression_2 + gUefiLessonsPkgTokenSpaceGuid.PcdExpression_3 + gUefiLessonsPkgTokenSpaceGuid.PcdAsciiStr + gUefiLessonsPkgTokenSpaceGuid.PcdUCS2Str + gUefiLessonsPkgTokenSpaceGuid.PcdArray + gUefiLessonsPkgTokenSpaceGuid.PcdGuidInBytes + gUefiLessonsPkgTokenSpaceGuid.PcdGuid + gUefiLessonsPkgTokenSpaceGuid.PcdGuidByPCD + gUefiLessonsPkgTokenSpaceGuid.PcdGuidByEfiGuid + gUefiLessonsPkgTokenSpaceGuid.PcdDevicePath + gUefiLessonsPkgTokenSpaceGuid.PcdIntCasts + gUefiLessonsPkgTokenSpaceGuid.PcdWithLabels + gUefiLessonsPkgTokenSpaceGuid.PcdArrayExt + gUefiLessonsPkgTokenSpaceGuid.PcdCustomStruct + gUefiLessonsPkgTokenSpaceGuid.PcdCustomStruct_1 + gUefiLessonsPkgTokenSpaceGuid.PcdArrayWithFixedSize + gUefiLessonsPkgTokenSpaceGuid.PcdArrayWithFixedSize_1 + gUefiLessonsPkgTokenSpaceGuid.PcdArrayWithFixedSize_2 + gUefiLessonsPkgTokenSpaceGuid.PcdArrayWithFixedSize_3 + gUefiLessonsPkgTokenSpaceGuid.PcdArrayWithFixedSize_4 + + gUefiLessonsPkgTokenSpaceGuid.PcdInt32Override|43 + + gUefiLessonsPkgTokenSpaceGuid.Region1Offset + gUefiLessonsPkgTokenSpaceGuid.Region1Size + +[FeaturePcd] + gUefiLessonsPkgTokenSpaceGuid.PcdFeatureFlag + +[PatchPcd] + gUefiLessonsPkgTokenSpaceGuid.PcdPatchableInt32 + +[Pcd] + gUefiLessonsPkgTokenSpaceGuid.PcdDynamicInt32 + +[PcdEx] + gUefiLessonsPkgTokenSpaceGuid.PcdDynamicExInt32 + -- cgit v1.2.3-18-g5258