Check in following modules,
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConSplitterDxe / ConSplitter.h
1 /**@file
2 Private data structures for the Console Splitter driver
3
4 Copyright (c) 2006 - 2007 Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _CON_SPLITTER_H_
16 #define _CON_SPLITTER_H_
17
18 //
19 // Include common header file for this module.
20 //
21 #include "CommonHeader.h"
22
23 //
24 // Private Data Structures
25 //
26 #define CONSOLE_SPLITTER_CONSOLES_ALLOC_UNIT 32
27 #define CONSOLE_SPLITTER_MODES_ALLOC_UNIT 32
28 #define MAX_STD_IN_PASSWORD 80
29
30 typedef struct {
31 UINTN Columns;
32 UINTN Rows;
33 } TEXT_OUT_SPLITTER_QUERY_DATA;
34
35 //
36 // Private data for the EFI_SIMPLE_TEXT_INPUT_PROTOCOL splitter
37 //
38 #define TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('T', 'i', 'S', 'p')
39
40 typedef struct {
41 UINT64 Signature;
42 EFI_HANDLE VirtualHandle;
43
44 EFI_SIMPLE_TEXT_INPUT_PROTOCOL TextIn;
45 UINTN CurrentNumberOfConsoles;
46 EFI_SIMPLE_TEXT_INPUT_PROTOCOL **TextInList;
47 UINTN TextInListCount;
48
49 EFI_SIMPLE_POINTER_PROTOCOL SimplePointer;
50 EFI_SIMPLE_POINTER_MODE SimplePointerMode;
51 UINTN CurrentNumberOfPointers;
52 EFI_SIMPLE_POINTER_PROTOCOL **PointerList;
53 UINTN PointerListCount;
54
55 BOOLEAN PasswordEnabled;
56 CHAR16 Password[MAX_STD_IN_PASSWORD];
57 UINTN PwdIndex;
58 CHAR16 PwdAttempt[MAX_STD_IN_PASSWORD];
59 EFI_EVENT LockEvent;
60
61 BOOLEAN KeyEventSignalState;
62 BOOLEAN InputEventSignalState;
63 } TEXT_IN_SPLITTER_PRIVATE_DATA;
64
65 #define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
66 CR ((a), \
67 TEXT_IN_SPLITTER_PRIVATE_DATA, \
68 TextIn, \
69 TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE \
70 )
71
72 #define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_SIMPLE_POINTER_THIS(a) \
73 CR ((a), \
74 TEXT_IN_SPLITTER_PRIVATE_DATA, \
75 SimplePointer, \
76 TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE \
77 )
78
79 //
80 // Private data for the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL splitter
81 //
82 #define TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('T', 'o', 'S', 'p')
83
84 typedef struct {
85 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
86 EFI_UGA_DRAW_PROTOCOL *UgaDraw;
87 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
88 BOOLEAN TextOutEnabled;
89 } TEXT_OUT_AND_GOP_DATA;
90
91 typedef struct {
92 UINT32 HorizontalResolution;
93 UINT32 VerticalResolution;
94 } TEXT_OUT_GOP_MODE;
95
96 typedef struct {
97 UINT64 Signature;
98 EFI_HANDLE VirtualHandle;
99 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL TextOut;
100 EFI_SIMPLE_TEXT_OUTPUT_MODE TextOutMode;
101
102 EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
103 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GraphicsOutputBlt;
104 TEXT_OUT_GOP_MODE *GraphicsOutputModeBuffer;
105 UINTN CurrentNumberOfGraphicsOutput;
106 BOOLEAN HardwareNeedsStarting;
107
108 EFI_CONSOLE_CONTROL_PROTOCOL ConsoleControl;
109
110 UINTN CurrentNumberOfConsoles;
111 TEXT_OUT_AND_GOP_DATA *TextOutList;
112 UINTN TextOutListCount;
113 TEXT_OUT_SPLITTER_QUERY_DATA *TextOutQueryData;
114 UINTN TextOutQueryDataCount;
115 INT32 *TextOutModeMap;
116
117 EFI_CONSOLE_CONTROL_SCREEN_MODE ConsoleOutputMode;
118
119 UINTN DevNullColumns;
120 UINTN DevNullRows;
121 CHAR16 *DevNullScreen;
122 INT32 *DevNullAttributes;
123
124 } TEXT_OUT_SPLITTER_PRIVATE_DATA;
125
126 #define TEXT_OUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
127 CR ((a), \
128 TEXT_OUT_SPLITTER_PRIVATE_DATA, \
129 TextOut, \
130 TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
131 )
132
133 #define GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
134 CR ((a), \
135 TEXT_OUT_SPLITTER_PRIVATE_DATA, \
136 GraphicsOutput, \
137 TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
138 )
139
140 #define UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
141 CR ((a), \
142 TEXT_OUT_SPLITTER_PRIVATE_DATA, \
143 UgaDraw, \
144 TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
145 )
146
147 #define CONSOLE_CONTROL_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
148 CR ((a), \
149 TEXT_OUT_SPLITTER_PRIVATE_DATA, \
150 ConsoleControl, \
151 TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
152 )
153
154 //
155 // Function Prototypes
156 //
157 EFI_STATUS
158 EFIAPI
159 ConSplitterDriverEntry (
160 IN EFI_HANDLE ImageHandle,
161 IN EFI_SYSTEM_TABLE *SystemTable
162 )
163 ;
164
165 EFI_STATUS
166 ConSplitterTextInConstructor (
167 TEXT_IN_SPLITTER_PRIVATE_DATA *Private
168 )
169 ;
170
171 EFI_STATUS
172 ConSplitterTextOutConstructor (
173 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
174 )
175 ;
176
177 //
178 // Driver Binding Functions
179 //
180 EFI_STATUS
181 EFIAPI
182 ConSplitterConInDriverBindingSupported (
183 IN EFI_DRIVER_BINDING_PROTOCOL *This,
184 IN EFI_HANDLE ControllerHandle,
185 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
186 )
187 ;
188
189 EFI_STATUS
190 EFIAPI
191 ConSplitterSimplePointerDriverBindingSupported (
192 IN EFI_DRIVER_BINDING_PROTOCOL *This,
193 IN EFI_HANDLE ControllerHandle,
194 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
195 )
196 ;
197
198 EFI_STATUS
199 EFIAPI
200 ConSplitterConOutDriverBindingSupported (
201 IN EFI_DRIVER_BINDING_PROTOCOL *This,
202 IN EFI_HANDLE ControllerHandle,
203 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
204 )
205 ;
206
207 EFI_STATUS
208 EFIAPI
209 ConSplitterStdErrDriverBindingSupported (
210 IN EFI_DRIVER_BINDING_PROTOCOL *This,
211 IN EFI_HANDLE ControllerHandle,
212 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
213 )
214 ;
215
216 EFI_STATUS
217 EFIAPI
218 ConSplitterConInDriverBindingStart (
219 IN EFI_DRIVER_BINDING_PROTOCOL *This,
220 IN EFI_HANDLE ControllerHandle,
221 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
222 )
223 ;
224
225 EFI_STATUS
226 EFIAPI
227 ConSplitterSimplePointerDriverBindingStart (
228 IN EFI_DRIVER_BINDING_PROTOCOL *This,
229 IN EFI_HANDLE ControllerHandle,
230 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
231 )
232 ;
233
234 EFI_STATUS
235 EFIAPI
236 ConSplitterConOutDriverBindingStart (
237 IN EFI_DRIVER_BINDING_PROTOCOL *This,
238 IN EFI_HANDLE ControllerHandle,
239 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
240 )
241 ;
242
243 EFI_STATUS
244 EFIAPI
245 ConSplitterStdErrDriverBindingStart (
246 IN EFI_DRIVER_BINDING_PROTOCOL *This,
247 IN EFI_HANDLE ControllerHandle,
248 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
249 )
250 ;
251
252 EFI_STATUS
253 EFIAPI
254 ConSplitterConInDriverBindingStop (
255 IN EFI_DRIVER_BINDING_PROTOCOL *This,
256 IN EFI_HANDLE ControllerHandle,
257 IN UINTN NumberOfChildren,
258 IN EFI_HANDLE *ChildHandleBuffer
259 )
260 ;
261
262 EFI_STATUS
263 EFIAPI
264 ConSplitterSimplePointerDriverBindingStop (
265 IN EFI_DRIVER_BINDING_PROTOCOL *This,
266 IN EFI_HANDLE ControllerHandle,
267 IN UINTN NumberOfChildren,
268 IN EFI_HANDLE *ChildHandleBuffer
269 )
270 ;
271
272 EFI_STATUS
273 EFIAPI
274 ConSplitterConOutDriverBindingStop (
275 IN EFI_DRIVER_BINDING_PROTOCOL *This,
276 IN EFI_HANDLE ControllerHandle,
277 IN UINTN NumberOfChildren,
278 IN EFI_HANDLE *ChildHandleBuffer
279 )
280 ;
281
282 EFI_STATUS
283 EFIAPI
284 ConSplitterStdErrDriverBindingStop (
285 IN EFI_DRIVER_BINDING_PROTOCOL *This,
286 IN EFI_HANDLE ControllerHandle,
287 IN UINTN NumberOfChildren,
288 IN EFI_HANDLE *ChildHandleBuffer
289 )
290 ;
291
292 EFI_STATUS
293 EFIAPI
294 ConSplitterComponentNameGetDriverName (
295 IN EFI_COMPONENT_NAME_PROTOCOL *This,
296 IN CHAR8 *Language,
297 OUT CHAR16 **DriverName
298 );
299
300 EFI_STATUS
301 EFIAPI
302 ConSplitterConInComponentNameGetControllerName (
303 IN EFI_COMPONENT_NAME_PROTOCOL *This,
304 IN EFI_HANDLE ControllerHandle,
305 IN EFI_HANDLE ChildHandle OPTIONAL,
306 IN CHAR8 *Language,
307 OUT CHAR16 **ControllerName
308 );
309
310 EFI_STATUS
311 EFIAPI
312 ConSplitterSimplePointerComponentNameGetControllerName (
313 IN EFI_COMPONENT_NAME_PROTOCOL *This,
314 IN EFI_HANDLE ControllerHandle,
315 IN EFI_HANDLE ChildHandle OPTIONAL,
316 IN CHAR8 *Language,
317 OUT CHAR16 **ControllerName
318 );
319
320 EFI_STATUS
321 EFIAPI
322 ConSplitterConOutComponentNameGetControllerName (
323 IN EFI_COMPONENT_NAME_PROTOCOL *This,
324 IN EFI_HANDLE ControllerHandle,
325 IN EFI_HANDLE ChildHandle OPTIONAL,
326 IN CHAR8 *Language,
327 OUT CHAR16 **ControllerName
328 );
329
330 EFI_STATUS
331 EFIAPI
332 ConSplitterStdErrComponentNameGetControllerName (
333 IN EFI_COMPONENT_NAME_PROTOCOL *This,
334 IN EFI_HANDLE ControllerHandle,
335 IN EFI_HANDLE ChildHandle OPTIONAL,
336 IN CHAR8 *Language,
337 OUT CHAR16 **ControllerName
338 );
339
340 //
341 // TextIn Constructor/Destructor functions
342 //
343 EFI_STATUS
344 ConSplitterTextInAddDevice (
345 IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
346 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn
347 )
348 ;
349
350 EFI_STATUS
351 ConSplitterTextInDeleteDevice (
352 IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
353 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn
354 )
355 ;
356
357 //
358 // SimplePointer Constuctor/Destructor functions
359 //
360 EFI_STATUS
361 ConSplitterSimplePointerAddDevice (
362 IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
363 IN EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer
364 )
365 ;
366
367 EFI_STATUS
368 ConSplitterSimplePointerDeleteDevice (
369 IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
370 IN EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer
371 )
372 ;
373
374 //
375 // TextOut Constuctor/Destructor functions
376 //
377 EFI_STATUS
378 ConSplitterTextOutAddDevice (
379 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
380 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut,
381 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
382 IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
383 )
384 ;
385
386 EFI_STATUS
387 ConSplitterTextOutDeleteDevice (
388 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
389 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut
390 )
391 ;
392
393 //
394 // TextIn I/O Functions
395 //
396 EFI_STATUS
397 EFIAPI
398 ConSplitterTextInReset (
399 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
400 IN BOOLEAN ExtendedVerification
401 )
402 ;
403
404 EFI_STATUS
405 EFIAPI
406 ConSplitterTextInReadKeyStroke (
407 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
408 OUT EFI_INPUT_KEY *Key
409 )
410 ;
411
412 VOID
413 EFIAPI
414 ConSplitterTextInWaitForKey (
415 IN EFI_EVENT Event,
416 IN VOID *Context
417 )
418 ;
419
420 BOOLEAN
421 ConSpliterConssoleControlStdInLocked (
422 VOID
423 )
424 ;
425
426 VOID
427 EFIAPI
428 ConSpliterConsoleControlLockStdInEvent (
429 IN EFI_EVENT Event,
430 IN VOID *Context
431 )
432 ;
433
434 EFI_STATUS
435 EFIAPI
436 ConSpliterConsoleControlLockStdIn (
437 IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
438 IN CHAR16 *Password
439 )
440 ;
441
442 EFI_STATUS
443 EFIAPI
444 ConSplitterTextInPrivateReadKeyStroke (
445 IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
446 OUT EFI_INPUT_KEY *Key
447 )
448 ;
449
450 EFI_STATUS
451 EFIAPI
452 ConSplitterSimplePointerReset (
453 IN EFI_SIMPLE_POINTER_PROTOCOL *This,
454 IN BOOLEAN ExtendedVerification
455 )
456 ;
457
458 EFI_STATUS
459 EFIAPI
460 ConSplitterSimplePointerGetState (
461 IN EFI_SIMPLE_POINTER_PROTOCOL *This,
462 IN OUT EFI_SIMPLE_POINTER_STATE *State
463 )
464 ;
465
466 VOID
467 EFIAPI
468 ConSplitterSimplePointerWaitForInput (
469 IN EFI_EVENT Event,
470 IN VOID *Context
471 )
472 ;
473
474 //
475 // TextOut I/O Functions
476 //
477 VOID
478 ConSplitterSynchronizeModeData (
479 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
480 )
481 ;
482
483 EFI_STATUS
484 EFIAPI
485 ConSplitterTextOutReset (
486 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
487 IN BOOLEAN ExtendedVerification
488 )
489 ;
490
491 EFI_STATUS
492 EFIAPI
493 ConSplitterTextOutOutputString (
494 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
495 IN CHAR16 *WString
496 )
497 ;
498
499 EFI_STATUS
500 EFIAPI
501 ConSplitterTextOutTestString (
502 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
503 IN CHAR16 *WString
504 )
505 ;
506
507 EFI_STATUS
508 EFIAPI
509 ConSplitterTextOutQueryMode (
510 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
511 IN UINTN ModeNumber,
512 OUT UINTN *Columns,
513 OUT UINTN *Rows
514 )
515 ;
516
517 EFI_STATUS
518 EFIAPI
519 ConSplitterTextOutSetMode (
520 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
521 IN UINTN ModeNumber
522 )
523 ;
524
525 EFI_STATUS
526 EFIAPI
527 ConSplitterTextOutSetAttribute (
528 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
529 IN UINTN Attribute
530 )
531 ;
532
533 EFI_STATUS
534 EFIAPI
535 ConSplitterTextOutClearScreen (
536 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
537 )
538 ;
539
540 EFI_STATUS
541 EFIAPI
542 ConSplitterTextOutSetCursorPosition (
543 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
544 IN UINTN Column,
545 IN UINTN Row
546 )
547 ;
548
549 EFI_STATUS
550 EFIAPI
551 ConSplitterTextOutEnableCursor (
552 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
553 IN BOOLEAN Visible
554 )
555 ;
556
557 EFI_STATUS
558 ConSplitterGrowBuffer (
559 IN UINTN SizeOfCount,
560 IN UINTN *Count,
561 IN OUT VOID **Buffer
562 )
563 ;
564
565 EFI_STATUS
566 EFIAPI
567 ConSpliterConsoleControlGetMode (
568 IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
569 OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,
570 OUT BOOLEAN *GopExists,
571 OUT BOOLEAN *StdInLocked
572 )
573 ;
574
575 EFI_STATUS
576 EFIAPI
577 ConSpliterConsoleControlSetMode (
578 IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
579 IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
580 )
581 ;
582
583 EFI_STATUS
584 EFIAPI
585 ConSpliterGraphicsOutputQueryMode (
586 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
587 IN UINT32 ModeNumber,
588 OUT UINTN *SizeOfInfo,
589 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
590 )
591 ;
592
593 EFI_STATUS
594 EFIAPI
595 ConSpliterGraphicsOutputSetMode (
596 IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This,
597 IN UINT32 ModeNumber
598 )
599 ;
600
601 EFI_STATUS
602 EFIAPI
603 ConSpliterGraphicsOutputBlt (
604 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
605 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
606 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
607 IN UINTN SourceX,
608 IN UINTN SourceY,
609 IN UINTN DestinationX,
610 IN UINTN DestinationY,
611 IN UINTN Width,
612 IN UINTN Height,
613 IN UINTN Delta OPTIONAL
614 )
615 ;
616
617 EFI_STATUS
618 DevNullGopSync (
619 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
620 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
621 IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
622 )
623 ;
624
625
626 EFI_STATUS
627 DevNullTextOutOutputString (
628 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
629 IN CHAR16 *WString
630 )
631 ;
632
633 EFI_STATUS
634 DevNullTextOutSetMode (
635 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
636 IN UINTN ModeNumber
637 )
638 ;
639
640 EFI_STATUS
641 DevNullTextOutClearScreen (
642 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
643 )
644 ;
645
646 EFI_STATUS
647 DevNullTextOutSetCursorPosition (
648 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
649 IN UINTN Column,
650 IN UINTN Row
651 )
652 ;
653
654 EFI_STATUS
655 DevNullTextOutEnableCursor (
656 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
657 IN BOOLEAN Visible
658 )
659 ;
660
661 EFI_STATUS
662 DevNullSyncGopStdOut (
663 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
664 )
665 ;
666
667 #endif