]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
Use two PCDs to replace _DISABLE_UNUSED_HII_PROTOCOLS_ macro.
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / ConfigRouting.c
index d7ae31057370135f9676dce8bcf1cad8dff5fc9b..73c4e0f362aafaece78cad2caf5fac4a8e7e5928 100644 (file)
@@ -25,8 +25,6 @@ Revision History
 \r
 #include "HiiDatabase.h"\r
 \r
-#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
-\r
 /**\r
   Calculate the number of Unicode characters of the incoming Configuration string,\r
   not including NULL terminator.\r
@@ -447,8 +445,6 @@ OutputConfigBody (
 }\r
 \r
 \r
-#endif\r
-\r
 /**\r
   Adjusts the size of a previously allocated buffer.\r
 \r
@@ -660,8 +656,6 @@ HiiConfigRoutingExtractConfig (
   OUT EFI_STRING                             *Results\r
   )\r
 {\r
-#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
-\r
   HII_DATABASE_PRIVATE_DATA           *Private;\r
   EFI_STRING                          StringPtr;\r
   EFI_STRING                          ConfigRequest;\r
@@ -678,6 +672,15 @@ HiiConfigRoutingExtractConfig (
   UINTN                               RemainSize;\r
   EFI_STRING                          TmpPtr;\r
 \r
+  //\r
+  // For size reduction, please define PcdSupportFullConfigRoutingProtocol \r
+  // as FALSE. But this renders the system to not 100% compliant with\r
+  // UEFI 2.1. Use this with caution.\r
+  //\r
+  if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   if (This == NULL || Progress == NULL || Results == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -826,9 +829,6 @@ HiiConfigRoutingExtractConfig (
   }\r
 \r
   return EFI_SUCCESS;\r
-#else\r
-  return EFI_UNSUPPORTED;\r
-#endif\r
 \r
 }\r
 \r
@@ -862,8 +862,6 @@ HiiConfigRoutingExportConfig (
   OUT EFI_STRING                             *Results\r
   )\r
 {\r
-#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
-\r
   EFI_STATUS                          Status;\r
   HII_DATABASE_PRIVATE_DATA           *Private;\r
   LIST_ENTRY                          StorageListHdr;\r
@@ -881,6 +879,15 @@ HiiConfigRoutingExportConfig (
   EFI_STRING                          AccessResults;\r
   UINTN                               TmpSize;\r
 \r
+  //\r
+  // For size reduction, please define PcdSupportFullConfigRoutingProtocol \r
+  // as FALSE. But this renders the system to not 100% compliant with\r
+  // UEFI 2.1. Use this with caution.\r
+  //\r
+  if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   if (This == NULL || Results == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -1050,9 +1057,6 @@ HiiConfigRoutingExportConfig (
   }\r
 \r
   return EFI_SUCCESS;\r
-#else\r
-  return EFI_UNSUPPORTED;\r
-#endif\r
 }\r
 \r
 \r
@@ -1089,8 +1093,6 @@ HiiConfigRoutingRouteConfig (
   OUT EFI_STRING                             *Progress\r
   )\r
 {\r
-#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
-\r
   HII_DATABASE_PRIVATE_DATA           *Private;\r
   EFI_STRING                          StringPtr;\r
   EFI_STRING                          ConfigResp;\r
@@ -1106,6 +1108,15 @@ HiiConfigRoutingRouteConfig (
   UINTN                               RemainSize;\r
   EFI_STRING                          TmpPtr;\r
 \r
+  //\r
+  // For size reduction, please define PcdSupportFullConfigRoutingProtocol \r
+  // as FALSE. But this renders the system to not 100% compliant with\r
+  // UEFI 2.1. Use this with caution.\r
+  //\r
+  if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   if (This == NULL || Progress == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -1240,9 +1251,6 @@ HiiConfigRoutingRouteConfig (
   }\r
 \r
   return EFI_SUCCESS;\r
-#else\r
-  return EFI_UNSUPPORTED;\r
-#endif\r
 }\r
 \r
 \r
@@ -1761,8 +1769,6 @@ HiiGetAltCfg (
   OUT EFI_STRING                               *AltCfgResp\r
   )\r
 {\r
-#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
-\r
   EFI_STATUS                          Status;\r
   EFI_STRING                          StringPtr;\r
   EFI_STRING                          HdrStart;\r
@@ -1778,6 +1784,15 @@ HiiGetAltCfg (
   BOOLEAN                             NameFlag;\r
   BOOLEAN                             PathFlag;\r
 \r
+  //\r
+  // For size reduction, please define PcdSupportFullConfigRoutingProtocol \r
+  // as FALSE. But this renders the system to not 100% compliant with\r
+  // UEFI 2.1. Use this with caution.\r
+  //\r
+  if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   HdrStart = NULL;\r
   HdrEnd   = NULL;\r
   GuidStr  = NULL;\r
@@ -1945,10 +1960,6 @@ Exit:
 \r
   return Status;\r
 \r
-#else\r
-  return EFI_UNSUPPORTED;\r
-#endif\r
-\r
 }\r
 \r
 \r