]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/Disk/Partition/Dxe/Partition.h
Initial import.
[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
31
32 //
33 // Partition private data
34 //
35 #define PARTITION_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('P', 'a', 'r', 't')
36 typedef struct {
37 UINT64 Signature;
38
39 EFI_HANDLE Handle;
40 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
41 EFI_BLOCK_IO_PROTOCOL BlockIo;
42 EFI_BLOCK_IO_MEDIA Media;
43
44 EFI_DISK_IO_PROTOCOL *DiskIo;
45 EFI_BLOCK_IO_PROTOCOL *ParentBlockIo;
46 UINT64 Start;
47 UINT64 End;
48 UINT32 BlockSize;
49
50 EFI_GUID *EspGuid;
51
52 } PARTITION_PRIVATE_DATA;
53
54 #define PARTITION_DEVICE_FROM_BLOCK_IO_THIS(a) CR (a, PARTITION_PRIVATE_DATA, BlockIo, PARTITION_PRIVATE_DATA_SIGNATURE)
55
56 //
57 // Global Variables
58 //
59 extern EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding;
60 extern EFI_COMPONENT_NAME_PROTOCOL gPartitionComponentName;
61
62 //
63 // Extract INT32 from char array
64 //
65 #define UNPACK_INT32(a) (INT32)( (((UINT8 *) a)[0] << 0) | \
66 (((UINT8 *) a)[1] << 8) | \
67 (((UINT8 *) a)[2] << 16) | \
68 (((UINT8 *) a)[3] << 24) )
69
70 //
71 // Extract UINT32 from char array
72 //
73 #define UNPACK_UINT32(a) (UINT32)( (((UINT8 *) a)[0] << 0) | \
74 (((UINT8 *) a)[1] << 8) | \
75 (((UINT8 *) a)[2] << 16) | \
76 (((UINT8 *) a)[3] << 24) )
77
78 EFI_STATUS
79 PartitionInstallChildHandle (
80 IN EFI_DRIVER_BINDING_PROTOCOL *This,
81 IN EFI_HANDLE ParentHandle,
82 IN EFI_DISK_IO_PROTOCOL *ParentDiskIo,
83 IN EFI_BLOCK_IO_PROTOCOL *ParentBlockIo,
84 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
85 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
86 IN UINT64 Start,
87 IN UINT64 End,
88 IN UINT32 BlockSize,
89 IN BOOLEAN InstallEspGuid
90 )
91 ;
92
93 BOOLEAN
94 PartitionInstallGptChildHandles (
95 IN EFI_DRIVER_BINDING_PROTOCOL *This,
96 IN EFI_HANDLE Handle,
97 IN EFI_DISK_IO_PROTOCOL *DiskIo,
98 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
99 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
100 )
101 ;
102
103 BOOLEAN
104 PartitionInstallElToritoChildHandles (
105 IN EFI_DRIVER_BINDING_PROTOCOL *This,
106 IN EFI_HANDLE Handle,
107 IN EFI_DISK_IO_PROTOCOL *DiskIo,
108 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
109 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
110 )
111 ;
112
113 BOOLEAN
114 PartitionInstallMbrChildHandles (
115 IN EFI_DRIVER_BINDING_PROTOCOL *This,
116 IN EFI_HANDLE Handle,
117 IN EFI_DISK_IO_PROTOCOL *DiskIo,
118 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
119 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
120 )
121 ;
122
123 #endif