]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/RamDisk.h
MdePkg: MTftp6: Correct #define value in Mtfp6.h
[mirror_edk2.git] / MdePkg / Include / Protocol / RamDisk.h
CommitLineData
5d2e8ef0
HW
1/** @file\r
2 This file defines the EFI RAM Disk Protocol.\r
3\r
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 @par Revision Reference:\r
14 This Protocol is introduced in UEFI Specification 2.6\r
15\r
16**/\r
17\r
18#ifndef __RAM_DISK_PROTOCOL_H__\r
19#define __RAM_DISK_PROTOCOL_H__\r
20\r
21//\r
22// EFI RAM Disk Protocol GUID value\r
23//\r
24#define EFI_RAM_DISK_PROTOCOL_GUID \\r
25 { 0xab38a0df, 0x6873, 0x44a9, { 0x87, 0xe6, 0xd4, 0xeb, 0x56, 0x14, 0x84, 0x49 }};\r
26\r
27//\r
28// Forward reference for pure ANSI compatability\r
29//\r
30typedef struct _EFI_RAM_DISK_PROTOCOL EFI_RAM_DISK_PROTOCOL;\r
31\r
32/**\r
33 Register a RAM disk with specified address, size and type.\r
34\r
35 @param[in] RamDiskBase The base address of registered RAM disk.\r
36 @param[in] RamDiskSize The size of registered RAM disk.\r
37 @param[in] RamDiskType The type of registered RAM disk. The GUID can be\r
38 any of the values defined in section 9.3.6.9, or a\r
39 vendor defined GUID.\r
40 @param[in] ParentDevicePath\r
41 Pointer to the parent device path. If there is no\r
42 parent device path then ParentDevicePath is NULL.\r
43 @param[out] DevicePath On return, points to a pointer to the device path\r
44 of the RAM disk device.\r
45 If ParentDevicePath is not NULL, the returned\r
46 DevicePath is created by appending a RAM disk node\r
47 to the parent device path. If ParentDevicePath is\r
48 NULL, the returned DevicePath is a RAM disk device\r
49 path without appending. This function is\r
50 responsible for allocating the buffer DevicePath\r
51 with the boot service AllocatePool().\r
52\r
53 @retval EFI_SUCCESS The RAM disk is registered successfully.\r
54 @retval EFI_INVALID_PARAMETER DevicePath or RamDiskType is NULL.\r
55 RamDiskSize is 0.\r
56 @retval EFI_ALREADY_STARTED A Device Path Protocol instance to be created\r
57 is already present in the handle database.\r
58 @retval EFI_OUT_OF_RESOURCES The RAM disk register operation fails due to\r
59 resource limitation.\r
60\r
61**/\r
62typedef\r
63EFI_STATUS\r
64(EFIAPI *EFI_RAM_DISK_REGISTER_RAMDISK) (\r
65 IN UINT64 RamDiskBase,\r
66 IN UINT64 RamDiskSize,\r
67 IN EFI_GUID *RamDiskType,\r
68 IN EFI_DEVICE_PATH *ParentDevicePath OPTIONAL,\r
69 OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r
70 );\r
71\r
72/**\r
73 Unregister a RAM disk specified by DevicePath.\r
74\r
75 @param[in] DevicePath A pointer to the device path that describes a RAM\r
76 Disk device.\r
77\r
78 @retval EFI_SUCCESS The RAM disk is unregistered successfully.\r
79 @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
80 @retval EFI_UNSUPPORTED The device specified by DevicePath is not a\r
81 valid ramdisk device path and not supported\r
82 by the driver.\r
83 @retval EFI_NOT_FOUND The RAM disk pointed by DevicePath doesn't\r
84 exist.\r
85\r
86**/\r
87typedef\r
88EFI_STATUS\r
89(EFIAPI *EFI_RAM_DISK_UNREGISTER_RAMDISK) (\r
90 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
91 );\r
92\r
93///\r
94/// RAM Disk Protocol structure.\r
95///\r
96struct _EFI_RAM_DISK_PROTOCOL {\r
97 EFI_RAM_DISK_REGISTER_RAMDISK Register;\r
98 EFI_RAM_DISK_UNREGISTER_RAMDISK Unregister;\r
99};\r
100\r
101///\r
102/// RAM Disk Protocol GUID variable.\r
103///\r
104extern EFI_GUID gEfiRamDiskProtocolGuid;\r
105\r
106#endif\r