diff options
Diffstat (limited to 'Lessons/Lesson_20/UefiLessonsPkg/PCDLesson')
-rw-r--r-- | Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.c | 28 | ||||
-rw-r--r-- | Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.inf | 28 |
2 files changed, 54 insertions, 2 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; } diff --git a/Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.inf b/Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.inf index 3258a64..1d71c31 100644 --- a/Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.inf +++ b/Lessons/Lesson_20/UefiLessonsPkg/PCDLesson/PCDLesson.inf @@ -24,5 +24,31 @@ UefiLib [FixedPcd] - gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32 + 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 |