]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/UnixBusDriverDxe/UnixBusDriver.h
Update the copyright notice format
[mirror_edk2.git] / UnixPkg / UnixBusDriverDxe / UnixBusDriver.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 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 UnixBusDriver.h
15
16 Abstract:
17
18 This following section documents the PCD for the Unix
19 build. These variables are used to define the (virtual) hardware
20 configuration of the Unix environment
21
22 A ! can be used to seperate multiple instances in a variable. Each
23 instance represents a seperate hardware device.
24
25 EFI_UNIX_PHYSICAL_DISKS - maps to drives on your system
26 EFI_UNIX_VIRTUAL_DISKS - maps to a device emulated by a file
27 EFI_UNIX_FILE_SYSTEM - mouts a directory as a file system
28 EFI_UNIX_CONSOLE - make a logical comand line window (only one!)
29 EFI_UNIX_UGA - Builds UGA Windows of Width and Height
30 EFI_UNIX_SERIAL_PORT - maps physical serial ports
31 EFI_UNIX_PASS_THRU - associates a device with our PCI support
32
33 <F>ixed - Fixed disk like a hard drive.
34 <R>emovable - Removable media like a floppy or CD-ROM.
35 Read <O>nly - Write protected device.
36 Read <W>rite - Read write device.
37 <block count> - Decimal number of blocks a device supports.
38 <block size> - Decimal number of bytes per block.
39
40 UNIX envirnonment variable contents. '<' and '>' are not part of the variable,
41 they are just used to make this help more readable. There should be no
42 spaces between the ';'. Extra spaces will break the variable. A '!' is
43 used to seperate multiple devices in a variable.
44
45 EFI_UNIX_VIRTUAL_DISKS =
46 <F | R><O | W>;<block count>;<block size>[!...]
47
48 EFI_UNIX_PHYSICAL_DISKS =
49 <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]
50
51 Virtual Disks: These devices use a file to emulate a hard disk or removable
52 media device.
53
54 Thus a 20 MB emulated hard drive would look like:
55 EFI_UNIX_VIRTUAL_DISKS=FW;40960;512
56
57 A 1.44MB emulated floppy with a block size of 1024 would look like:
58 EFI_UNIX_VIRTUAL_DISKS=RW;1440;1024
59
60 Physical Disks: These devices use UNIX to open a real device in your system
61
62 Thus a 120 MB floppy would look like:
63 EFI_UNIX_PHYSICAL_DISKS=B:RW;245760;512
64
65 Thus a standard CD-ROM floppy would look like:
66 EFI_UNIX_PHYSICAL_DISKS=Z:RO;307200;2048
67
68 EFI_UNIX_FILE_SYSTEM =
69 <directory path>[!...]
70
71 Mounting the two directories C:\FOO and C:\BAR would look like:
72 EFI_UNIX_FILE_SYSTEM=c:\foo!c:\bar
73
74 EFI_UNIX_CONSOLE =
75 <window title>
76
77 Declaring a text console window with the title "My EFI Console" woild look like:
78 EFI_UNIX_CONSOLE=My EFI Console
79
80 EFI_UNIX_UGA =
81 <width> <height>[!...]
82
83 Declaring a two UGA windows with resolutions of 800x600 and 1024x768 would look like:
84 Example : EFI_UNIX_UGA=800 600!1024 768
85
86 EFI_UNIX_SERIAL_PORT =
87 <port name>[!...]
88
89 Declaring two serial ports on COM1 and COM2 would look like:
90 Example : EFI_UNIX_SERIAL_PORT=COM1!COM2
91
92 EFI_UNIX_PASS_THROUGH =
93 <BaseAddress>;<Bus#>;<Device#>;<Function#>
94
95 Declaring a base address of 0xE0000000 (used for PCI Express devices)
96 and having NT32 talk to a device located at bus 0, device 1, function 0:
97 Example : EFI_UNIX_PASS_THROUGH=E000000;0;1;0
98
99 ---*/
100
101 #ifndef __UNIX_BUS_DRIVER_H__
102 #define __UNIX_BUS_DRIVER_H__
103 #include "PiDxe.h"
104 #include "UnixDxe.h"
105 #include <Protocol/Pcd.h>
106 #include <Protocol/DevicePath.h>
107
108 #include <Library/DebugLib.h>
109 #include <Library/BaseLib.h>
110 #include <Library/UefiDriverEntryPoint.h>
111 #include <Library/UefiLib.h>
112 #include <Library/PcdLib.h>
113 #include <Library/BaseMemoryLib.h>
114 #include <Library/MemoryAllocationLib.h>
115 #include <Library/UefiBootServicesTableLib.h>
116 #include <Library/DevicePathLib.h>
117
118 extern EFI_DRIVER_BINDING_PROTOCOL gUnixBusDriverBinding;
119 extern EFI_COMPONENT_NAME_PROTOCOL gUnixBusDriverComponentName;
120
121 //
122 // Unix Bus Driver Global Variables
123 //
124 extern EFI_DRIVER_BINDING_PROTOCOL gUnixBusDriverBinding;
125 extern EFI_COMPONENT_NAME_PROTOCOL gUnixBusDriverComponentName;
126
127 //
128 // Unix Bus Controller Structure
129 //
130 #define UNIX_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('L', 'X', 'B', 'D')
131
132 typedef struct {
133 UINT64 Signature;
134 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
135 } UNIX_BUS_DEVICE;
136
137 //
138 // Unix Child Device Controller Structure
139 //
140 #define UNIX_IO_DEVICE_SIGNATURE SIGNATURE_32 ('L', 'X', 'V', 'D')
141
142 typedef struct {
143 UINT64 Signature;
144 EFI_HANDLE Handle;
145 EFI_UNIX_IO_PROTOCOL UnixIo;
146 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
147
148 //
149 // Private data about the parent
150 //
151 EFI_HANDLE ControllerHandle;
152 EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
153
154 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
155
156 } UNIX_IO_DEVICE;
157
158 #define UNIX_IO_DEVICE_FROM_THIS(a) \
159 CR(a, UNIX_IO_DEVICE, UnixIo, UNIX_IO_DEVICE_SIGNATURE)
160
161 //
162 // This is the largest env variable we can parse
163 //
164 #define MAX_UNIX_ENVIRNMENT_VARIABLE_LENGTH 512
165
166 typedef struct {
167 UINTN Token;
168 EFI_GUID *DevicePathGuid;
169 } UNIX_PCD_ENTRY;
170
171 typedef struct {
172 VENDOR_DEVICE_PATH VendorDevicePath;
173 UINT32 Instance;
174 } UNIX_VENDOR_DEVICE_PATH_NODE;
175
176 EFI_STATUS
177 EFIAPI
178 CpuIoInitialize (
179 IN EFI_HANDLE ImageHandle,
180 IN EFI_SYSTEM_TABLE *SystemTable
181 )
182 /*++
183
184 Routine Description:
185
186 TODO: Add function description
187
188 Arguments:
189
190 ImageHandle - TODO: add argument description
191 SystemTable - TODO: add argument description
192
193 Returns:
194
195 TODO: add return values
196
197 --*/
198 ;
199
200 //
201 // Driver Binding Protocol function prototypes
202 //
203 EFI_STATUS
204 EFIAPI
205 UnixBusDriverBindingSupported (
206 IN EFI_DRIVER_BINDING_PROTOCOL *This,
207 IN EFI_HANDLE Handle,
208 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
209 )
210 /*++
211
212 Routine Description:
213
214 TODO: Add function description
215
216 Arguments:
217
218 This - TODO: add argument description
219 Handle - TODO: add argument description
220 RemainingDevicePath - TODO: add argument description
221
222 Returns:
223
224 TODO: add return values
225
226 --*/
227 ;
228
229 EFI_STATUS
230 EFIAPI
231 UnixBusDriverBindingStart (
232 IN EFI_DRIVER_BINDING_PROTOCOL *This,
233 IN EFI_HANDLE ParentHandle,
234 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
235 )
236 /*++
237
238 Routine Description:
239
240 TODO: Add function description
241
242 Arguments:
243
244 This - TODO: add argument description
245 ParentHandle - TODO: add argument description
246 RemainingDevicePath - TODO: add argument description
247
248 Returns:
249
250 TODO: add return values
251
252 --*/
253 ;
254
255 EFI_STATUS
256 EFIAPI
257 UnixBusDriverBindingStop (
258 IN EFI_DRIVER_BINDING_PROTOCOL *This,
259 IN EFI_HANDLE Handle,
260 IN UINTN NumberOfChildren,
261 IN EFI_HANDLE *ChildHandleBuffer
262 )
263 /*++
264
265 Routine Description:
266
267 TODO: Add function description
268
269 Arguments:
270
271 This - TODO: add argument description
272 Handle - TODO: add argument description
273 NumberOfChildren - TODO: add argument description
274 ChildHandleBuffer - TODO: add argument description
275
276 Returns:
277
278 TODO: add return values
279
280 --*/
281 ;
282
283 //
284 // Unix Bus Driver private worker functions
285 //
286 EFI_DEVICE_PATH_PROTOCOL *
287 UnixBusCreateDevicePath (
288 IN EFI_DEVICE_PATH_PROTOCOL *RootDevicePath,
289 IN EFI_GUID *Guid,
290 IN UINT16 InstanceNumber
291 )
292 /*++
293
294 Routine Description:
295
296 TODO: Add function description
297
298 Arguments:
299
300 RootDevicePath - TODO: add argument description
301 Guid - TODO: add argument description
302 InstanceNumber - TODO: add argument description
303
304 Returns:
305
306 TODO: add return values
307
308 --*/
309 ;
310
311
312 #endif