]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/Disk/Partition/Dxe/Partition.h
Make EdkModulePkg pass Intel IPF compiler with /W4 /WX switches, solving warning...
[mirror_edk2.git] / EdkModulePkg / 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 #include <IndustryStandard/Mbr.h>
31 #include <IndustryStandard/ElTorito.h>
32 #include <IndustryStandard/EfiGpt.h>
33
34 //
35 // Partition private data
36 //
37 #define PARTITION_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('P', 'a', 'r', 't')
38 typedef struct {
39 UINT64 Signature;
40
41 EFI_HANDLE Handle;
42 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
43 EFI_BLOCK_IO_PROTOCOL BlockIo;
44 EFI_BLOCK_IO_MEDIA Media;
45
46 EFI_DISK_IO_PROTOCOL *DiskIo;
47 EFI_BLOCK_IO_PROTOCOL *ParentBlockIo;
48 UINT64 Start;
49 UINT64 End;
50 UINT32 BlockSize;
51
52 EFI_GUID *EspGuid;
53
54 } PARTITION_PRIVATE_DATA;
55
56 #define PARTITION_DEVICE_FROM_BLOCK_IO_THIS(a) CR (a, PARTITION_PRIVATE_DATA, BlockIo, PARTITION_PRIVATE_DATA_SIGNATURE)
57
58 //
59 // Global Variables
60 //
61 extern EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding;
62 extern EFI_COMPONENT_NAME_PROTOCOL gPartitionComponentName;
63
64 //
65 // Extract INT32 from char array
66 //
67 #define UNPACK_INT32(a) (INT32)( (((UINT8 *) a)[0] << 0) | \
68 (((UINT8 *) a)[1] << 8) | \
69 (((UINT8 *) a)[2] << 16) | \
70 (((UINT8 *) a)[3] << 24) )
71
72 //
73 // Extract UINT32 from char array
74 //
75 #define UNPACK_UINT32(a) (UINT32)( (((UINT8 *) a)[0] << 0) | \
76 (((UINT8 *) a)[1] << 8) | \
77 (((UINT8 *) a)[2] << 16) | \
78 (((UINT8 *) a)[3] << 24) )
79
80 //
81 // Function Prototypes
82 //
83 EFI_STATUS
84 EFIAPI
85 PartitionDriverBindingSupported (
86 IN EFI_DRIVER_BINDING_PROTOCOL *This,
87 IN EFI_HANDLE ControllerHandle,
88 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
89 );
90
91 EFI_STATUS
92 EFIAPI
93 PartitionDriverBindingStart (
94 IN EFI_DRIVER_BINDING_PROTOCOL *This,
95 IN EFI_HANDLE ControllerHandle,
96 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
97 );
98
99 EFI_STATUS
100 EFIAPI
101 PartitionDriverBindingStop (
102 IN EFI_DRIVER_BINDING_PROTOCOL *This,
103 IN EFI_HANDLE ControllerHandle,
104 IN UINTN NumberOfChildren,
105 IN EFI_HANDLE *ChildHandleBuffer
106 );
107
108 //
109 // EFI Component Name Functions
110 //
111 EFI_STATUS
112 EFIAPI
113 PartitionComponentNameGetDriverName (
114 IN EFI_COMPONENT_NAME_PROTOCOL *This,
115 IN CHAR8 *Language,
116 OUT CHAR16 **DriverName
117 );
118
119 EFI_STATUS
120 EFIAPI
121 PartitionComponentNameGetControllerName (
122 IN EFI_COMPONENT_NAME_PROTOCOL *This,
123 IN EFI_HANDLE ControllerHandle,
124 IN EFI_HANDLE ChildHandle OPTIONAL,
125 IN CHAR8 *Language,
126 OUT CHAR16 **ControllerName
127 );
128
129 EFI_STATUS
130 PartitionInstallChildHandle (
131 IN EFI_DRIVER_BINDING_PROTOCOL *This,
132 IN EFI_HANDLE ParentHandle,
133 IN EFI_DISK_IO_PROTOCOL *ParentDiskIo,
134 IN EFI_BLOCK_IO_PROTOCOL *ParentBlockIo,
135 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
136 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
137 IN UINT64 Start,
138 IN UINT64 End,
139 IN UINT32 BlockSize,
140 IN BOOLEAN InstallEspGuid
141 )
142 ;
143
144 EFI_STATUS
145 PartitionInstallGptChildHandles (
146 IN EFI_DRIVER_BINDING_PROTOCOL *This,
147 IN EFI_HANDLE Handle,
148 IN EFI_DISK_IO_PROTOCOL *DiskIo,
149 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
150 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
151 )
152 ;
153
154 EFI_STATUS
155 PartitionInstallElToritoChildHandles (
156 IN EFI_DRIVER_BINDING_PROTOCOL *This,
157 IN EFI_HANDLE Handle,
158 IN EFI_DISK_IO_PROTOCOL *DiskIo,
159 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
160 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
161 )
162 ;
163
164 EFI_STATUS
165 PartitionInstallMbrChildHandles (
166 IN EFI_DRIVER_BINDING_PROTOCOL *This,
167 IN EFI_HANDLE Handle,
168 IN EFI_DISK_IO_PROTOCOL *DiskIo,
169 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
170 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
171 )
172 ;
173
174 typedef
175 EFI_STATUS
176 (*PARTITION_DETECT_ROUTINE) (
177 IN EFI_DRIVER_BINDING_PROTOCOL *This,
178 IN EFI_HANDLE Handle,
179 IN EFI_DISK_IO_PROTOCOL *DiskIo,
180 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
181 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
182 );
183
184 #endif