]>
Commit | Line | Data |
---|---|---|
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 | |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
5d2e8ef0 HW |
6 | \r |
7 | @par Revision Reference:\r | |
8 | This Protocol is introduced in UEFI Specification 2.6\r | |
9 | \r | |
10 | **/\r | |
11 | \r | |
12 | #ifndef __RAM_DISK_PROTOCOL_H__\r | |
13 | #define __RAM_DISK_PROTOCOL_H__\r | |
14 | \r | |
15 | //\r | |
16 | // EFI RAM Disk Protocol GUID value\r | |
17 | //\r | |
18 | #define EFI_RAM_DISK_PROTOCOL_GUID \\r | |
19 | { 0xab38a0df, 0x6873, 0x44a9, { 0x87, 0xe6, 0xd4, 0xeb, 0x56, 0x14, 0x84, 0x49 }};\r | |
20 | \r | |
21 | //\r | |
22 | // Forward reference for pure ANSI compatability\r | |
23 | //\r | |
24 | typedef struct _EFI_RAM_DISK_PROTOCOL EFI_RAM_DISK_PROTOCOL;\r | |
25 | \r | |
26 | /**\r | |
27 | Register a RAM disk with specified address, size and type.\r | |
28 | \r | |
29 | @param[in] RamDiskBase The base address of registered RAM disk.\r | |
30 | @param[in] RamDiskSize The size of registered RAM disk.\r | |
31 | @param[in] RamDiskType The type of registered RAM disk. The GUID can be\r | |
32 | any of the values defined in section 9.3.6.9, or a\r | |
33 | vendor defined GUID.\r | |
34 | @param[in] ParentDevicePath\r | |
35 | Pointer to the parent device path. If there is no\r | |
36 | parent device path then ParentDevicePath is NULL.\r | |
37 | @param[out] DevicePath On return, points to a pointer to the device path\r | |
38 | of the RAM disk device.\r | |
39 | If ParentDevicePath is not NULL, the returned\r | |
40 | DevicePath is created by appending a RAM disk node\r | |
41 | to the parent device path. If ParentDevicePath is\r | |
42 | NULL, the returned DevicePath is a RAM disk device\r | |
43 | path without appending. This function is\r | |
44 | responsible for allocating the buffer DevicePath\r | |
45 | with the boot service AllocatePool().\r | |
46 | \r | |
47 | @retval EFI_SUCCESS The RAM disk is registered successfully.\r | |
48 | @retval EFI_INVALID_PARAMETER DevicePath or RamDiskType is NULL.\r | |
49 | RamDiskSize is 0.\r | |
50 | @retval EFI_ALREADY_STARTED A Device Path Protocol instance to be created\r | |
51 | is already present in the handle database.\r | |
52 | @retval EFI_OUT_OF_RESOURCES The RAM disk register operation fails due to\r | |
53 | resource limitation.\r | |
54 | \r | |
55 | **/\r | |
56 | typedef\r | |
57 | EFI_STATUS\r | |
58 | (EFIAPI *EFI_RAM_DISK_REGISTER_RAMDISK) (\r | |
59 | IN UINT64 RamDiskBase,\r | |
60 | IN UINT64 RamDiskSize,\r | |
61 | IN EFI_GUID *RamDiskType,\r | |
62 | IN EFI_DEVICE_PATH *ParentDevicePath OPTIONAL,\r | |
63 | OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r | |
64 | );\r | |
65 | \r | |
66 | /**\r | |
67 | Unregister a RAM disk specified by DevicePath.\r | |
68 | \r | |
69 | @param[in] DevicePath A pointer to the device path that describes a RAM\r | |
70 | Disk device.\r | |
71 | \r | |
72 | @retval EFI_SUCCESS The RAM disk is unregistered successfully.\r | |
73 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
74 | @retval EFI_UNSUPPORTED The device specified by DevicePath is not a\r | |
75 | valid ramdisk device path and not supported\r | |
76 | by the driver.\r | |
77 | @retval EFI_NOT_FOUND The RAM disk pointed by DevicePath doesn't\r | |
78 | exist.\r | |
79 | \r | |
80 | **/\r | |
81 | typedef\r | |
82 | EFI_STATUS\r | |
83 | (EFIAPI *EFI_RAM_DISK_UNREGISTER_RAMDISK) (\r | |
84 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
85 | );\r | |
86 | \r | |
87 | ///\r | |
88 | /// RAM Disk Protocol structure.\r | |
89 | ///\r | |
90 | struct _EFI_RAM_DISK_PROTOCOL {\r | |
91 | EFI_RAM_DISK_REGISTER_RAMDISK Register;\r | |
92 | EFI_RAM_DISK_UNREGISTER_RAMDISK Unregister;\r | |
93 | };\r | |
94 | \r | |
95 | ///\r | |
96 | /// RAM Disk Protocol GUID variable.\r | |
97 | ///\r | |
98 | extern EFI_GUID gEfiRamDiskProtocolGuid;\r | |
99 | \r | |
100 | #endif\r |