]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Capsule/RuntimeDxe/Capsule.c
1)Add a new module CapsuleRuntime under EdkModulePkg\Universal\Capsule\RuntimeDxe...
[mirror_edk2.git] / EdkModulePkg / Universal / Capsule / RuntimeDxe / Capsule.c
diff --git a/EdkModulePkg/Universal/Capsule/RuntimeDxe/Capsule.c b/EdkModulePkg/Universal/Capsule/RuntimeDxe/Capsule.c
new file mode 100644 (file)
index 0000000..125a445
--- /dev/null
@@ -0,0 +1,68 @@
+/*++\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
+  Capsule.c\r
+\r
+Abstract:\r
+\r
+  Capsule Runtime Service Initialization\r
+\r
+--*/\r
+\r
+#include "CapsuleService.h"\r
+\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+CapsuleServiceInitialize (\r
+  IN EFI_HANDLE         ImageHandle,\r
+  IN EFI_SYSTEM_TABLE   *SystemTable\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  This code is capsule runtime service initialization.\r
+  \r
+Arguments:\r
+\r
+  ImageHandle          The image handle\r
+  SystemTable          The system table.\r
+\r
+Returns:\r
+\r
+  EFI STATUS\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_HANDLE  NewHandle;\r
+\r
+  SystemTable->RuntimeServices->UpdateCapsule                    = UpdateCapsule;\r
+  SystemTable->RuntimeServices->QueryCapsuleCapabilities         = QueryCapsuleCapabilities;\r
+\r
+  //\r
+  // Now install the Capsule Architectural Protocol on a new handle\r
+  //\r
+  NewHandle = NULL;\r
+\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &NewHandle,\r
+                  &gEfiCapsuleArchProtocolGuid,\r
+                  NULL,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return EFI_SUCCESS;\r
+}\r