diff options
author | Konstantin Aladyshev <aladyshev22@gmail.com> | 2022-08-03 16:15:27 +0300 |
---|---|---|
committer | Konstantin Aladyshev <aladyshev22@gmail.com> | 2022-08-03 16:15:27 +0300 |
commit | e2a415f13a7090b12f9363d51a0d1f80cafded67 (patch) | |
tree | 6f2a6a108461d71e25e3ded92aee30e1a298e4f0 /Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.c | |
parent | 3cf6d5377332b7d91ff2a76b0d045e81654d845f (diff) | |
download | UEFI-Lessons-e2a415f13a7090b12f9363d51a0d1f80cafded67.tar.gz UEFI-Lessons-e2a415f13a7090b12f9363d51a0d1f80cafded67.tar.bz2 UEFI-Lessons-e2a415f13a7090b12f9363d51a0d1f80cafded67.zip |
Update fixed PCD lesson
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.c')
-rw-r--r-- | Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.c b/Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.c index 82b4d4a..7cc7788 100644 --- a/Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.c +++ b/Lessons/Lesson_20/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,6 +17,31 @@ UefiMain ( IN EFI_SYSTEM_TABLE *SystemTable ) { - Print(L"PcdMyVar32=%d\n", FixedPcdGet32(PcdMyVar32)); + 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)); + return EFI_SUCCESS; } |