mirror of https://github.com/acidanthera/audk.git
Change return value of getGuidInfo from globaldata. Now only guid string is returned.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1195 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e55d8a3c6b
commit
20c5c53fd7
|
@ -779,8 +779,8 @@ public class GlobalData {
|
||||||
//
|
//
|
||||||
// For PCD get tokenSpaceGUid
|
// For PCD get tokenSpaceGUid
|
||||||
//
|
//
|
||||||
public synchronized static String[] getGuidInfoFromCname(String cName){
|
public synchronized static String getGuidInfoFromCname(String cName){
|
||||||
String cNameGuid[] = null;
|
String cNameGuid = null;
|
||||||
String guid = null;
|
String guid = null;
|
||||||
Set set = spdTable.keySet();
|
Set set = spdTable.keySet();
|
||||||
Iterator iter = set.iterator();
|
Iterator iter = set.iterator();
|
||||||
|
@ -793,9 +793,7 @@ public class GlobalData {
|
||||||
Spd spd = (Spd) spdTable.get(iter.next());
|
Spd spd = (Spd) spdTable.get(iter.next());
|
||||||
guid = spd.getGuidFromCname(cName);
|
guid = spd.getGuidFromCname(cName);
|
||||||
if (guid != null){
|
if (guid != null){
|
||||||
cNameGuid = new String[2];
|
cNameGuid = guid;
|
||||||
cNameGuid[0] = cName;
|
|
||||||
cNameGuid[1] = guid;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,12 +161,12 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
|
||||||
|
|
||||||
@param guidCName Guid CName string.
|
@param guidCName Guid CName string.
|
||||||
|
|
||||||
@return String[] Guid information from SPD file.
|
@return String Guid information from SPD file.
|
||||||
@throws PlatformPcdPreprocessException
|
@throws PlatformPcdPreprocessException
|
||||||
Fail to get Guid information from SPD file.
|
Fail to get Guid information from SPD file.
|
||||||
**/
|
**/
|
||||||
public String[] getGuidInfoFromSpd(String guidCName) throws PlatformPcdPreprocessException {
|
public String getGuidInfoFromSpd(String guidCName) throws PlatformPcdPreprocessException {
|
||||||
String[] tokenSpaceStrRet = null;
|
String tokenSpaceStrRet = null;
|
||||||
try {
|
try {
|
||||||
tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(guidCName);
|
tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(guidCName);
|
||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
|
@ -590,7 +590,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
|
||||||
String dynamicPrimaryKey = null;
|
String dynamicPrimaryKey = null;
|
||||||
DynamicPcdBuildDefinitions dynamicPcdBuildDefinitions = null;
|
DynamicPcdBuildDefinitions dynamicPcdBuildDefinitions = null;
|
||||||
List<DynamicPcdBuildDefinitions.PcdBuildData> dynamicPcdBuildDataArray = null;
|
List<DynamicPcdBuildDefinitions.PcdBuildData> dynamicPcdBuildDataArray = null;
|
||||||
String[] tokenSpaceStrRet = null;
|
String tokenSpaceStrRet = null;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If FPD document is not be opened, open and initialize it.
|
// If FPD document is not be opened, open and initialize it.
|
||||||
|
@ -618,7 +618,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
|
||||||
|
|
||||||
dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();
|
dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();
|
||||||
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
|
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
|
||||||
tokenSpaceStrRet = this.getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());
|
tokenSpaceStrRet = getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());
|
||||||
|
|
||||||
if (tokenSpaceStrRet == null) {
|
if (tokenSpaceStrRet == null) {
|
||||||
exceptionString = "Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName();
|
exceptionString = "Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName();
|
||||||
|
@ -627,7 +627,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
|
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
|
||||||
tokenSpaceStrRet[1]);
|
tokenSpaceStrRet);
|
||||||
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {
|
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {
|
||||||
return dynamicPcdBuildDataArray.get(index);
|
return dynamicPcdBuildDataArray.get(index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,11 +96,11 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
|
|
||||||
@param guidCName the CName of GUID
|
@param guidCName the CName of GUID
|
||||||
|
|
||||||
@return String[] Guid information from SPD file.
|
@return String Guid information from SPD file.
|
||||||
@throws PlatformPcdPreprocessException
|
@throws PlatformPcdPreprocessException
|
||||||
Fail to get Guid information from SPD file.
|
Fail to get Guid information from SPD file.
|
||||||
**/
|
**/
|
||||||
public abstract String[] getGuidInfoFromSpd(String guidCName)
|
public abstract String getGuidInfoFromSpd(String guidCName)
|
||||||
throws PlatformPcdPreprocessException;
|
throws PlatformPcdPreprocessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -188,7 +188,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
String moduleName = null;
|
String moduleName = null;
|
||||||
String datum = null;
|
String datum = null;
|
||||||
int maxDatumSize = 0;
|
int maxDatumSize = 0;
|
||||||
String[] tokenSpaceStrRet = null;
|
String tokenSpaceStrRet = null;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
|
@ -239,7 +239,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet[1]);
|
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet);
|
||||||
pcdType = Token.getPcdTypeFromString(pcdBuildData.getItemType().toString());
|
pcdType = Token.getPcdTypeFromString(pcdBuildData.getItemType().toString());
|
||||||
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
|
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
|
||||||
tokenNumber = Long.decode(pcdBuildData.getToken().toString());
|
tokenNumber = Long.decode(pcdBuildData.getToken().toString());
|
||||||
|
@ -408,7 +408,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
// If the token is not in database, create a new token instance and add
|
// If the token is not in database, create a new token instance and add
|
||||||
// a usage instance into this token in database.
|
// a usage instance into this token in database.
|
||||||
//
|
//
|
||||||
tokenSpaceStrRet = this.getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
|
tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
|
||||||
|
|
||||||
if (tokenSpaceStrRet == null) {
|
if (tokenSpaceStrRet == null) {
|
||||||
putError("Fail to get Token space guid for token" + token.cName +
|
putError("Fail to get Token space guid for token" + token.cName +
|
||||||
|
@ -420,7 +420,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]);
|
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);
|
||||||
|
|
||||||
token.datumType = datumType;
|
token.datumType = datumType;
|
||||||
token.tokenNumber = tokenNumber;
|
token.tokenNumber = tokenNumber;
|
||||||
|
@ -512,7 +512,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
boolean hasSkuId0 = false;
|
boolean hasSkuId0 = false;
|
||||||
long tokenNumber = 0;
|
long tokenNumber = 0;
|
||||||
String hiiDefaultValue = null;
|
String hiiDefaultValue = null;
|
||||||
String[] variableGuidString = null;
|
String variableGuidString = null;
|
||||||
|
|
||||||
List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo> skuInfoList = null;
|
List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo> skuInfoList = null;
|
||||||
DynamicPcdBuildDefinitions.PcdBuildData dynamicInfo = null;
|
DynamicPcdBuildDefinitions.PcdBuildData dynamicInfo = null;
|
||||||
|
@ -687,7 +687,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
skuInstance.value.setHiiData(varNameList,
|
skuInstance.value.setHiiData(varNameList,
|
||||||
translateSchemaStringToUUID(variableGuidString[1]),
|
translateSchemaStringToUUID(variableGuidString),
|
||||||
skuInfoList.get(index).getVariableOffset(),
|
skuInfoList.get(index).getVariableOffset(),
|
||||||
skuInfoList.get(index).getHiiDefaultValue().toString());
|
skuInfoList.get(index).getHiiDefaultValue().toString());
|
||||||
token.skuData.add(skuInstance);
|
token.skuData.add(skuInstance);
|
||||||
|
@ -738,8 +738,8 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
String temp;
|
String temp;
|
||||||
String exceptionString;
|
String exceptionString;
|
||||||
String hiiDefaultValue;
|
String hiiDefaultValue;
|
||||||
String tokenSpaceStrRet[];
|
String tokenSpaceStrRet;
|
||||||
String variableGuidString[];
|
String variableGuidString;
|
||||||
|
|
||||||
dynamicPcdBuildDataArray = getAllDynamicPcdInfoFromFpd();
|
dynamicPcdBuildDataArray = getAllDynamicPcdInfoFromFpd();
|
||||||
if (dynamicPcdBuildDataArray == null) {
|
if (dynamicPcdBuildDataArray == null) {
|
||||||
|
@ -748,7 +748,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
|
|
||||||
for (index2 = 0; index2 < dynamicPcdBuildDataArray.size(); index2++) {
|
for (index2 = 0; index2 < dynamicPcdBuildDataArray.size(); index2++) {
|
||||||
pcdBuildData = dynamicPcdBuildDataArray.get(index2);
|
pcdBuildData = dynamicPcdBuildDataArray.get(index2);
|
||||||
tokenSpaceStrRet = this.getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
|
tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
|
||||||
|
|
||||||
if (tokenSpaceStrRet == null) {
|
if (tokenSpaceStrRet == null) {
|
||||||
putError("Fail to get Token space guid for token" + pcdBuildData.getCName());
|
putError("Fail to get Token space guid for token" + pcdBuildData.getCName());
|
||||||
|
@ -756,7 +756,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
|
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
|
||||||
tokenSpaceStrRet[1]);
|
tokenSpaceStrRet);
|
||||||
|
|
||||||
if (pcdDbManager.isTokenInDatabase(primaryKey)) {
|
if (pcdDbManager.isTokenInDatabase(primaryKey)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -772,7 +772,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
//
|
//
|
||||||
// Create new token for unreference dynamic PCD token
|
// Create new token for unreference dynamic PCD token
|
||||||
//
|
//
|
||||||
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]);
|
token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);
|
||||||
token.datumSize = pcdBuildData.getMaxDatumSize();
|
token.datumSize = pcdBuildData.getMaxDatumSize();
|
||||||
|
|
||||||
|
|
||||||
|
@ -886,7 +886,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
//
|
//
|
||||||
// Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.
|
// Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.
|
||||||
//
|
//
|
||||||
variableGuidString = this.getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());
|
variableGuidString = getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());
|
||||||
if (variableGuidString == null) {
|
if (variableGuidString == null) {
|
||||||
exceptionString = String.format("In FPD file, for dynamic PCD %s, the variable guid %s can be found in all SPD file!",
|
exceptionString = String.format("In FPD file, for dynamic PCD %s, the variable guid %s can be found in all SPD file!",
|
||||||
token.cName,
|
token.cName,
|
||||||
|
@ -904,7 +904,7 @@ public abstract class PlatformPcdPreprocessAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
skuInstance.value.setHiiData(varNameList,
|
skuInstance.value.setHiiData(varNameList,
|
||||||
translateSchemaStringToUUID(variableGuidString[1]),
|
translateSchemaStringToUUID(variableGuidString),
|
||||||
skuInfoList.get(index).getVariableOffset(),
|
skuInfoList.get(index).getVariableOffset(),
|
||||||
skuInfoList.get(index).getHiiDefaultValue().toString());
|
skuInfoList.get(index).getHiiDefaultValue().toString());
|
||||||
token.skuData.add(skuInstance);
|
token.skuData.add(skuInstance);
|
||||||
|
|
Loading…
Reference in New Issue