Unix version of EFI emulator
[mirror_edk2.git] / EdkUnixPkg / Dxe / UnixThunk / Bus / BlockIo / UnixBlockIo.h
CommitLineData
c9093a06 1/*++\r
2\r
3Copyright (c) 2004 - 2005, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 UnixBlockIo.h\r
15\r
16Abstract:\r
17\r
18 Produce block IO abstractions for real devices on your PC using Win32 APIs.\r
19 The configuration of what devices to mount or emulate comes from NT \r
20 environment variables. The variables must be visible to the Microsoft* \r
21 Developer Studio for them to work.\r
22\r
23 * Other names and brands may be claimed as the property of others.\r
24\r
25--*/\r
26\r
27#ifndef _UNIX_BLOCK_IO_H_\r
28#define _UNIX_BLOCK_IO_H_\r
29\r
30#define FILENAME_BUFFER_SIZE 80\r
31\r
32//\r
33// Language supported for driverconfiguration protocol\r
34//\r
35#define LANGUAGESUPPORTED "eng"\r
36\r
37#define UNIX_BLOCK_IO_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('L', 'X', 'b', 'k')\r
38typedef struct {\r
39 UINTN Signature;\r
40\r
41 EFI_LOCK Lock;\r
42\r
43 char Filename[FILENAME_BUFFER_SIZE];\r
44 UINTN ReadMode;\r
45 UINTN Mode;\r
46\r
47 int fd;
48\r
49 UINT64 LastBlock;\r
50 UINTN BlockSize;\r
51 UINT64 NumberOfBlocks;\r
52\r
53 EFI_HANDLE EfiHandle;\r
54 EFI_BLOCK_IO_PROTOCOL BlockIo;\r
55 EFI_BLOCK_IO_MEDIA Media;\r
56\r
57 EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
58\r
59 EFI_UNIX_THUNK_PROTOCOL *UnixThunk;\r
60\r
61} UNIX_BLOCK_IO_PRIVATE;\r
62\r
63#define UNIX_BLOCK_IO_PRIVATE_DATA_FROM_THIS(a) \\r
64 CR(a, UNIX_BLOCK_IO_PRIVATE, BlockIo, UNIX_BLOCK_IO_PRIVATE_SIGNATURE)\r
65\r
66#define LIST_BUFFER_SIZE 512\r
67\r
68//\r
69// Block I/O Global Variables\r
70//\r
71extern EFI_DRIVER_BINDING_PROTOCOL gUnixBlockIoDriverBinding;\r
72extern EFI_COMPONENT_NAME_PROTOCOL gUnixBlockIoComponentName;\r
73extern EFI_DRIVER_CONFIGURATION_PROTOCOL gUnixBlockIoDriverConfiguration;\r
74extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL gUnixBlockIoDriverDiagnostics;\r
75\r
76//\r
77// EFI Driver Binding Functions\r
78//\r
79EFI_STATUS\r
80EFIAPI\r
81UnixBlockIoDriverBindingSupported (\r
82 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
83 IN EFI_HANDLE Handle,\r
84 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
85 )\r
86/*++\r
87\r
88Routine Description:\r
89\r
90 TODO: Add function description\r
91\r
92Arguments:\r
93\r
94 This - TODO: add argument description\r
95 Handle - TODO: add argument description\r
96 RemainingDevicePath - TODO: add argument description\r
97\r
98Returns:\r
99\r
100 TODO: add return values\r
101\r
102--*/\r
103;\r
104\r
105EFI_STATUS\r
106EFIAPI\r
107UnixBlockIoDriverBindingStart (\r
108 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
109 IN EFI_HANDLE Handle,\r
110 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
111 )\r
112/*++\r
113\r
114Routine Description:\r
115\r
116 TODO: Add function description\r
117\r
118Arguments:\r
119\r
120 This - TODO: add argument description\r
121 Handle - TODO: add argument description\r
122 RemainingDevicePath - TODO: add argument description\r
123\r
124Returns:\r
125\r
126 TODO: add return values\r
127\r
128--*/\r
129;\r
130\r
131EFI_STATUS\r
132EFIAPI\r
133UnixBlockIoDriverBindingStop (\r
134 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
135 IN EFI_HANDLE Handle,\r
136 IN UINTN NumberOfChildren,\r
137 IN EFI_HANDLE *ChildHandleBuffer\r
138 )\r
139/*++\r
140\r
141Routine Description:\r
142\r
143 TODO: Add function description\r
144\r
145Arguments:\r
146\r
147 This - TODO: add argument description\r
148 Handle - TODO: add argument description\r
149 NumberOfChildren - TODO: add argument description\r
150 ChildHandleBuffer - TODO: add argument description\r
151\r
152Returns:\r
153\r
154 TODO: add return values\r
155\r
156--*/\r
157;\r
158\r
159EFI_STATUS\r
160SetFilePointer64 (\r
161 IN UNIX_BLOCK_IO_PRIVATE *Private,\r
162 IN INT64 DistanceToMove,\r
163 OUT UINT64 *NewFilePointer,\r
164 IN INT32 MoveMethod\r
165 )\r
166/*++\r
167\r
168Routine Description:\r
169\r
170 TODO: Add function description\r
171\r
172Arguments:\r
173\r
174 Private - TODO: add argument description\r
175 DistanceToMove - TODO: add argument description\r
176 NewFilePointer - TODO: add argument description\r
177 MoveMethod - TODO: add argument description\r
178\r
179Returns:\r
180\r
181 TODO: add return values\r
182\r
183--*/\r
184;\r
185\r
186UINTN\r
187Atoi (\r
188 CHAR16 *String\r
189 )\r
190/*++\r
191\r
192Routine Description:\r
193\r
194 TODO: Add function description\r
195\r
196Arguments:\r
197\r
198 String - TODO: add argument description\r
199\r
200Returns:\r
201\r
202 TODO: add return values\r
203\r
204--*/\r
205;\r
206\r
207#endif\r