]>
Commit | Line | Data |
---|---|---|
6ae81428 | 1 | /**@file\r |
420fc8e5 | 2 | \r |
8f2a5f80 HT |
3 | Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials\r | |
62409219 | 5 | are licensed and made available under the terms and conditions of the BSD License\r |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
420fc8e5 | 11 | \r |
12 | Module Name:\r | |
13 | \r | |
14 | WinNtBusDriver.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
62409219 | 18 | This following section documents the envirnoment variables for the Win NT\r |
19 | build. These variables are used to define the (virtual) hardware\r | |
420fc8e5 | 20 | configuration of the NT environment\r |
21 | \r | |
62409219 | 22 | A ! can be used to seperate multiple instances in a variable. Each\r |
23 | instance represents a seperate hardware device.\r | |
420fc8e5 | 24 | \r |
25 | EFI_WIN_NT_PHYSICAL_DISKS - maps to drives on your system\r | |
26 | EFI_WIN_NT_VIRTUAL_DISKS - maps to a device emulated by a file\r | |
27 | EFI_WIN_NT_FILE_SYSTEM - mouts a directory as a file system\r | |
28 | EFI_WIN_NT_CONSOLE - make a logical comand line window (only one!)\r | |
62409219 | 29 | EFI_WIN_NT_GOP - Builds GOP Windows of Width and Height\r |
420fc8e5 | 30 | EFI_WIN_NT_SERIAL_PORT - maps physical serial ports\r |
31 | EFI_WIN_NT_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 | |
62409219 | 40 | NT 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 | |
420fc8e5 | 43 | used to seperate multiple devices in a variable.\r |
44 | \r | |
62409219 | 45 | EFI_WIN_NT_VIRTUAL_DISKS =\r |
420fc8e5 | 46 | <F | R><O | W>;<block count>;<block size>[!...]\r |
47 | \r | |
48 | EFI_WIN_NT_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 | |
62409219 | 52 | media device.\r |
53 | \r | |
420fc8e5 | 54 | Thus a 20 MB emulated hard drive would look like:\r |
55 | EFI_WIN_NT_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_WIN_NT_VIRTUAL_DISKS=RW;1440;1024\r | |
59 | \r | |
60 | Physical Disks: These devices use NT to open a real device in your system\r | |
61 | \r | |
62 | Thus a 120 MB floppy would look like:\r | |
63 | EFI_WIN_NT_PHYSICAL_DISKS=B:RW;245760;512\r | |
64 | \r | |
65 | Thus a standard CD-ROM floppy would look like:\r | |
66 | EFI_WIN_NT_PHYSICAL_DISKS=Z:RO;307200;2048\r | |
67 | \r | |
62409219 | 68 | EFI_WIN_NT_FILE_SYSTEM =\r |
420fc8e5 | 69 | <directory path>[!...]\r |
70 | \r | |
71 | Mounting the two directories C:\FOO and C:\BAR would look like:\r | |
72 | EFI_WIN_NT_FILE_SYSTEM=c:\foo!c:\bar\r | |
73 | \r | |
62409219 | 74 | EFI_WIN_NT_CONSOLE =\r |
420fc8e5 | 75 | <window title>\r |
76 | \r | |
77 | Declaring a text console window with the title "My EFI Console" woild look like:\r | |
78 | EFI_WIN_NT_CONSOLE=My EFI Console\r | |
79 | \r | |
62409219 | 80 | EFI_WIN_NT_GOP =\r |
420fc8e5 | 81 | <width> <height>[!...]\r |
82 | \r | |
62409219 | 83 | Declaring a two GOP windows with resolutions of 800x600 and 1024x768 would look like:\r |
84 | Example : EFI_WIN_NT_GOP=800 600!1024 768\r | |
420fc8e5 | 85 | \r |
62409219 | 86 | EFI_WIN_NT_SERIAL_PORT =\r |
420fc8e5 | 87 | <port name>[!...]\r |
88 | \r | |
89 | Declaring two serial ports on COM1 and COM2 would look like:\r | |
90 | Example : EFI_WIN_NT_SERIAL_PORT=COM1!COM2\r | |
91 | \r | |
92 | EFI_WIN_NT_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_WIN_NT_PASS_THROUGH=E000000;0;1;0\r | |
98 | \r | |
99 | ---*/\r | |
100 | \r | |
101 | #ifndef __NT_BUS_DRIVER_H__\r | |
102 | #define __NT_BUS_DRIVER_H__\r | |
103 | \r | |
104 | \r | |
105 | //\r | |
106 | // The package level header files this module uses\r | |
107 | //\r | |
108 | #include <Uefi.h>\r | |
109 | #include <WinNtDxe.h>\r | |
110 | //\r | |
111 | // The protocols, PPI and GUID defintions for this module\r | |
112 | //\r | |
113 | #include <Protocol/WinNtIo.h>\r | |
114 | #include <Protocol/ComponentName.h>\r | |
115 | #include <Protocol/WinNtThunk.h>\r | |
116 | #include <Protocol/DriverBinding.h>\r | |
117 | #include <Protocol/DevicePath.h>\r | |
118 | //\r | |
119 | // The Library classes this module consumes\r | |
120 | //\r | |
121 | #include <Library/DebugLib.h>\r | |
122 | #include <Library/BaseLib.h>\r | |
123 | #include <Library/UefiDriverEntryPoint.h>\r | |
124 | #include <Library/UefiLib.h>\r | |
125 | #include <Library/PcdLib.h>\r | |
126 | #include <Library/BaseMemoryLib.h>\r | |
127 | #include <Library/UefiBootServicesTableLib.h>\r | |
128 | #include <Library/DevicePathLib.h>\r | |
129 | #include <Library/MemoryAllocationLib.h>\r | |
130 | \r | |
131 | //\r | |
132 | // WinNt Bus Driver Global Variables\r | |
133 | //\r | |
e1107a76 | 134 | extern EFI_DRIVER_BINDING_PROTOCOL gWinNtBusDriverBinding;\r |
135 | extern EFI_COMPONENT_NAME_PROTOCOL gWinNtBusDriverComponentName;\r | |
136 | extern EFI_COMPONENT_NAME2_PROTOCOL gWinNtBusDriverComponentName2;\r | |
420fc8e5 | 137 | \r |
138 | //\r | |
139 | // WinNt Bus Controller Structure\r | |
140 | //\r | |
99e1dd89 | 141 | #define WIN_NT_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('N', 'T', 'B', 'D')\r |
420fc8e5 | 142 | \r |
143 | typedef struct {\r | |
144 | UINT64 Signature;\r | |
145 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
146 | } WIN_NT_BUS_DEVICE;\r | |
147 | \r | |
148 | //\r | |
149 | // WinNt Child Device Controller Structure\r | |
150 | //\r | |
99e1dd89 | 151 | #define WIN_NT_IO_DEVICE_SIGNATURE SIGNATURE_32 ('N', 'T', 'V', 'D')\r |
420fc8e5 | 152 | \r |
153 | typedef struct {\r | |
154 | UINT64 Signature;\r | |
155 | EFI_HANDLE Handle;\r | |
156 | EFI_WIN_NT_IO_PROTOCOL WinNtIo;\r | |
157 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
158 | \r | |
159 | //\r | |
160 | // Private data about the parent\r | |
161 | //\r | |
162 | EFI_HANDLE ControllerHandle;\r | |
163 | EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r | |
164 | \r | |
165 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
166 | \r | |
167 | } WIN_NT_IO_DEVICE;\r | |
168 | \r | |
169 | #define WIN_NT_IO_DEVICE_FROM_THIS(a) \\r | |
170 | CR(a, WIN_NT_IO_DEVICE, WinNtIo, WIN_NT_IO_DEVICE_SIGNATURE)\r | |
171 | \r | |
172 | //\r | |
173 | // This is the largest env variable we can parse\r | |
174 | //\r | |
175 | #define MAX_NT_ENVIRNMENT_VARIABLE_LENGTH 512\r | |
176 | \r | |
177 | typedef struct {\r | |
178 | UINTN Token;\r | |
179 | EFI_GUID *DevicePathGuid;\r | |
180 | } NT_PCD_ENTRY;\r | |
181 | \r | |
182 | typedef struct {\r | |
183 | VENDOR_DEVICE_PATH VendorDevicePath;\r | |
184 | UINT32 Instance;\r | |
185 | } WIN_NT_VENDOR_DEVICE_PATH_NODE;\r | |
186 | \r | |
187 | EFI_STATUS\r | |
188 | EFIAPI\r | |
189 | CpuIoInitialize (\r | |
190 | IN EFI_HANDLE ImageHandle,\r | |
191 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
192 | )\r | |
193 | /*++\r | |
194 | \r | |
195 | Routine Description:\r | |
196 | \r | |
197 | TODO: Add function description\r | |
198 | \r | |
199 | Arguments:\r | |
200 | \r | |
201 | ImageHandle - TODO: add argument description\r | |
202 | SystemTable - TODO: add argument description\r | |
203 | \r | |
204 | Returns:\r | |
205 | \r | |
206 | TODO: add return values\r | |
207 | \r | |
6ae81428 | 208 | **/\r |
420fc8e5 | 209 | ;\r |
210 | \r | |
211 | //\r | |
212 | // Driver Binding Protocol function prototypes\r | |
213 | //\r | |
214 | EFI_STATUS\r | |
215 | EFIAPI\r | |
216 | WinNtBusDriverBindingSupported (\r | |
217 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
218 | IN EFI_HANDLE Handle,\r | |
219 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
220 | )\r | |
221 | /*++\r | |
222 | \r | |
223 | Routine Description:\r | |
224 | \r | |
225 | TODO: Add function description\r | |
226 | \r | |
227 | Arguments:\r | |
228 | \r | |
229 | This - TODO: add argument description\r | |
230 | Handle - TODO: add argument description\r | |
231 | RemainingDevicePath - TODO: add argument description\r | |
232 | \r | |
233 | Returns:\r | |
234 | \r | |
235 | TODO: add return values\r | |
236 | \r | |
237 | --*/\r | |
238 | ;\r | |
239 | \r | |
240 | EFI_STATUS\r | |
241 | EFIAPI\r | |
242 | WinNtBusDriverBindingStart (\r | |
243 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
244 | IN EFI_HANDLE ParentHandle,\r | |
245 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
246 | )\r | |
247 | /*++\r | |
248 | \r | |
249 | Routine Description:\r | |
250 | \r | |
251 | TODO: Add function description\r | |
252 | \r | |
253 | Arguments:\r | |
254 | \r | |
255 | This - TODO: add argument description\r | |
256 | ParentHandle - TODO: add argument description\r | |
257 | RemainingDevicePath - TODO: add argument description\r | |
258 | \r | |
259 | Returns:\r | |
260 | \r | |
261 | TODO: add return values\r | |
262 | \r | |
263 | --*/\r | |
264 | ;\r | |
265 | \r | |
266 | EFI_STATUS\r | |
267 | EFIAPI\r | |
268 | WinNtBusDriverBindingStop (\r | |
269 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
270 | IN EFI_HANDLE Handle,\r | |
271 | IN UINTN NumberOfChildren,\r | |
272 | IN EFI_HANDLE *ChildHandleBuffer\r | |
273 | )\r | |
274 | /*++\r | |
275 | \r | |
276 | Routine Description:\r | |
277 | \r | |
278 | TODO: Add function description\r | |
279 | \r | |
280 | Arguments:\r | |
281 | \r | |
282 | This - TODO: add argument description\r | |
283 | Handle - TODO: add argument description\r | |
284 | NumberOfChildren - TODO: add argument description\r | |
285 | ChildHandleBuffer - TODO: add argument description\r | |
286 | \r | |
287 | Returns:\r | |
288 | \r | |
289 | TODO: add return values\r | |
290 | \r | |
291 | --*/\r | |
292 | ;\r | |
293 | \r | |
294 | //\r | |
295 | // WinNt Bus Driver private worker functions\r | |
296 | //\r | |
297 | EFI_DEVICE_PATH_PROTOCOL *\r | |
298 | WinNtBusCreateDevicePath (\r | |
299 | IN EFI_DEVICE_PATH_PROTOCOL *RootDevicePath,\r | |
300 | IN EFI_GUID *Guid,\r | |
301 | IN UINT16 InstanceNumber\r | |
302 | )\r | |
303 | /*++\r | |
304 | \r | |
305 | Routine Description:\r | |
306 | \r | |
307 | TODO: Add function description\r | |
308 | \r | |
309 | Arguments:\r | |
310 | \r | |
311 | RootDevicePath - TODO: add argument description\r | |
312 | Guid - TODO: add argument description\r | |
313 | InstanceNumber - TODO: add argument description\r | |
314 | \r | |
315 | Returns:\r | |
316 | \r | |
317 | TODO: add return values\r | |
318 | \r | |
319 | --*/\r | |
320 | ;\r | |
321 | \r | |
322 | \r | |
323 | #endif\r |