]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add EFI RAM Disk Protocol definitions
authorHao Wu <hao.a.wu@intel.com>
Wed, 3 Feb 2016 04:58:01 +0000 (12:58 +0800)
committerHao Wu <hao.a.wu@intel.com>
Thu, 25 Feb 2016 08:24:15 +0000 (16:24 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: M1cha <sigmaepsilon92@gmail.com>
MdePkg/Include/Protocol/RamDisk.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/RamDisk.h b/MdePkg/Include/Protocol/RamDisk.h
new file mode 100644 (file)
index 0000000..5df8213
--- /dev/null
@@ -0,0 +1,106 @@
+/** @file\r
+  This file defines the EFI RAM Disk Protocol.\r
+\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
+  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
+  @par Revision Reference:\r
+  This Protocol is introduced in UEFI Specification 2.6\r
+\r
+**/\r
+\r
+#ifndef __RAM_DISK_PROTOCOL_H__\r
+#define __RAM_DISK_PROTOCOL_H__\r
+\r
+//\r
+// EFI RAM Disk Protocol GUID value\r
+//\r
+#define EFI_RAM_DISK_PROTOCOL_GUID \\r
+  { 0xab38a0df, 0x6873, 0x44a9, { 0x87, 0xe6, 0xd4, 0xeb, 0x56, 0x14, 0x84, 0x49 }};\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_RAM_DISK_PROTOCOL  EFI_RAM_DISK_PROTOCOL;\r
+\r
+/**\r
+  Register a RAM disk with specified address, size and type.\r
+\r
+  @param[in]  RamDiskBase    The base address of registered RAM disk.\r
+  @param[in]  RamDiskSize    The size of registered RAM disk.\r
+  @param[in]  RamDiskType    The type of registered RAM disk. The GUID can be\r
+                             any of the values defined in section 9.3.6.9, or a\r
+                             vendor defined GUID.\r
+  @param[in]  ParentDevicePath\r
+                             Pointer to the parent device path. If there is no\r
+                             parent device path then ParentDevicePath is NULL.\r
+  @param[out] DevicePath     On return, points to a pointer to the device path\r
+                             of the RAM disk device.\r
+                             If ParentDevicePath is not NULL, the returned\r
+                             DevicePath is created by appending a RAM disk node\r
+                             to the parent device path. If ParentDevicePath is\r
+                             NULL, the returned DevicePath is a RAM disk device\r
+                             path without appending. This function is\r
+                             responsible for allocating the buffer DevicePath\r
+                             with the boot service AllocatePool().\r
+\r
+  @retval EFI_SUCCESS             The RAM disk is registered successfully.\r
+  @retval EFI_INVALID_PARAMETER   DevicePath or RamDiskType is NULL.\r
+                                  RamDiskSize is 0.\r
+  @retval EFI_ALREADY_STARTED     A Device Path Protocol instance to be created\r
+                                  is already present in the handle database.\r
+  @retval EFI_OUT_OF_RESOURCES    The RAM disk register operation fails due to\r
+                                  resource limitation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RAM_DISK_REGISTER_RAMDISK) (\r
+  IN UINT64                       RamDiskBase,\r
+  IN UINT64                       RamDiskSize,\r
+  IN EFI_GUID                     *RamDiskType,\r
+  IN EFI_DEVICE_PATH              *ParentDevicePath     OPTIONAL,\r
+  OUT EFI_DEVICE_PATH_PROTOCOL    **DevicePath\r
+  );\r
+\r
+/**\r
+  Unregister a RAM disk specified by DevicePath.\r
+\r
+  @param[in] DevicePath      A pointer to the device path that describes a RAM\r
+                             Disk device.\r
+\r
+  @retval EFI_SUCCESS             The RAM disk is unregistered successfully.\r
+  @retval EFI_INVALID_PARAMETER   DevicePath is NULL.\r
+  @retval EFI_UNSUPPORTED         The device specified by DevicePath is not a\r
+                                  valid ramdisk device path and not supported\r
+                                  by the driver.\r
+  @retval EFI_NOT_FOUND           The RAM disk pointed by DevicePath doesn't\r
+                                  exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RAM_DISK_UNREGISTER_RAMDISK) (\r
+  IN  EFI_DEVICE_PATH_PROTOCOL    *DevicePath\r
+  );\r
+\r
+///\r
+/// RAM Disk Protocol structure.\r
+///\r
+struct _EFI_RAM_DISK_PROTOCOL {\r
+  EFI_RAM_DISK_REGISTER_RAMDISK        Register;\r
+  EFI_RAM_DISK_UNREGISTER_RAMDISK      Unregister;\r
+};\r
+\r
+///\r
+/// RAM Disk Protocol GUID variable.\r
+///\r
+extern EFI_GUID gEfiRamDiskProtocolGuid;\r
+\r
+#endif\r
index c49f1ceb037eb0ff7ad3191d2ebcaa7309b99f46..796dc054c2153ab05d681502db48bf7ce3c47ddd 100644 (file)
   ## Include/Protocol/WiFi2.h\r
   gEfiWiFi2ProtocolGuid                = { 0x1b0fb9bf, 0x699d, 0x4fdd, {0xa7, 0xc3, 0x25, 0x46, 0x68, 0x1b, 0xf6, 0x3b }}\r
 \r
   ## Include/Protocol/WiFi2.h\r
   gEfiWiFi2ProtocolGuid                = { 0x1b0fb9bf, 0x699d, 0x4fdd, {0xa7, 0xc3, 0x25, 0x46, 0x68, 0x1b, 0xf6, 0x3b }}\r
 \r
+  ## Include/Protocol/RamDisk.h\r
+  gEfiRamDiskProtocolGuid              = { 0xab38a0df, 0x6873, 0x44a9, { 0x87, 0xe6, 0xd4, 0xeb, 0x56, 0x14, 0x84, 0x49 }}\r
+\r
 #\r
 # [Error.gEfiMdePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r
 #\r
 # [Error.gEfiMdePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r