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