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