SignedCapsulePkg/PlatformFlashAccessLib: Add NULL instance.
authorJiewen Yao <>
Wed, 21 Sep 2016 02:03:33 +0000 (10:03 +0800)
committerJiewen Yao <>
Tue, 8 Nov 2016 14:41:00 +0000 (22:41 +0800)
Add NULL instance to pass build.

Cc: Feng Tian <>
Cc: Star Zeng <>
Cc: Michael D Kinney <>
Cc: Liming Gao <>
Cc: Chao Zhang <>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <>
Reviewed-by: Liming Gao <>
Reviewed-by: Michael Kinney <>
Tested-by: Michael Kinney <>
SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.c [new file with mode: 0644]
SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.inf [new file with mode: 0644]
SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.uni [new file with mode: 0644]

diff --git a/SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.c b/SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.c
new file mode 100644 (file)
index 0000000..b34ebbb
--- /dev/null
@@ -0,0 +1,51 @@
+/** @file\r
+  Platform flash device access library NULL instance.\r
+  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  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
+#include <PiDxe.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/PlatformFlashAccessLib.h>\r
+UINT64 mInternalFdAddress;\r
+  Perform flash write opreation.\r
+  @param[in] FirmwareType      The type of firmware.\r
+  @param[in] FlashAddress      The address of flash device to be accessed.\r
+  @param[in] FlashAddressType  The type of flash device address.\r
+  @param[in] Buffer            The pointer to the data buffer.\r
+  @param[in] Length            The length of data buffer in bytes.\r
+  @retval EFI_SUCCESS           The operation returns successfully.\r
+  @retval EFI_WRITE_PROTECTED   The flash device is read only.\r
+  @retval EFI_UNSUPPORTED       The flash device access is unsupported.\r
+  @retval EFI_INVALID_PARAMETER The input parameter is not valid.\r
+PerformFlashWrite (\r
+  IN PLATFORM_FIRMWARE_TYPE       FirmwareType,\r
+  IN EFI_PHYSICAL_ADDRESS         FlashAddress,\r
+  IN FLASH_ADDRESS_TYPE           FlashAddressType,\r
+  IN VOID                         *Buffer,\r
+  IN UINTN                        Length\r
+  )\r
+  if (FlashAddressType == FlashAddressTypeRelativeAddress) {\r
+    FlashAddress = FlashAddress + mInternalFdAddress;\r
+  }\r
+  CopyMem((VOID *)(UINTN)(FlashAddress), Buffer, Length);\r
+  return EFI_SUCCESS;\r
diff --git a/SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.inf b/SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.inf
new file mode 100644 (file)
index 0000000..f3a7a6c
--- /dev/null
@@ -0,0 +1,40 @@
+## @file\r
+#  Platform flash device access library.\r
+#  Platform flash device access library NULL instance.\r
+#  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+#  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
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = PlatformFlashAccessLibNull\r
+  MODULE_UNI_FILE                = PlatformFlashAccessLibNull.uni\r
+  FILE_GUID                      = A0534D92-9776-4E4E-9234-C9DC1849DBB5\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = PlatformFlashAccessLib\r
+# The following information is for reference only and not required by the build tools.\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+  PlatformFlashAccessLibNull.c\r
+  MdePkg/MdePkg.dec\r
+  SignedCapsulePkg/SignedCapsulePkg.dec\r
+  BaseMemoryLib\r
diff --git a/SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.uni b/SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.uni
new file mode 100644 (file)
index 0000000..ae2648e
--- /dev/null
@@ -0,0 +1,21 @@
+// /** @file\r
+//  Platform flash device access library.\r
+//  Platform flash device access library NULL instance.\r
+// Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+// 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
+// **/\r
+#string STR_MODULE_ABSTRACT             #language en-US "Platform flash device access library."\r
+#string STR_MODULE_DESCRIPTION          #language en-US "Platform flash device access library NULL instance."\r