mirror of https://github.com/acidanthera/audk.git
In before, FixedPcdGetxx macro was defined as global variable, it is wrong. It should be defined as value directly, and module developer can use it to define length of array.
1) Change macro FixedPcdGetxx to value macro. 2) Change some wrong macro usage in library. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@598 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
30a60d29aa
commit
dc530c7b9d
|
@ -26,23 +26,23 @@ Module Name: PcdLib.h
|
||||||
//
|
//
|
||||||
// Feature Flag is in the form of a global constant
|
// Feature Flag is in the form of a global constant
|
||||||
//
|
//
|
||||||
#define FeaturePcdGet(TokenName) _gPcd_FixedAtBuild_##TokenName
|
#define FeaturePcdGet(TokenName) _PCD_VALUE_##TokenName
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fixed is fixed at build time
|
// Fixed is fixed at build time
|
||||||
//
|
//
|
||||||
#define FixedPcdGet8(TokenName) _gPcd_FixedAtBuild_##TokenName
|
#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName
|
||||||
#define FixedPcdGet16(TokenName) _gPcd_FixedAtBuild_##TokenName
|
#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName
|
||||||
#define FixedPcdGet32(TokenName) _gPcd_FixedAtBuild_##TokenName
|
#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName
|
||||||
#define FixedPcdGet64(TokenName) _gPcd_FixedAtBuild_##TokenName
|
#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName
|
||||||
#define FixedPcdGetBool(TokenName) _gPcd_FixedAtBuild_##TokenName
|
#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// BugBug: This works for strings, but not constants.
|
// BugBug: This works for strings, but not constants.
|
||||||
//
|
//
|
||||||
#define FixedPcdGetPtr(TokenName) ((VOID *)_gPcd_FixedAtBuild_##TokenName)
|
#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -33,7 +33,7 @@ IsNodeInList (
|
||||||
ASSERT (List->BackLink != NULL);
|
ASSERT (List->BackLink != NULL);
|
||||||
ASSERT (Node != NULL);
|
ASSERT (Node != NULL);
|
||||||
|
|
||||||
Count = FixedPcdGet32 (PcdMaximumLinkedListLength);
|
Count = PcdGet32 (PcdMaximumLinkedListLength);
|
||||||
if (Count != 0) {
|
if (Count != 0) {
|
||||||
Count++;
|
Count++;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ IsNodeInList (
|
||||||
} while ((Ptr != List) && (Ptr != Node) && (Count > 0));
|
} while ((Ptr != List) && (Ptr != Node) && (Count > 0));
|
||||||
Found = (BOOLEAN)(Ptr == Node);
|
Found = (BOOLEAN)(Ptr == Node);
|
||||||
|
|
||||||
if (FixedPcdGet32 (PcdMaximumLinkedListLength) > 0) {
|
if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {
|
||||||
while ((Count > 0) && (Ptr != List)) {
|
while ((Count > 0) && (Ptr != List)) {
|
||||||
Ptr = Ptr->ForwardLink;
|
Ptr = Ptr->ForwardLink;
|
||||||
Count--;
|
Count--;
|
||||||
|
|
|
@ -155,8 +155,8 @@ StrLen (
|
||||||
// If PcdMaximumUnicodeStringLength is not zero,
|
// If PcdMaximumUnicodeStringLength is not zero,
|
||||||
// length should not more than PcdMaximumUnicodeStringLength
|
// length should not more than PcdMaximumUnicodeStringLength
|
||||||
//
|
//
|
||||||
if (FixedPcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
|
if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
|
||||||
ASSERT (Length < FixedPcdGet32 (PcdMaximumUnicodeStringLength));
|
ASSERT (Length < PcdGet32 (PcdMaximumUnicodeStringLength));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Length;
|
return Length;
|
||||||
|
@ -520,8 +520,8 @@ AsciiStrLen (
|
||||||
// If PcdMaximumUnicodeStringLength is not zero,
|
// If PcdMaximumUnicodeStringLength is not zero,
|
||||||
// length should not more than PcdMaximumUnicodeStringLength
|
// length should not more than PcdMaximumUnicodeStringLength
|
||||||
//
|
//
|
||||||
if (FixedPcdGet32 (PcdMaximumAsciiStringLength) != 0) {
|
if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
|
||||||
ASSERT (Length < FixedPcdGet32 (PcdMaximumAsciiStringLength));
|
ASSERT (Length < PcdGet32 (PcdMaximumAsciiStringLength));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Length;
|
return Length;
|
||||||
|
|
|
@ -131,12 +131,12 @@ AcquireSpinLock (
|
||||||
Tick = 0;
|
Tick = 0;
|
||||||
Start = 0;
|
Start = 0;
|
||||||
End = 0;
|
End = 0;
|
||||||
if (FixedPcdGet32 (PcdSpinLockTimeout) > 0) {
|
if (PcdGet32 (PcdSpinLockTimeout) > 0) {
|
||||||
Tick = GetPerformanceCounter ();
|
Tick = GetPerformanceCounter ();
|
||||||
Timeout = DivU64x32 (
|
Timeout = DivU64x32 (
|
||||||
MultU64x32 (
|
MultU64x32 (
|
||||||
GetPerformanceCounterProperties (&Start, &End),
|
GetPerformanceCounterProperties (&Start, &End),
|
||||||
FixedPcdGet32 (PcdSpinLockTimeout)
|
PcdGet32 (PcdSpinLockTimeout)
|
||||||
),
|
),
|
||||||
1000000
|
1000000
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue