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