]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Disk/Partition/Dxe/Partition.h
Fixed typo in function header
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / Partition / Dxe / Partition.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Partition.h
15
16 Abstract:
17
18 Partition driver that produces logical BlockIo devices from a physical
19 BlockIo device. The logical BlockIo devices are based on the format
20 of the raw block devices media. Currently "El Torito CD-ROM", Legacy
21 MBR, and GPT partition schemes are supported.
22
23 Revision History
24
25 --*/
26
27 #ifndef __PARTITION_H__
28 #define __PARTITION_H__
29
30 //
31 // Include common header file for this module.
32 //
33 #include "CommonHeader.h"
34
35 #include <IndustryStandard/Mbr.h>
36 #include <IndustryStandard/ElTorito.h>
37
38
39 //
40 // Partition private data
41 //
42 #define PARTITION_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('P', 'a', 'r', 't')
43 typedef struct {
44 UINT64 Signature;
45
46 EFI_HANDLE Handle;
47 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
48 EFI_BLOCK_IO_PROTOCOL BlockIo;
49 EFI_BLOCK_IO_MEDIA Media;
50
51 EFI_DISK_IO_PROTOCOL *DiskIo;
52 EFI_BLOCK_IO_PROTOCOL *ParentBlockIo;
53 UINT64 Start;
54 UINT64 End;
55 UINT32 BlockSize;
56
57 EFI_GUID *EspGuid;
58
59 } PARTITION_PRIVATE_DATA;
60
61 #define PARTITION_DEVICE_FROM_BLOCK_IO_THIS(a) CR (a, PARTITION_PRIVATE_DATA, BlockIo, PARTITION_PRIVATE_DATA_SIGNATURE)
62
63 //
64 // Global Variables
65 //
66 extern EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding;
67 extern EFI_COMPONENT_NAME_PROTOCOL gPartitionComponentName;
68
69 //
70 // Extract INT32 from char array
71 //
72 #define UNPACK_INT32(a) (INT32)( (((UINT8 *) a)[0] << 0) | \
73 (((UINT8 *) a)[1] << 8) | \
74 (((UINT8 *) a)[2] << 16) | \
75 (((UINT8 *) a)[3] << 24) )
76
77 //
78 // Extract UINT32 from char array
79 //
80 #define UNPACK_UINT32(a) (UINT32)( (((UINT8 *) a)[0] << 0) | \
81 (((UINT8 *) a)[1] << 8) | \
82 (((UINT8 *) a)[2] << 16) | \
83 (((UINT8 *) a)[3] << 24) )
84
85 //
86 // Function Prototypes
87 //
88 EFI_STATUS
89 EFIAPI
90 PartitionDriverBindingSupported (
91 IN EFI_DRIVER_BINDING_PROTOCOL *This,
92 IN EFI_HANDLE ControllerHandle,
93 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
94 );
95
96 EFI_STATUS
97 EFIAPI
98 PartitionDriverBindingStart (
99 IN EFI_DRIVER_BINDING_PROTOCOL *This,
100 IN EFI_HANDLE ControllerHandle,
101 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
102 );
103
104 EFI_STATUS
105 EFIAPI
106 PartitionDriverBindingStop (
107 IN EFI_DRIVER_BINDING_PROTOCOL *This,
108 IN EFI_HANDLE ControllerHandle,
109 IN UINTN NumberOfChildren,
110 IN EFI_HANDLE *ChildHandleBuffer
111 );
112
113 //
114 // EFI Component Name Functions
115 //
116 EFI_STATUS
117 EFIAPI
118 PartitionComponentNameGetDriverName (
119 IN EFI_COMPONENT_NAME_PROTOCOL *This,
120 IN CHAR8 *Language,
121 OUT CHAR16 **DriverName
122 );
123
124 EFI_STATUS
125 EFIAPI
126 PartitionComponentNameGetControllerName (
127 IN EFI_COMPONENT_NAME_PROTOCOL *This,
128 IN EFI_HANDLE ControllerHandle,
129 IN EFI_HANDLE ChildHandle OPTIONAL,
130 IN CHAR8 *Language,
131 OUT CHAR16 **ControllerName
132 );
133
134 EFI_STATUS
135 PartitionInstallChildHandle (
136 IN EFI_DRIVER_BINDING_PROTOCOL *This,
137 IN EFI_HANDLE ParentHandle,
138 IN EFI_DISK_IO_PROTOCOL *ParentDiskIo,
139 IN EFI_BLOCK_IO_PROTOCOL *ParentBlockIo,
140 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
141 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
142 IN UINT64 Start,
143 IN UINT64 End,
144 IN UINT32 BlockSize,
145 IN BOOLEAN InstallEspGuid
146 )
147 ;
148
149 EFI_STATUS
150 PartitionInstallGptChildHandles (
151 IN EFI_DRIVER_BINDING_PROTOCOL *This,
152 IN EFI_HANDLE Handle,
153 IN EFI_DISK_IO_PROTOCOL *DiskIo,
154 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
155 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
156 )
157 ;
158
159 EFI_STATUS
160 PartitionInstallElToritoChildHandles (
161 IN EFI_DRIVER_BINDING_PROTOCOL *This,
162 IN EFI_HANDLE Handle,
163 IN EFI_DISK_IO_PROTOCOL *DiskIo,
164 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
165 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
166 )
167 ;
168
169 EFI_STATUS
170 PartitionInstallMbrChildHandles (
171 IN EFI_DRIVER_BINDING_PROTOCOL *This,
172 IN EFI_HANDLE Handle,
173 IN EFI_DISK_IO_PROTOCOL *DiskIo,
174 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
175 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
176 )
177 ;
178
179 typedef
180 EFI_STATUS
181 (*PARTITION_DETECT_ROUTINE) (
182 IN EFI_DRIVER_BINDING_PROTOCOL *This,
183 IN EFI_HANDLE Handle,
184 IN EFI_DISK_IO_PROTOCOL *DiskIo,
185 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
186 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
187 );
188
189 #endif