]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1) Add include path into MdeModulePkg.dec
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Jun 2007 03:57:21 +0000 (03:57 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Jun 2007 03:57:21 +0000 (03:57 +0000)
2) Add WinNtAutoScanPeim module into new Nt32Pkg

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2767 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/MdeModulePkg.dec
Nt32Pkg/Nt32.dsc
Nt32Pkg/Nt32Pkg.dec
Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.c [new file with mode: 0644]
Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.dxs [new file with mode: 0644]
Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.inf [new file with mode: 0644]
Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.msa [new file with mode: 0644]

index bf790be59d03edccc1b064fa8af8f2898f61258f..b3c87fe0e5823a2f9cad5505c2f1cc98e2e1082e 100644 (file)
   gEfiMdePkgTokenSpaceGuid       = { 0xA1AFF049, 0xFDEB, 0x442a, { 0xB3, 0x20, 0x13, 0xAB, 0x4C, 0xB7, 0x2B, 0xBC }}\r
 \r
 \r
   gEfiMdePkgTokenSpaceGuid       = { 0xA1AFF049, 0xFDEB, 0x442a, { 0xB3, 0x20, 0x13, 0xAB, 0x4C, 0xB7, 0x2B, 0xBC }}\r
 \r
 \r
-\r
+[Includes.common]\r
+  Include                        \r
+  Include/Library                \r
+  Include/Ppi                    \r
+  Include/Common                 \r
+  Include/Protocol               \r
 \r
 ################################################################################\r
 #\r
 \r
 ################################################################################\r
 #\r
index 9ee5a7763e6171b1fdc739ea6c104387e8259bfb..896d38d7a4038452197927f6ad5efbf813dfd962 100644 (file)
 \r
 [Components.IA32]\r
   $(WORKSPACE)\Nt32Pkg\WinNtThunkDxe\WinNtThunk.inf\r
 \r
 [Components.IA32]\r
   $(WORKSPACE)\Nt32Pkg\WinNtThunkDxe\WinNtThunk.inf\r
-  $(WORKSPACE)\Nt32Pkg\WinNtThunkPPIToProtocolPeim\WinNtThunkPPIToProtocolPeim.inf
\ No newline at end of file
+  $(WORKSPACE)\Nt32Pkg\WinNtThunkPPIToProtocolPeim\WinNtThunkPPIToProtocolPeim.inf\r
+  $(WORKSPACE)\Nt32Pkg\WinNtAutoScanPeim\WinNtAutoScan.inf
\ No newline at end of file
index a507c228d77d382c222c150fbfde0f21edc8b620..92de12e0ef904a55ecf394aada56d87b07ac358e 100644 (file)
@@ -77,7 +77,7 @@
 \r
 [Ppis.common]\r
   gPeiNtThunkPpiGuid             = { 0x98c281e5, 0xf906, 0x43dd, { 0xa9, 0x2b, 0xb0, 0x03, 0xbf, 0x27, 0x65, 0xda }}\r
 \r
 [Ppis.common]\r
   gPeiNtThunkPpiGuid             = { 0x98c281e5, 0xf906, 0x43dd, { 0xa9, 0x2b, 0xb0, 0x03, 0xbf, 0x27, 0x65, 0xda }}\r
-  \r
+  gPeiNtAutoScanPpiGuid          = { 0x0dce384d, 0x007c, 0x4ba5, { 0x94, 0xbd, 0x0f, 0x6e, 0xb6, 0x4d, 0x2a, 0xa9 }}\r
   \r
 ################################################################################\r
 #\r
   \r
 ################################################################################\r
 #\r
diff --git a/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.c b/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.c
new file mode 100644 (file)
index 0000000..99b12b2
--- /dev/null
@@ -0,0 +1,149 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+  WinNtAutoscan.c\r
+\r
+Abstract:\r
+  This PEIM to abstract memory auto-scan in a Windows NT environment.\r
+\r
+Revision History\r
+\r
+--*/\r
+\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiPei.h>\r
+#include <WinNtPeim.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Ppi/BaseMemoryTest.h>\r
+#include <Ppi/NtAutoscan.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/DebugLib.h>\r
+#include <Library/PeimEntryPoint.h>\r
+#include <Library/HobLib.h>\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+PeimInitializeWinNtAutoScan (\r
+  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r
+  IN EFI_PEI_SERVICES          **PeiServices\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Perform a call-back into the SEC simulator to get a memory value\r
+\r
+Arguments:\r
+  FfsHeader   - General purpose data available to every PEIM\r
+  PeiServices - General purpose services available to every PEIM.\r
+    \r
+Returns:\r
+  None\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                  Status;\r
+  EFI_PEI_PPI_DESCRIPTOR      *PpiDescriptor;\r
+  PEI_NT_AUTOSCAN_PPI         *PeiNtService;\r
+  UINT64                      MemorySize;\r
+  EFI_PHYSICAL_ADDRESS        MemoryBase;\r
+  PEI_BASE_MEMORY_TEST_PPI    *MemoryTestPpi;\r
+  EFI_PHYSICAL_ADDRESS        ErrorAddress;\r
+  UINTN                       Index;\r
+  EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;\r
+\r
+\r
+  DEBUG ((EFI_D_ERROR, "NT 32 Autoscan PEIM Loaded\n"));\r
+\r
+  //\r
+  // Get the PEI NT Autoscan PPI\r
+  //\r
+  Status = (**PeiServices).LocatePpi (\r
+                            PeiServices,\r
+                            &gPeiNtAutoScanPpiGuid, // GUID\r
+                            0,                      // INSTANCE\r
+                            &PpiDescriptor,         // EFI_PEI_PPI_DESCRIPTOR\r
+                            &PeiNtService           // PPI\r
+                            );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Get the Memory Test PPI\r
+  //\r
+  Status = (**PeiServices).LocatePpi (\r
+                            PeiServices,\r
+                            &gPeiBaseMemoryTestPpiGuid,\r
+                            0,\r
+                            NULL,\r
+                            &MemoryTestPpi\r
+                            );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  Index = 0;\r
+  do {\r
+    Status = PeiNtService->NtAutoScan (Index, &MemoryBase, &MemorySize);\r
+    if (!EFI_ERROR (Status)) {\r
+      Attributes =\r
+        (\r
+          EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
+          EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
+          EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |\r
+          EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |\r
+          EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |\r
+          EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE\r
+        );\r
+\r
+      if (Index == 0) {\r
+        //\r
+        // For the first area register it as PEI tested memory\r
+        //\r
+        Status = MemoryTestPpi->BaseMemoryTest (\r
+                                  PeiServices,\r
+                                  MemoryTestPpi,\r
+                                  MemoryBase,\r
+                                  MemorySize,\r
+                                  Quick,\r
+                                  &ErrorAddress\r
+                                  );\r
+        ASSERT_EFI_ERROR (Status);\r
+\r
+        //\r
+        // Register the "tested" memory with the PEI Core\r
+        //\r
+        Status = (**PeiServices).InstallPeiMemory (PeiServices, MemoryBase, MemorySize);\r
+        ASSERT_EFI_ERROR (Status);\r
+\r
+        Attributes |= EFI_RESOURCE_ATTRIBUTE_TESTED;\r
+      }\r
+      \r
+      BuildResourceDescriptorHob (\r
+        EFI_RESOURCE_SYSTEM_MEMORY,\r
+        Attributes,\r
+        MemoryBase,\r
+        MemorySize\r
+        );\r
+    }\r
+    Index++;\r
+  } while (!EFI_ERROR (Status));\r
+\r
+  //\r
+  // Build the CPU hob with 36-bit addressing and 16-bits of IO space.\r
+  //\r
+  BuildCpuHob (36, 16);\r
+  \r
+  return Status;\r
+}\r
diff --git a/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.dxs b/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.dxs
new file mode 100644 (file)
index 0000000..ac2c065
--- /dev/null
@@ -0,0 +1,33 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+  WinNtAutoscan.dxs\r
+\r
+Abstract:\r
+\r
+  Dependency expression file for WinNtAutoscan.\r
+\r
+--*/  \r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "CommonHeader.h"\r
+\r
+#include <PeimDepex.h>\r
+\r
+DEPENDENCY_START\r
+  PEI_NT_AUTOSCAN_PPI_GUID AND EFI_PEI_MASTER_BOOT_MODE_PEIM_PPI AND PEI_BASE_MEMORY_TEST_GUID\r
+DEPENDENCY_END\r
+\r
+\r
diff --git a/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.inf b/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.inf
new file mode 100644 (file)
index 0000000..3b30508
--- /dev/null
@@ -0,0 +1,95 @@
+#/** @file\r
+# Component description file for WinNtAutoScan module\r
+#\r
+# This module abstracts memory auto-scan in a Windows NT environment.\r
+# Copyright (c) 2006 - 2007, Intel Corporation\r
+#\r
+#  All rights reserved. This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution. The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+################################################################################\r
+#\r
+# Defines Section - statements that will be processed to create a Makefile.\r
+#\r
+################################################################################\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = WinNtAutoScan\r
+  FILE_GUID                      = BE0FEABA-3443-4919-9F3A-2D4216329EA9\r
+  MODULE_TYPE                    = PEIM\r
+  VERSION_STRING                 = 1.0\r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+  ENTRY_POINT                    = PeimInitializeWinNtAutoScan\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32\r
+#\r
+\r
+################################################################################\r
+#\r
+# Sources Section - list of files that are required for the build to succeed.\r
+#\r
+################################################################################\r
+\r
+[Sources.common]\r
+  WinNtAutoscan.dxs\r
+  WinntAutoscan.c\r
+\r
+################################################################################\r
+#\r
+# Includes Section - list of Include locations that are required for\r
+#                    this module.\r
+#\r
+################################################################################\r
+\r
+[Includes]\r
+  $(WORKSPACE)/MdePkg/Include/Library\r
+\r
+################################################################################\r
+#\r
+# Package Dependency Section - list of Package files that are required for\r
+#                              this module.\r
+#\r
+################################################################################\r
+\r
+[Packages]\r
+  Nt32Pkg/Nt32Pkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  MdePkg/MdePkg.dec\r
+\r
+\r
+################################################################################\r
+#\r
+# Library Class Section - list of Library Classes that are required for\r
+#                         this module.\r
+#\r
+################################################################################\r
+\r
+[LibraryClasses]\r
+  HobLib\r
+  PeimEntryPoint\r
+  DebugLib\r
+\r
+\r
+################################################################################\r
+#\r
+# PPI C Name Section - list of PPI and PPI Notify C Names that this module\r
+#                      uses or produces.\r
+#\r
+################################################################################\r
+\r
+[Ppis]\r
+  gPeiBaseMemoryTestPpiGuid                     # PPI ALWAYS_CONSUMED\r
+  gPeiNtAutoScanPpiGuid                         # PPI ALWAYS_CONSUMED\r
+\r
diff --git a/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.msa b/Nt32Pkg/WinNtAutoScanPeim/WinNtAutoScan.msa
new file mode 100644 (file)
index 0000000..8a0beea
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>WinNtAutoScan</ModuleName>\r
+    <ModuleType>PEIM</ModuleType>\r
+    <GuidValue>BE0FEABA-3443-4919-9F3A-2D4216329EA9</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Component description file for WinNtAutoScan module</Abstract>\r
+    <Description>This module abstracts memory auto-scan in a Windows NT environment.</Description>\r
+    <Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials\r
+      are licensed and made available under the terms and conditions of the BSD License\r
+      which accompanies this distribution.  The full text of the license may be found at\r
+      http://opensource.org/licenses/bsd-license.php\r
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>WinNtAutoScan</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PeimEntryPoint</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>HobLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>WinntAutoscan.c</Filename>\r
+    <Filename>WinNtAutoscan.dxs</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+    <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>\r
+    <Package PackageGuid="0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3"/>\r
+  </PackageDependencies>\r
+  <PPIs>\r
+    <Ppi Usage="ALWAYS_CONSUMED">\r
+      <PpiCName>gPeiNtAutoScanPpiGuid</PpiCName>\r
+    </Ppi>\r
+    <Ppi Usage="ALWAYS_CONSUMED">\r
+      <PpiCName>gPeiBaseMemoryTestPpiGuid</PpiCName>\r
+    </Ppi>\r
+  </PPIs>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+    <Extern>\r
+      <ModuleEntryPoint>PeimInitializeWinNtAutoScan</ModuleEntryPoint>\r
+    </Extern>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file