Enable dynamic PCD for windowBusDriver
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Jul 2007 08:57:25 +0000 (08:57 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Jul 2007 08:57:25 +0000 (08:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3167 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/PcdDriverPcdLibNull/PcdLib.c
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
Nt32Pkg/Nt32Pkg.dsc
Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c

index f3e8b51..b7d4408 100644 (file)
@@ -14,6 +14,9 @@
 \r
 **/\r
 #include <PiDxe.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
 \r
 \r
 /**\r
index f5502e5..db828ac 100644 (file)
   UefiBootServicesTableLib\r
   MemoryAllocationLib\r
   HobLib\r
-  PcdLib\r
   UefiDriverEntryPoint\r
   UefiLib\r
   DebugLib\r
   BaseLib\r
-\r
+  PcdLib\r
 \r
 ################################################################################\r
 #\r
index 5443406..53390ab 100644 (file)
   UefiBootServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DevicePathLib|$(WORKSPACE)/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   ReportStatusCodeLib|$(WORKSPACE)/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   WinNtLib|$(WORKSPACE)/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf\r
   OemHookStatusCodeLib|$(WORKSPACE)/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   DebugLib|$(WORKSPACE)/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
 \r
 [LibraryClasses.common.PEIM]\r
   HobLib|$(WORKSPACE)/MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
   IoLib|$(WORKSPACE)/MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf\r
   PeimEntryPoint|$(WORKSPACE)/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
   PeiServicesLib|$(WORKSPACE)/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
   OldPeiCoreEntryPoint|$(WORKSPACE)/MdePkg/Library/OldPeiCoreEntryPoint/OldPeiCoreEntryPoint.inf\r
   ReportStatusCodeLib|$(WORKSPACE)/IntelFrameworkPkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
   PeCoffGetEntryPointLib|$(WORKSPACE)/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
   DebugLib|$(WORKSPACE)/IntelFrameworkPkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
 \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   UefiDriverEntryPoint|$(WORKSPACE)/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
 [LibraryClasses.common.UEFI_DRIVER]\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   UefiDriverEntryPoint|$(WORKSPACE)/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
 [LibraryClasses.common.DXE_DRIVER]\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   UefiDriverEntryPoint|$(WORKSPACE)/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DevicePathLib|$(WORKSPACE)/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   EdkIfrSupportLib|$(WORKSPACE)/MdeModulePkg/Library/EdkIfrSupportLib/EdkIfrSupportLib.inf\r
-  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
-  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   ReportStatusCodeLib|$(WORKSPACE)/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   #  DXE Phase modules\r
   ##\r
   $(WORKSPACE)/MdeModulePkg/Core/Dxe/DxeMain.inf  \r
-  $(WORKSPACE)/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf  \r
+  $(WORKSPACE)/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {\r
+    <LibraryClass>\r
+      PcdLib|$(WORKSPACE)/MdeModulePkg/Library/PcdDriverPcdLibNull/PcdLib.inf\r
+  }\r
   $(WORKSPACE)/Nt32Pkg/MetronomeDxe/Metronome.inf\r
   $(WORKSPACE)/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClock.inf  \r
   $(WORKSPACE)/Nt32Pkg/ResetRuntimeDxe/Reset.inf\r
index a0baa75..999fb0c 100644 (file)
@@ -138,44 +138,22 @@ EFI_DRIVER_BINDING_PROTOCOL           gWinNtBusDriverBinding = {
   NULL\r
 };\r
 \r
-#define NT_PCD_ARRAY_SIZE (sizeof(mPcdEnvironment)/sizeof(NT_ENVIRONMENT_VARIABLE_ENTRY))\r
-\r
-//\r
-// BUGBUG: Because currently the new build tools does not support dynamic PCD \r
-//         following dynamic PCd will be hard code. After tools ready, we should\r
-//         use dynmanic PCD AQAP.\r
-//\r
+#define NT_PCD_ARRAY_SIZE (sizeof(mPcdEnvironment)/sizeof(NT_PCD_ENTRY))\r
 \r
 //\r
 // Table to map NT Environment variable to the GUID that should be in\r
 // device path.\r
 //\r
-//static NT_PCD_ENTRY  mPcdEnvironment[] = {\r
-//  PcdToken(PcdWinNtConsole),       &gEfiWinNtConsoleGuid,\r
-//  PcdToken(PcdWinNtGop),           &gEfiWinNtGopGuid,\r
-//  PcdToken(PcdWinNtSerialPort),    &gEfiWinNtSerialPortGuid,\r
-//  PcdToken(PcdWinNtFileSystem),    &gEfiWinNtFileSystemGuid,\r
-//  PcdToken(PcdWinNtVirtualDisk),   &gEfiWinNtVirtualDisksGuid,\r
-//  PcdToken(PcdWinNtPhysicalDisk),  &gEfiWinNtPhysicalDisksGuid,\r
-//  PcdToken(PcdWinNtCpuModel),      &gEfiWinNtCPUModelGuid,\r
-//  PcdToken(PcdWinNtCpuSpeed),      &gEfiWinNtCPUSpeedGuid,\r
-//  PcdToken(PcdWinNtMemorySize),    &gEfiWinNtMemoryGuid\r
-//};\r
-typedef struct {\r
-  CHAR16    *Variable;\r
-  EFI_GUID  *DevicePathGuid;\r
-} NT_ENVIRONMENT_VARIABLE_ENTRY;\r
-\r
-static NT_ENVIRONMENT_VARIABLE_ENTRY  mPcdEnvironment[] = {\r
-  L"Bus Driver Console Window",         &gEfiWinNtConsoleGuid,\r
-  L"UGA Window 1!UGA Window 2",         &gEfiWinNtGopGuid,\r
-  L"COM1!COM2",                        &gEfiWinNtSerialPortGuid,\r
-  L".!..\\..\\..\\..\\EdkShellBinPkg\\bin\\ia32\\Apps",      &gEfiWinNtFileSystemGuid,\r
-  L"FW;40960;512",                     &gEfiWinNtVirtualDisksGuid,\r
-  L"E:RW;245760;512",                  &gEfiWinNtPhysicalDisksGuid,\r
-  L"Intel(R) Processor Model",         &gEfiWinNtCPUModelGuid,\r
-  L"3000",                             &gEfiWinNtCPUSpeedGuid,\r
-  L"64!64",                             &gEfiWinNtMemoryGuid\r
+static NT_PCD_ENTRY  mPcdEnvironment[] = {\r
+  PcdToken(PcdWinNtConsole),       &gEfiWinNtConsoleGuid,\r
+  PcdToken(PcdWinNtGop),           &gEfiWinNtGopGuid,\r
+  PcdToken(PcdWinNtSerialPort),    &gEfiWinNtSerialPortGuid,\r
+  PcdToken(PcdWinNtFileSystem),    &gEfiWinNtFileSystemGuid,\r
+  PcdToken(PcdWinNtVirtualDisk),   &gEfiWinNtVirtualDisksGuid,\r
+  PcdToken(PcdWinNtPhysicalDisk),  &gEfiWinNtPhysicalDisksGuid,\r
+  PcdToken(PcdWinNtCpuModel),      &gEfiWinNtCPUModelGuid,\r
+  PcdToken(PcdWinNtCpuSpeed),      &gEfiWinNtCPUSpeedGuid,\r
+  PcdToken(PcdWinNtMemorySize),    &gEfiWinNtMemoryGuid\r
 };\r
 \r
 /**\r
@@ -452,8 +430,7 @@ Returns:
   //\r
   InstallStatus   = EFI_NOT_FOUND;\r
   for (Index = 0; Index < NT_PCD_ARRAY_SIZE; Index++) {\r
-    //PcdTempStr = (VOID *)LibPcdGetPtr (mPcdEnvironment[Index].Token);\r
-    PcdTempStr = mPcdEnvironment[Index].Variable;\r
+    PcdTempStr = (VOID *)LibPcdGetPtr (mPcdEnvironment[Index].Token);\r
     ASSERT (PcdTempStr != NULL);\r
 \r
     TempStrSize = StrLen (PcdTempStr);\r