aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/RamDisk.h
diff options
context:
space:
mode:
authorJonathan Zhang <jonzhang@fb.com>2020-06-09 17:56:53 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-06-25 11:57:06 +0000
commit6d27778973edf6bdebfa812eac8893d52961a891 (patch)
tree8023f5c4d98247b5ef3ceb18b8820e1131753f7e /src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/RamDisk.h
parentc9222f956763d20397152a44985bdb4abdb19e2d (diff)
vendorcode/intel: Add edk2-stable202005 support
This patch includes (edk2/edk2-stable202005) all required headers for edk2-stable202005 quarterly EDK2 tag from EDK2 github project using below command: >> git clone https://github.com/tianocore/edk2.git vedk2-stable202005 Only include necessary header files. MdePkg/Include/Base.h was updated to avoid compilation errors through safeguarding definitions for MIN, MAX, NULL, ABS, ARRAY_SIZE. Signed-off-by: Jonathan Zhang <jonzhang@fb.com> Change-Id: I3172505d9b829647ee1208c87623172f10b39310 Reviewed-on: https://review.coreboot.org/c/coreboot/+/42239 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Subrata Banik <subrata.banik@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/RamDisk.h')
-rw-r--r--src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/RamDisk.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/RamDisk.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/RamDisk.h
new file mode 100644
index 0000000000..9861ec64e6
--- /dev/null
+++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/RamDisk.h
@@ -0,0 +1,100 @@
+/** @file
+ This file defines the EFI RAM Disk Protocol.
+
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.6
+
+**/
+
+#ifndef __RAM_DISK_PROTOCOL_H__
+#define __RAM_DISK_PROTOCOL_H__
+
+//
+// EFI RAM Disk Protocol GUID value
+//
+#define EFI_RAM_DISK_PROTOCOL_GUID \
+ { 0xab38a0df, 0x6873, 0x44a9, { 0x87, 0xe6, 0xd4, 0xeb, 0x56, 0x14, 0x84, 0x49 }};
+
+//
+// Forward reference for pure ANSI compatability
+//
+typedef struct _EFI_RAM_DISK_PROTOCOL EFI_RAM_DISK_PROTOCOL;
+
+/**
+ Register a RAM disk with specified address, size and type.
+
+ @param[in] RamDiskBase The base address of registered RAM disk.
+ @param[in] RamDiskSize The size of registered RAM disk.
+ @param[in] RamDiskType The type of registered RAM disk. The GUID can be
+ any of the values defined in section 9.3.6.9, or a
+ vendor defined GUID.
+ @param[in] ParentDevicePath
+ Pointer to the parent device path. If there is no
+ parent device path then ParentDevicePath is NULL.
+ @param[out] DevicePath On return, points to a pointer to the device path
+ of the RAM disk device.
+ If ParentDevicePath is not NULL, the returned
+ DevicePath is created by appending a RAM disk node
+ to the parent device path. If ParentDevicePath is
+ NULL, the returned DevicePath is a RAM disk device
+ path without appending. This function is
+ responsible for allocating the buffer DevicePath
+ with the boot service AllocatePool().
+
+ @retval EFI_SUCCESS The RAM disk is registered successfully.
+ @retval EFI_INVALID_PARAMETER DevicePath or RamDiskType is NULL.
+ RamDiskSize is 0.
+ @retval EFI_ALREADY_STARTED A Device Path Protocol instance to be created
+ is already present in the handle database.
+ @retval EFI_OUT_OF_RESOURCES The RAM disk register operation fails due to
+ resource limitation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RAM_DISK_REGISTER_RAMDISK) (
+ IN UINT64 RamDiskBase,
+ IN UINT64 RamDiskSize,
+ IN EFI_GUID *RamDiskType,
+ IN EFI_DEVICE_PATH *ParentDevicePath OPTIONAL,
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Unregister a RAM disk specified by DevicePath.
+
+ @param[in] DevicePath A pointer to the device path that describes a RAM
+ Disk device.
+
+ @retval EFI_SUCCESS The RAM disk is unregistered successfully.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_UNSUPPORTED The device specified by DevicePath is not a
+ valid ramdisk device path and not supported
+ by the driver.
+ @retval EFI_NOT_FOUND The RAM disk pointed by DevicePath doesn't
+ exist.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RAM_DISK_UNREGISTER_RAMDISK) (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+///
+/// RAM Disk Protocol structure.
+///
+struct _EFI_RAM_DISK_PROTOCOL {
+ EFI_RAM_DISK_REGISTER_RAMDISK Register;
+ EFI_RAM_DISK_UNREGISTER_RAMDISK Unregister;
+};
+
+///
+/// RAM Disk Protocol GUID variable.
+///
+extern EFI_GUID gEfiRamDiskProtocolGuid;
+
+#endif