diff options
Diffstat (limited to 'Tools/Java/Source/GenBuild/org/tianocore/build/global')
-rw-r--r-- | Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java | 6 | ||||
-rw-r--r-- | Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java | 230 |
2 files changed, 235 insertions, 1 deletions
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java index f941f4d03d..b5605d4cb1 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java @@ -434,6 +434,12 @@ public class GlobalData { msaMap.put("Protocols", cloneXmlObject(msa.getProtocols(), true));
msaMap.put("PPIs", cloneXmlObject(msa.getPPIs(), true));
msaMap.put("Guids", cloneXmlObject(msa.getGuids(), true));
+ msaMap.put("Events", cloneXmlObject(msa.getEvents(), true));
+ msaMap.put("Hobs", cloneXmlObject(msa.getHobs(), true));
+ msaMap.put("Variables", cloneXmlObject(msa.getVariables(), true));
+ msaMap.put("SystemTables", cloneXmlObject(msa.getSystemTables(), true));
+ msaMap.put("DataHubs", cloneXmlObject(msa.getDataHubs(), true));
+ msaMap.put("HiiPackages", cloneXmlObject(msa.getHiiPackages(), true));
msaMap.put("Externs", cloneXmlObject(msa.getExterns(), true));
msaMap.put("PcdCoded", cloneXmlObject(msa.getPcdCoded(), true));
msaMap.put("ModuleBuildOptions", cloneXmlObject(msa.getModuleBuildOptions(), true));
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java index 933b5d4e0d..acd8182d3b 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java @@ -1088,7 +1088,7 @@ public class SurfaceAreaQuery { usageXpath = "/GuidEntry[@Usage='" + arch + "']";
xPath = new String[] { archXpath, usageXpath };
} else {
- return getProtocolNotifyArray(arch);
+ return getGuidEntryArray(arch);
}
}
@@ -1105,6 +1105,234 @@ public class SurfaceAreaQuery { return guidList;
}
+ public String[] getEventCNameArray(String arch) {
+ String[] xPath = null;
+
+ if (arch == null || arch.equals("")) {
+ xPath = new String[]{
+ "/CreateEvents/EventTypes[@EventGuidCName]",
+ "/SignalEvents/EventTypes[@EventGuidCName]",
+ };
+ } else {
+ xPath = new String[]{
+ "/CreateEvents/EventTypes[@EventGuidCName and not(@SupArchList)]",
+ "/SignalEvents/EventTypes[@EventGuidCName and not(@SupArchList)]",
+ "/CreateEvents/EventTypes[@EventGuidCName and contains(@SupArchList,'" + arch + "')]",
+ "/SignalEvents/EventTypes[@EventGuidCName and contains(@SupArchList,'" + arch + "')]",
+ };
+ }
+
+ Object[] returns = get("Events", xPath);
+ if (returns == null) {
+ return new String[0];
+ }
+
+ String[] cnameList = new String[returns.length];
+ for (int i = 0; i < returns.length; i++) {
+ if (returns[i] instanceof EventsDocument.Events.CreateEvents.EventTypes) {
+ cnameList[i] = ((EventsDocument.Events.CreateEvents.EventTypes) returns[i]).getEventGuidCName();
+ } else {
+ cnameList[i] = ((EventsDocument.Events.SignalEvents.EventTypes) returns[i]).getEventGuidCName();
+ }
+ }
+ return cnameList;
+ }
+
+ public String[] getHobCNameArray(String arch) {
+ String[] xPath = null;
+
+ if (arch == null || arch.equals("")) {
+ xPath = new String[]{"/HobTypes[@HobGuidCName]"};
+ } else {
+ xPath = new String[]{
+ "/HobTypes[@HobGuidCName and not(@SupArchList)]",
+ "/HobTypes[@HobGuidCName and contains(@SupArchList,'" + arch + "')]",
+ };
+ }
+
+ Object[] returns = get("Hobs", xPath);
+ if (returns == null) {
+ return new String[0];
+ }
+
+ String[] cnameList = new String[returns.length];
+ for (int i = 0; i < returns.length; i++) {
+ cnameList[i] = ((HobsDocument.Hobs.HobTypes) returns[i]).getHobGuidCName();
+ }
+ return cnameList;
+ }
+
+ public String[] getVariableCNameArray(String arch) {
+ String[] xPath = null;
+
+ if (arch == null || arch.equals("")) {
+ xPath = new String[]{"/Variable"};
+ } else {
+ xPath = new String[]{"/Variable[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"};
+ }
+
+ Object[] returns = get("Variables", xPath);
+ if (returns == null) {
+ return new String[0];
+ }
+
+ String[] cnameList = new String[returns.length];
+ for (int i = 0; i < returns.length; i++) {
+ cnameList[i] = ((VariablesDocument.Variables.Variable) returns[i]).getGuidCName();
+ }
+ return cnameList;
+ }
+
+ public String[] getSystemTableCNameArray(String arch) {
+ String[] xPath = null;
+
+ if (arch == null || arch.equals("")) {
+ xPath = new String[]{"/SystemTableCNames"};
+ } else {
+ xPath = new String[]{
+ "/SystemTableCNames[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"
+ };
+ }
+
+ Object[] returns = get("SystemTables", xPath);
+ if (returns == null) {
+ return new String[0];
+ }
+
+ String[] cnameList = new String[returns.length];
+ for (int i = 0; i < returns.length; i++) {
+ cnameList[i] = ((SystemTablesDocument.SystemTables.SystemTableCNames) returns[i]).getSystemTableCName();
+ }
+ return cnameList;
+ }
+
+ public String[] getDataHubCNameArray(String arch) {
+ String[] xPath = null;
+
+ if (arch == null || arch.equals("")) {
+ xPath = new String[]{"/DataHubRecord"};
+ } else {
+ xPath = new String[]{"/DataHubRecord[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"};
+ }
+
+ Object[] returns = get("DataHubs", xPath);
+ if (returns == null) {
+ return new String[0];
+ }
+
+ String[] cnameList = new String[returns.length];
+ for (int i = 0; i < returns.length; i++) {
+ cnameList[i] = ((DataHubsDocument.DataHubs.DataHubRecord) returns[i]).getDataHubCName();
+ }
+ return cnameList;
+ }
+
+ public String[] getHiiPackageCNameArray(String arch) {
+ String[] xPath = null;
+
+ if (arch == null || arch.equals("")) {
+ xPath = new String[]{"/HiiPackage"};
+ } else {
+ xPath = new String[]{"/HiiPackage[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"};
+ }
+
+ Object[] returns = get("HiiPackages", xPath);
+ if (returns == null) {
+ return new String[0];
+ }
+
+ String[] cnameList = new String[returns.length];
+ for (int i = 0; i < returns.length; i++) {
+ cnameList[i] = ((HiiPackagesDocument.HiiPackages.HiiPackage) returns[i]).getHiiCName();
+ }
+ return cnameList;
+ }
+
+ public String[] getCNameArray(String arch) {
+ List<String> cnameList = new ArrayList<String>(100);
+ String[] result = null;
+ //
+ // "/Guids/GuidCNames/GuidCName",
+ //
+ result = getGuidEntryArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/Protocols/Protocol/ProtocolCName",
+ //
+ result = getProtocolArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/Protocols/ProtocolNotify/ProtocolNotifyCName",
+ //
+ result = getProtocolNotifyArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/Events/CreateEvents/EventTypes[@EventGuidCName]",
+ // "/Events/SignalEvents/EventTypes[@EventGuidCName]",
+ //
+ result = getEventCNameArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/Hobs/HobTypes[@HobGuidCName]",
+ //
+ result = getHobCNameArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/PPIs/Ppi/PpiCName",
+ //
+ result = getPpiArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/PPIs/PpiNotify/PpiNotifyCName",
+ //
+ result = getPpiNotifyArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/Variables/Variable/GuidC_Name",
+ //
+ result = getVariableCNameArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/SystemTables/SystemTableCNames/SystemTableCName",
+ //
+ result = getSystemTableCNameArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/DataHubs/DataHubRecord/DataHubCName",
+ //
+ result = getDataHubCNameArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+ //
+ // "/HiiPackages/HiiPackage/HiiCName",
+ //
+ result = getHiiPackageCNameArray(arch);
+ for (int i = 0; i < result.length; ++i) {
+ cnameList.add(result[i]);
+ }
+
+ return cnameList.toArray(new String[cnameList.size()]);
+ }
+
/**
* Retrieve Library instance information
*
|