diff options
author | Konstantin Aladyshev <aladyshev22@gmail.com> | 2022-08-04 13:55:01 +0300 |
---|---|---|
committer | Konstantin Aladyshev <aladyshev22@gmail.com> | 2022-08-04 13:55:01 +0300 |
commit | 33107d87e110c19815d2059e7df2e249bb125257 (patch) | |
tree | 3ebea9604e2f2a088dab6aa1d7e5b3485ad2fee3 /Lessons/Lesson_21/UefiLessonsPkg/PCDLesson | |
parent | e2a415f13a7090b12f9363d51a0d1f80cafded67 (diff) | |
download | UEFI-Lessons-33107d87e110c19815d2059e7df2e249bb125257.tar.gz UEFI-Lessons-33107d87e110c19815d2059e7df2e249bb125257.tar.bz2 UEFI-Lessons-33107d87e110c19815d2059e7df2e249bb125257.zip |
Update PCD override lesson
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'Lessons/Lesson_21/UefiLessonsPkg/PCDLesson')
-rw-r--r-- | Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.c | 34 | ||||
-rw-r--r-- | Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.inf | 31 |
2 files changed, 59 insertions, 6 deletions
diff --git a/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.c b/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.c index ce92e04..4f22579 100644 --- a/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.c +++ b/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.c @@ -7,6 +7,7 @@ #include <Library/UefiBootServicesTableLib.h> #include <Library/UefiLib.h> +#include <Library/DevicePathLib.h> #include <Library/PcdLib.h> EFI_STATUS @@ -16,8 +17,35 @@ UefiMain ( IN EFI_SYSTEM_TABLE *SystemTable ) { - Print(L"PcdMyVar32=%d\n", FixedPcdGet32(PcdMyVar32)); - Print(L"PcdMyVar32_1=%d\n", FixedPcdGet32(PcdMyVar32_1)); - Print(L"PcdMyVar32_2=%d\n", FixedPcdGet32(PcdMyVar32_2)); + 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<FixedPcdGetSize(PcdArray); i++) { + Print(L"PcdArray[%d]=0x%02x\n", i, ((UINT8*)FixedPcdGetPtr(PcdArray))[i]); + } + + Print(L"PcdGuidInBytes=%g\n", *(EFI_GUID*)FixedPcdGetPtr(PcdGuidInBytes)); + Print(L"PcdGuid=%g\n", *(EFI_GUID*)FixedPcdGetPtr(PcdGuid)); + + Print(L"PcdDevicePath: %s\n", ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*) FixedPcdGetPtr(PcdDevicePath), FALSE, FALSE)); + +//------------- + Print(L"PcdInt32Override=%d\n", FixedPcdGet32(PcdInt32Override)); +//------------- + return EFI_SUCCESS; } diff --git a/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.inf b/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.inf index ae10121..9a01b11 100644 --- a/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.inf +++ b/Lessons/Lesson_21/UefiLessonsPkg/PCDLesson/PCDLesson.inf @@ -24,7 +24,32 @@ UefiLib [FixedPcd] - gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32 - gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32_1|43 - gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32_2|43 + 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 |