]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/UnixConsoleDxe/Console.h
Port EdkUnixPkg to UnixPkg. The changes are listed as follows:
[mirror_edk2.git] / UnixPkg / UnixConsoleDxe / Console.h
1 /*++
2
3 Copyright (c) 2004 - 2008, Intel Corporation
4 All rights reserved. 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 EFI_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 STATIC
103 EFI_STATUS
104 EFIAPI
105 UnixSimpleTextOutReset (
106 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
107 IN BOOLEAN ExtendedVerification
108 )
109 /*++
110
111 Routine Description:
112
113 TODO: Add function description
114
115 Arguments:
116
117 This - TODO: add argument description
118 ExtendedVerification - TODO: add argument description
119
120 Returns:
121
122 TODO: add return values
123
124 --*/
125 ;
126
127 STATIC
128 EFI_STATUS
129 EFIAPI
130 UnixSimpleTextOutOutputString (
131 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
132 IN CHAR16 *String
133 )
134 /*++
135
136 Routine Description:
137
138 TODO: Add function description
139
140 Arguments:
141
142 This - TODO: add argument description
143 String - TODO: add argument description
144
145 Returns:
146
147 TODO: add return values
148
149 --*/
150 ;
151
152 STATIC
153 EFI_STATUS
154 EFIAPI
155 UnixSimpleTextOutTestString (
156 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
157 IN CHAR16 *String
158 )
159 /*++
160
161 Routine Description:
162
163 TODO: Add function description
164
165 Arguments:
166
167 This - TODO: add argument description
168 String - TODO: add argument description
169
170 Returns:
171
172 TODO: add return values
173
174 --*/
175 ;
176
177 STATIC
178 EFI_STATUS
179 EFIAPI
180 UnixSimpleTextOutQueryMode (
181 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
182 IN UINTN ModeNumber,
183 OUT UINTN *Columns,
184 OUT UINTN *Rows
185 )
186 /*++
187
188 Routine Description:
189
190 TODO: Add function description
191
192 Arguments:
193
194 This - TODO: add argument description
195 ModeNumber - TODO: add argument description
196 Columns - TODO: add argument description
197 Rows - TODO: add argument description
198
199 Returns:
200
201 TODO: add return values
202
203 --*/
204 ;
205
206 EFI_STATUS
207 EFIAPI
208 UnixSimpleTextOutSetMode (
209 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
210 IN UINTN ModeNumber
211 )
212 /*++
213
214 Routine Description:
215
216 TODO: Add function description
217
218 Arguments:
219
220 This - TODO: add argument description
221 ModeNumber - TODO: add argument description
222
223 Returns:
224
225 TODO: add return values
226
227 --*/
228 ;
229
230 STATIC
231 EFI_STATUS
232 EFIAPI
233 UnixSimpleTextOutSetAttribute (
234 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
235 IN UINTN Attribute
236 )
237 /*++
238
239 Routine Description:
240
241 TODO: Add function description
242
243 Arguments:
244
245 This - TODO: add argument description
246 Attribute - TODO: add argument description
247
248 Returns:
249
250 TODO: add return values
251
252 --*/
253 ;
254
255 STATIC
256 EFI_STATUS
257 EFIAPI
258 UnixSimpleTextOutClearScreen (
259 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
260 )
261 /*++
262
263 Routine Description:
264
265 TODO: Add function description
266
267 Arguments:
268
269 This - TODO: add argument description
270
271 Returns:
272
273 TODO: add return values
274
275 --*/
276 ;
277
278 STATIC
279 EFI_STATUS
280 EFIAPI
281 UnixSimpleTextOutSetCursorPosition (
282 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
283 IN UINTN Column,
284 IN UINTN Row
285 )
286 /*++
287
288 Routine Description:
289
290 TODO: Add function description
291
292 Arguments:
293
294 This - TODO: add argument description
295 Column - TODO: add argument description
296 Row - TODO: add argument description
297
298 Returns:
299
300 TODO: add return values
301
302 --*/
303 ;
304
305 STATIC
306 EFI_STATUS
307 EFIAPI
308 UnixSimpleTextOutEnableCursor (
309 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
310 IN BOOLEAN Enable
311 )
312 /*++
313
314 Routine Description:
315
316 TODO: Add function description
317
318 Arguments:
319
320 This - TODO: add argument description
321 Enable - TODO: add argument description
322
323 Returns:
324
325 TODO: add return values
326
327 --*/
328 ;
329
330 #endif
331 //
332 // Simple Text Out constructor and destructor.
333 //
334 EFI_STATUS
335 UnixSimpleTextOutOpenWindow (
336 IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private
337 )
338 /*++
339
340 Routine Description:
341
342 TODO: Add function description
343
344 Arguments:
345
346 Private - TODO: add argument description
347
348 Returns:
349
350 TODO: add return values
351
352 --*/
353 ;
354
355 EFI_STATUS
356 UnixSimpleTextOutCloseWindow (
357 IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console
358 )
359 /*++
360
361 Routine Description:
362
363 TODO: Add function description
364
365 Arguments:
366
367 Console - TODO: add argument description
368
369 Returns:
370
371 TODO: add return values
372
373 --*/
374 ;
375
376 #if 0
377 //
378 // Simple Text In protocol member functions.
379 //
380 STATIC
381 EFI_STATUS
382 EFIAPI
383 UnixSimpleTextInReset (
384 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
385 IN BOOLEAN ExtendedVerification
386 )
387 /*++
388
389 Routine Description:
390
391 TODO: Add function description
392
393 Arguments:
394
395 This - TODO: add argument description
396 ExtendedVerification - TODO: add argument description
397
398 Returns:
399
400 TODO: add return values
401
402 --*/
403 ;
404
405 STATIC
406 EFI_STATUS
407 EFIAPI
408 UnixSimpleTextInReadKeyStroke (
409 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
410 OUT EFI_INPUT_KEY *Key
411 )
412 /*++
413
414 Routine Description:
415
416 TODO: Add function description
417
418 Arguments:
419
420 This - TODO: add argument description
421 Key - TODO: add argument description
422
423 Returns:
424
425 TODO: add return values
426
427 --*/
428 ;
429
430 STATIC
431 VOID
432 EFIAPI
433 UnixSimpleTextInWaitForKey (
434 IN EFI_EVENT Event,
435 IN VOID *Context
436 )
437 /*++
438
439 Routine Description:
440
441 TODO: Add function description
442
443 Arguments:
444
445 Event - TODO: add argument description
446 Context - TODO: add argument description
447
448 Returns:
449
450 TODO: add return values
451
452 --*/
453 ;
454
455 #endif
456 //
457 // Simple Text In constructor
458 //
459 EFI_STATUS
460 UnixSimpleTextInAttachToWindow (
461 IN UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private
462 )
463 /*++
464
465 Routine Description:
466
467 TODO: Add function description
468
469 Arguments:
470
471 Private - TODO: add argument description
472
473 Returns:
474
475 TODO: add return values
476
477 --*/
478 ;
479
480 //
481 // Main Entry Point
482 //
483 EFI_STATUS
484 EFIAPI
485 InitializeUnixConsole (
486 IN EFI_HANDLE ImageHandle,
487 IN EFI_SYSTEM_TABLE *SystemTable
488 )
489 /*++
490
491 Routine Description:
492
493 TODO: Add function description
494
495 Arguments:
496
497 ImageHandle - TODO: add argument description
498 SystemTable - TODO: add argument description
499
500 Returns:
501
502 TODO: add return values
503
504 --*/
505 ;
506
507 EFI_STATUS
508 AppendDevicePathInstanceToVar (
509 IN CHAR16 *VariableName,
510 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
511 )
512 /*++
513
514 Routine Description:
515
516 TODO: Add function description
517
518 Arguments:
519
520 VariableName - TODO: add argument description
521 DevicePathInstance - TODO: add argument description
522
523 Returns:
524
525 TODO: add return values
526
527 --*/
528 ;
529
530 #endif