2 This file defines the EFI RAM Disk Protocol.
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
7 @par Revision Reference:
8 This Protocol is introduced in UEFI Specification 2.6
12 #ifndef __RAM_DISK_PROTOCOL_H__
13 #define __RAM_DISK_PROTOCOL_H__
16 // EFI RAM Disk Protocol GUID value
18 #define EFI_RAM_DISK_PROTOCOL_GUID \
19 { 0xab38a0df, 0x6873, 0x44a9, { 0x87, 0xe6, 0xd4, 0xeb, 0x56, 0x14, 0x84, 0x49 }};
22 // Forward reference for pure ANSI compatability
24 typedef struct _EFI_RAM_DISK_PROTOCOL EFI_RAM_DISK_PROTOCOL
;
27 Register a RAM disk with specified address, size and type.
29 @param[in] RamDiskBase The base address of registered RAM disk.
30 @param[in] RamDiskSize The size of registered RAM disk.
31 @param[in] RamDiskType The type of registered RAM disk. The GUID can be
32 any of the values defined in section 9.3.6.9, or a
34 @param[in] ParentDevicePath
35 Pointer to the parent device path. If there is no
36 parent device path then ParentDevicePath is NULL.
37 @param[out] DevicePath On return, points to a pointer to the device path
38 of the RAM disk device.
39 If ParentDevicePath is not NULL, the returned
40 DevicePath is created by appending a RAM disk node
41 to the parent device path. If ParentDevicePath is
42 NULL, the returned DevicePath is a RAM disk device
43 path without appending. This function is
44 responsible for allocating the buffer DevicePath
45 with the boot service AllocatePool().
47 @retval EFI_SUCCESS The RAM disk is registered successfully.
48 @retval EFI_INVALID_PARAMETER DevicePath or RamDiskType is NULL.
50 @retval EFI_ALREADY_STARTED A Device Path Protocol instance to be created
51 is already present in the handle database.
52 @retval EFI_OUT_OF_RESOURCES The RAM disk register operation fails due to
58 (EFIAPI
*EFI_RAM_DISK_REGISTER_RAMDISK
) (
59 IN UINT64 RamDiskBase
,
60 IN UINT64 RamDiskSize
,
61 IN EFI_GUID
*RamDiskType
,
62 IN EFI_DEVICE_PATH
*ParentDevicePath OPTIONAL
,
63 OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
67 Unregister a RAM disk specified by DevicePath.
69 @param[in] DevicePath A pointer to the device path that describes a RAM
72 @retval EFI_SUCCESS The RAM disk is unregistered successfully.
73 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
74 @retval EFI_UNSUPPORTED The device specified by DevicePath is not a
75 valid ramdisk device path and not supported
77 @retval EFI_NOT_FOUND The RAM disk pointed by DevicePath doesn't
83 (EFIAPI
*EFI_RAM_DISK_UNREGISTER_RAMDISK
) (
84 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
88 /// RAM Disk Protocol structure.
90 struct _EFI_RAM_DISK_PROTOCOL
{
91 EFI_RAM_DISK_REGISTER_RAMDISK Register
;
92 EFI_RAM_DISK_UNREGISTER_RAMDISK Unregister
;
96 /// RAM Disk Protocol GUID variable.
98 extern EFI_GUID gEfiRamDiskProtocolGuid
;