]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/UnixConsoleDxe/Console.h
Update the copyright notice format
[mirror_edk2.git] / UnixPkg / UnixConsoleDxe / Console.h
1 /*++
2
3 Copyright (c) 2004 - 2008, 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 Console.h
15
16 Abstract:
17
18 Console based on Posix APIs.
19
20 This file attaches a SimpleTextIn protocol to a previously open window.
21
22 The constructor for this protocol depends on an open window. Currently
23 the SimpleTextOut protocol creates a window when it's constructor is called.
24 Thus this code must run after the constructor for the SimpleTextOut
25 protocol
26
27 --*/
28
29 #ifndef _CONSOLE_H_
30 #define _CONSOLE_H_
31
32 #include "PiDxe.h"
33 #include "UnixDxe.h"
34 #include <Protocol/UnixIo.h>
35 #include <Protocol/SimpleTextIn.h>
36 #include <Protocol/SimpleTextOut.h>
37
38 #include <Library/DebugLib.h>
39 #include <Library/BaseLib.h>
40 #include <Library/UefiDriverEntryPoint.h>
41 #include <Library/UefiLib.h>
42 #include <Library/BaseMemoryLib.h>
43 #include <Library/MemoryAllocationLib.h>
44 #include <Library/UefiBootServicesTableLib.h>
45
46 extern EFI_DRIVER_BINDING_PROTOCOL gUnixConsoleDriverBinding;
47 extern EFI_COMPONENT_NAME_PROTOCOL gUnixConsoleComponentName;
48
49 #define UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE \
50 SIGNATURE_32('U','X','s','c')
51
52 typedef struct {
53 UINT64 Signature;
54
55 EFI_HANDLE Handle;
56
57 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut;
58 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutMode;
59
60 EFI_UNIX_IO_PROTOCOL *UnixIo;
61 EFI_UNIX_THUNK_PROTOCOL *UnixThunk;
62
63 //
64 // SimpleTextOut Private Data including Posix types.
65 //
66 // HANDLE NtOutHandle;
67 // HANDLE NtInHandle;
68
69 //COORD MaxScreenSize;
70 //COORD Position;
71 //WORD Attribute;
72 BOOLEAN CursorEnable;
73
74 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;
75
76 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
77
78 } UNIX_SIMPLE_TEXT_PRIVATE_DATA;
79
80 #define UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS(a) \
81 CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextOut, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
82
83 #define UNIX_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS(a) \
84 CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextIn, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
85
86 //
87 // Console Globale Variables
88 //
89 extern EFI_DRIVER_BINDING_PROTOCOL gUnixConsoleDriverBinding;
90 extern EFI_COMPONENT_NAME_PROTOCOL gUnixConsoleComponentName;
91
92 typedef struct {
93 UINTN ColumnsX;
94 UINTN RowsY;
95 } UNIX_SIMPLE_TEXT_OUT_MODE;
96
97 #if 0
98 //
99 // Simple Text Out protocol member functions
100 //
101
102 EFI_STATUS
103 EFIAPI
104 UnixSimpleTextOutReset (
105 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
106 IN BOOLEAN ExtendedVerification
107 )
108 /*++
109
110 Routine Description:
111
112 TODO: Add function description
113
114 Arguments:
115
116 This - TODO: add argument description
117 ExtendedVerification - TODO: add argument description
118
119 Returns:
120
121 TODO: add return values
122
123 --*/
124 ;
125
126 EFI_STATUS
127 EFIAPI
128 UnixSimpleTextOutOutputString (
129 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
130 IN CHAR16 *String
131 )
132 /*++
133
134 Routine Description:
135
136 TODO: Add function description
137
138 Arguments:
139
140 This - TODO: add argument description
141 String - TODO: add argument description
142
143 Returns:
144
145 TODO: add return values
146
147 --*/
148 ;
149
150 EFI_STATUS
151 EFIAPI
152 UnixSimpleTextOutTestString (
153 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
154 IN CHAR16 *String
155 )
156 /*++
157
158 Routine Description:
159
160 TODO: Add function description
161
162 Arguments:
163
164 This - TODO: add argument description
165 String - TODO: add argument description
166
167 Returns:
168
169 TODO: add return values
170
171 --*/
172 ;
173
174 EFI_STATUS
175 EFIAPI
176 UnixSimpleTextOutQueryMode (
177 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
178 IN UINTN ModeNumber,
179 OUT UINTN *Columns,
180 OUT UINTN *Rows
181 )
182 /*++
183
184 Routine Description:
185
186 TODO: Add function description
187
188 Arguments:
189
190 This - TODO: add argument description
191 ModeNumber - TODO: add argument description
192 Columns - TODO: add argument description
193 Rows - TODO: add argument description
194
195 Returns:
196
197 TODO: add return values
198
199 --*/
200 ;
201
202 EFI_STATUS
203 EFIAPI
204 UnixSimpleTextOutSetMode (
205 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
206 IN UINTN ModeNumber
207 )
208 /*++
209
210 Routine Description:
211
212 TODO: Add function description
213
214 Arguments:
215
216 This - TODO: add argument description
217 ModeNumber - TODO: add argument description
218
219 Returns:
220
221 TODO: add return values
222
223 --*/
224 ;
225
226 EFI_STATUS
227 EFIAPI
228 UnixSimpleTextOutSetAttribute (
229 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
230 IN UINTN Attribute
231 )
232 /*++
233
234 Routine Description:
235
236 TODO: Add function description
237
238 Arguments:
239
240 This - TODO: add argument description
241 Attribute - TODO: add argument description
242
243 Returns:
244
245 TODO: add return values
246
247 --*/
248 ;
249
250 EFI_STATUS
251 EFIAPI
252 UnixSimpleTextOutClearScreen (
253 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
254 )
255 /*++
256
257 Routine Description:
258
259 TODO: Add function description
260
261 Arguments:
262
263 This - TODO: add argument description
264
265 Returns:
266
267 TODO: add return values
268
269 --*/
270 ;
271
272 EFI_STATUS
273 EFIAPI
274 UnixSimpleTextOutSetCursorPosition (
275 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
276 IN UINTN Column,
277 IN UINTN Row
278 )
279 /*++
280
281 Routine Description:
282
283 TODO: Add function description
284
285 Arguments:
286
287 This - TODO: add argument description
288 Column - TODO: add argument description
289 Row - TODO: add argument description
290
291 Returns:
292
293 TODO: add return values
294
295 --*/
296 ;
297
298 EFI_STATUS
299 EFIAPI
300 UnixSimpleTextOutEnableCursor (
301 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
302 IN BOOLEAN Enable
303 )
304 /*++
305
306 Routine Description:
307
308 TODO: Add function description
309
310 Arguments:
311
312 This - TODO: add argument description
313 Enable - TODO: add argument description
314
315 Returns:
316
317 TODO: add return values
318
319 --*/
320 ;
321
322 #endif
323 //
324 // Simple Text Out constructor and destructor.
325 //
326 EFI_STATUS
327 UnixSimpleTextOutOpenWindow (
328 IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private
329 )
330 /*++
331
332 Routine Description:
333
334 TODO: Add function description
335
336 Arguments:
337
338 Private - TODO: add argument description
339
340 Returns:
341
342 TODO: add return values
343
344 --*/
345 ;
346
347 EFI_STATUS
348 UnixSimpleTextOutCloseWindow (
349 IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console
350 )
351 /*++
352
353 Routine Description:
354
355 TODO: Add function description
356
357 Arguments:
358
359 Console - TODO: add argument description
360
361 Returns:
362
363 TODO: add return values
364
365 --*/
366 ;
367
368 #if 0
369 //
370 // Simple Text In protocol member functions.
371 //
372 EFI_STATUS
373 EFIAPI
374 UnixSimpleTextInReset (
375 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
376 IN BOOLEAN ExtendedVerification
377 )
378 /*++
379
380 Routine Description:
381
382 TODO: Add function description
383
384 Arguments:
385
386 This - TODO: add argument description
387 ExtendedVerification - TODO: add argument description
388
389 Returns:
390
391 TODO: add return values
392
393 --*/
394 ;
395
396 EFI_STATUS
397 EFIAPI
398 UnixSimpleTextInReadKeyStroke (
399 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
400 OUT EFI_INPUT_KEY *Key
401 )
402 /*++
403
404 Routine Description:
405
406 TODO: Add function description
407
408 Arguments:
409
410 This - TODO: add argument description
411 Key - TODO: add argument description
412
413 Returns:
414
415 TODO: add return values
416
417 --*/
418 ;
419
420 VOID
421 EFIAPI
422 UnixSimpleTextInWaitForKey (
423 IN EFI_EVENT Event,
424 IN VOID *Context
425 )
426 /*++
427
428 Routine Description:
429
430 TODO: Add function description
431
432 Arguments:
433
434 Event - TODO: add argument description
435 Context - TODO: add argument description
436
437 Returns:
438
439 TODO: add return values
440
441 --*/
442 ;
443
444 #endif
445 //
446 // Simple Text In constructor
447 //
448 EFI_STATUS
449 UnixSimpleTextInAttachToWindow (
450 IN UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private
451 )
452 /*++
453
454 Routine Description:
455
456 TODO: Add function description
457
458 Arguments:
459
460 Private - TODO: add argument description
461
462 Returns:
463
464 TODO: add return values
465
466 --*/
467 ;
468
469 //
470 // Main Entry Point
471 //
472 EFI_STATUS
473 EFIAPI
474 InitializeUnixConsole (
475 IN EFI_HANDLE ImageHandle,
476 IN EFI_SYSTEM_TABLE *SystemTable
477 )
478 /*++
479
480 Routine Description:
481
482 TODO: Add function description
483
484 Arguments:
485
486 ImageHandle - TODO: add argument description
487 SystemTable - TODO: add argument description
488
489 Returns:
490
491 TODO: add return values
492
493 --*/
494 ;
495
496 EFI_STATUS
497 AppendDevicePathInstanceToVar (
498 IN CHAR16 *VariableName,
499 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
500 )
501 /*++
502
503 Routine Description:
504
505 TODO: Add function description
506
507 Arguments:
508
509 VariableName - TODO: add argument description
510 DevicePathInstance - TODO: add argument description
511
512 Returns:
513
514 TODO: add return values
515
516 --*/
517 ;
518
519 #endif