mirror of https://github.com/acidanthera/audk.git
After change token space guid from guid value to Guid's CName, change code to support that.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@707 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f072578654
commit
548ce97a81
|
@ -768,13 +768,18 @@ public class GlobalData {
|
||||||
String guid = null;
|
String guid = null;
|
||||||
Set set = spdTable.keySet();
|
Set set = spdTable.keySet();
|
||||||
Iterator iter = set.iterator();
|
Iterator iter = set.iterator();
|
||||||
|
|
||||||
|
if (iter == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
while (iter.hasNext()){
|
while (iter.hasNext()){
|
||||||
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[0] = new String(cName);
|
cNameGuid = new String[2];
|
||||||
cNameGuid[1] = new String(guid);
|
cNameGuid[0] = cName;
|
||||||
|
cNameGuid[1] = guid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2077,12 +2077,12 @@ public class CollectPCDAction {
|
||||||
boolean isDuplicate = false;
|
boolean isDuplicate = false;
|
||||||
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
|
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
|
||||||
Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
|
Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
|
||||||
long tokenNumber = 0;
|
long tokenNumber = 0;
|
||||||
String moduleName = null;
|
String moduleName = null;
|
||||||
String datum = null;
|
String datum = null;
|
||||||
int maxDatumSize = 0;
|
int maxDatumSize = 0;
|
||||||
String tokenSpaceGuidString = null;
|
String[] tokenSpaceStrRet = null;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
// 1), Get all <ModuleSA> from FPD file.
|
// 1), Get all <ModuleSA> from FPD file.
|
||||||
|
@ -2145,11 +2145,20 @@ public class CollectPCDAction {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
for (pcdIndex = 0; pcdIndex < pcdBuildDataArray.size(); pcdIndex ++) {
|
for (pcdIndex = 0; pcdIndex < pcdBuildDataArray.size(); pcdIndex ++) {
|
||||||
//tokenSpaceGuidString = GlobalData.getGuidInfoFromCname(pcdBuildData.getTokenSpaceGuidCName())[1];
|
|
||||||
tokenSpaceGuidString = null;
|
|
||||||
pcdBuildData = pcdBuildDataArray.get(pcdIndex);
|
pcdBuildData = pcdBuildDataArray.get(pcdIndex);
|
||||||
|
|
||||||
|
try {
|
||||||
|
tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(pcdBuildData.getTokenSpaceGuidCName());
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
throw new EntityException ("Faile get Guid for token " + pcdBuildData.getCName() + ":" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tokenSpaceStrRet == null) {
|
||||||
|
throw new EntityException ("Fail to get Token space guid for token" + pcdBuildData.getCName());
|
||||||
|
}
|
||||||
|
|
||||||
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
|
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
|
||||||
translateSchemaStringToUUID(tokenSpaceGuidString));
|
translateSchemaStringToUUID(tokenSpaceStrRet[1]));
|
||||||
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());
|
||||||
|
@ -2278,10 +2287,18 @@ public class CollectPCDAction {
|
||||||
// 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.
|
||||||
//
|
//
|
||||||
//String tokenSpaceString = GlobalData.getGuidInfoFromCname(pcdBuildData.getTokenSpaceGuidCName())[1];
|
try {
|
||||||
String tokenSpaceString = null;
|
tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(pcdBuildData.getTokenSpaceGuidCName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new EntityException("Fail to get token space guid for token " + token.cName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tokenSpaceStrRet == null) {
|
||||||
|
throw new EntityException("Fail to get token space guid for token " + token.cName);
|
||||||
|
}
|
||||||
|
|
||||||
token = new Token(pcdBuildData.getCName(),
|
token = new Token(pcdBuildData.getCName(),
|
||||||
translateSchemaStringToUUID(tokenSpaceString));
|
translateSchemaStringToUUID(tokenSpaceStrRet[1]));
|
||||||
|
|
||||||
token.datumType = datumType;
|
token.datumType = datumType;
|
||||||
token.tokenNumber = tokenNumber;
|
token.tokenNumber = tokenNumber;
|
||||||
|
@ -2674,6 +2691,7 @@ public class CollectPCDAction {
|
||||||
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;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If FPD document is not be opened, open and initialize it.
|
// If FPD document is not be opened, open and initialize it.
|
||||||
|
@ -2701,8 +2719,18 @@ public class CollectPCDAction {
|
||||||
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
|
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
|
||||||
//String tokenSpaceGuidString = GlobalData.getGuidInfoFromCname(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName())[1];
|
//String tokenSpaceGuidString = GlobalData.getGuidInfoFromCname(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName())[1];
|
||||||
String tokenSpaceGuidString = null;
|
String tokenSpaceGuidString = null;
|
||||||
|
try {
|
||||||
|
tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new EntityException ("Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tokenSpaceStrRet == null) {
|
||||||
|
throw new EntityException ("Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName());
|
||||||
|
}
|
||||||
|
|
||||||
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
|
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
|
||||||
translateSchemaStringToUUID(tokenSpaceGuidString));
|
translateSchemaStringToUUID(tokenSpaceStrRet[1]));
|
||||||
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {
|
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {
|
||||||
return dynamicPcdBuildDataArray.get(index);
|
return dynamicPcdBuildDataArray.get(index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue