]> git.proxmox.com Git - mirror_edk2.git/commitdiff
add in BootModePei
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Jun 2007 10:10:18 +0000 (10:10 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Jun 2007 10:10:18 +0000 (10:10 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2754 6f19259b-4bc3-4df7-8a09-765794883524

Nt32Pkg/BootModePei/BootMode.c [new file with mode: 0644]
Nt32Pkg/BootModePei/BootMode.dxs [new file with mode: 0644]
Nt32Pkg/BootModePei/BootMode.inf [new file with mode: 0644]
Nt32Pkg/BootModePei/BootMode.msa [new file with mode: 0644]

diff --git a/Nt32Pkg/BootModePei/BootMode.c b/Nt32Pkg/BootModePei/BootMode.c
new file mode 100644 (file)
index 0000000..3ac2044
--- /dev/null
@@ -0,0 +1,101 @@
+/*++\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
+  BootMode.c\r
+   \r
+Abstract:\r
+\r
+  Tiano PEIM to provide the platform support functionality within Windows\r
+\r
+--*/\r
+\r
+\r
+\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiPei.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Ppi/MasterBootMode.h>\r
+#include <Ppi/BootInRecoveryMode.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/DebugLib.h>\r
+#include <Library/PeimEntryPoint.h>\r
+\r
+\r
+//\r
+// Module globals\r
+//\r
+EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {\r
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
+  &gEfiPeiMasterBootModePpiGuid,\r
+  NULL\r
+};\r
+\r
+EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {\r
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
+  &gEfiPeiBootInRecoveryModePpiGuid,\r
+  NULL\r
+};\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeBootMode (\r
+  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r
+  IN EFI_PEI_SERVICES          **PeiServices\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Peform the boot mode determination logic\r
+\r
+Arguments:\r
+\r
+  PeiServices - General purpose services available to every PEIM.\r
+    \r
+Returns:\r
+\r
+  Status -  EFI_SUCCESS if the boot mode could be set\r
+\r
+--*/\r
+// TODO:    FfsHeader - add argument and description to function comment\r
+{\r
+  EFI_STATUS  Status;\r
+  UINTN       BootMode;\r
+\r
+  DEBUG ((EFI_D_ERROR, "NT32 Boot Mode PEIM Loaded\n"));\r
+\r
+  //\r
+  // Let's assume things are OK if not told otherwise\r
+  // Should we read an environment variable in order to easily change this?\r
+  //\r
+  BootMode  = BOOT_WITH_FULL_CONFIGURATION;\r
+\r
+  Status    = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
+    Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+\r
+  return Status;\r
+}\r
diff --git a/Nt32Pkg/BootModePei/BootMode.dxs b/Nt32Pkg/BootModePei/BootMode.dxs
new file mode 100644 (file)
index 0000000..cbc94c7
--- /dev/null
@@ -0,0 +1,31 @@
+/*++\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
+  BootMode.dxs\r
+\r
+Abstract:\r
+\r
+  Dependency expression file for BootMode.\r
+\r
+--*/  \r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include <PeimDepex.h>\r
+\r
+DEPENDENCY_START\r
+  TRUE\r
+DEPENDENCY_END\r
+\r
+\r
diff --git a/Nt32Pkg/BootModePei/BootMode.inf b/Nt32Pkg/BootModePei/BootMode.inf
new file mode 100644 (file)
index 0000000..6f3c7c0
--- /dev/null
@@ -0,0 +1,94 @@
+#/** @file\r
+# Component description file for BootMode module\r
+#\r
+# This module provides platform specific function to detect boot mode.\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                      = BootMode\r
+  FILE_GUID                      = B7611005-1F26-45ba-A3DB-01F39DDB2785\r
+  MODULE_TYPE                    = PEIM\r
+  VERSION_STRING                 = 1.0\r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+  ENTRY_POINT                    = InitializeBootMode\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\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
+  BootMode.dxs\r
+  BootMode.c\r
+  CommonHeader.h\r
+\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
+  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
+  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
+  gEfiPeiMasterBootModePpiGuid                  # PPI ALWAYS_PRODUCED\r
+  gEfiPeiBootInRecoveryModePpiGuid              # PPI SOMETIMES_PRODUCED\r
+\r
diff --git a/Nt32Pkg/BootModePei/BootMode.msa b/Nt32Pkg/BootModePei/BootMode.msa
new file mode 100644 (file)
index 0000000..e8225a8
--- /dev/null
@@ -0,0 +1,54 @@
+<?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>BootMode</ModuleName>\r
+    <ModuleType>PEIM</ModuleType>\r
+    <GuidValue>B7611005-1F26-45ba-A3DB-01F39DDB2785</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Component description file for BootMode module</Abstract>\r
+    <Description>This module provides platform specific function to detect boot mode.</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 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>BootMode</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
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>BootMode.c</Filename>\r
+    <Filename>BootMode.dxs</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <PPIs>\r
+    <Ppi Usage="SOMETIMES_PRODUCED">\r
+      <PpiCName>gEfiPeiBootInRecoveryModePpiGuid</PpiCName>\r
+    </Ppi>\r
+    <Ppi Usage="ALWAYS_PRODUCED">\r
+      <PpiCName>gEfiPeiMasterBootModePpiGuid</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>InitializeBootMode</ModuleEntryPoint>\r
+    </Extern>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file