/<...>/Build/UefiLessonsPkg/RELEASE_GCC5/X64/UefiLessonsPkg/PCDLesson/PCDLesson/DEBUG/AutoGen.h:108:106: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
108 | #define _PCD_SET_MODE_32_S_PcdPatchableInt32(Value) ((_gPcd_BinaryPatch_PcdPatchableInt32 = (Value)), RETURN_SUCCESS)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~.
아래 코드와 함께 사용해야 한다.
EFI_STATUS Status =PcdSet32S(PcdPatchableInt32,44);Print(L"Status=%r\n", Status);
PcdSet32S와 다르게 PatchPcdSet32 API 함수는 이러한 것이 필요치 않으므로, 다음처럼 간단하게 사용할 수 있다.
PatchPcdSet32(PcdPatchableInt32,43);
PCDLesson.c 애플리케이션 코드에서 두 SET 메소드를 모두 테스트한다.
Print(L"PcdPatchableInt32=0x%x\n",PatchPcdGet32(PcdPatchableInt32));Print(L"PcdPatchableInt32=0x%x\n",PcdGet32(PcdPatchableInt32));PatchPcdSet32(PcdPatchableInt32,43);Print(L"PcdPatchableInt32=%d\n",PatchPcdGet32(PcdPatchableInt32));EFI_STATUS Status =PcdSet32S(PcdPatchableInt32,44);Print(L"Status=%r\n", Status);Print(L"PcdPatchableInt32=%d\n",PatchPcdGet32(PcdPatchableInt32));
GenPatchPcdTable부터 시작해보겠다. 먼저 이 도구에 대한 도움말을 확인해보자.
$ ./BaseTools/BinWrappers/PosixLike/GenPatchPcdTable -h
Usage: GenPatchPcdTable.py -m <MapFile> -e <EfiFile> -o <OutFile>
Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-m MAPFILE, --mapfile=MAPFILE
Absolute path of module map file.
-e EFIFILE, --efifile=EFIFILE
Absolute path of EFI binary file.
-o OUTFILE, --outputfile=OUTFILE
Absolute path of output file to store the got
patchable PCD table.
$ ./BaseTools/BinWrappers/PosixLike/PatchPcdValue -h
Usage: PatchPcdValue.py -f Offset -u Value -t Type [-s MaxSize] <input_file>
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
Options:
-f PCDOFFSET, --offset=PCDOFFSET
Start offset to the image is used to store PCD value.
-u PCDVALUE, --value=PCDVALUE
PCD value will be updated into the image.
-t PCDTYPENAME, --type=PCDTYPENAME
The name of PCD data type may be one of VOID*,BOOLEAN,
UINT8, UINT16, UINT32, UINT64.
-s PCDMAXSIZE, --maxsize=PCDMAXSIZE
Max size of data buffer is taken by PCD value.It must
be set when PCD type is VOID*.
-v, --verbose Run verbosely
-d LOGLEVEL, --debug=LOGLEVEL
Run with debug information
-q, --quiet Run quietly
-? show this help message and exit
--version show program's version number and exit
-h, --help show this help message and exit