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