+/** @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