1 /** @file
2   Private data structures for the Console Splitter driver
3 
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 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 #include <Uefi.h>
19 #include <PiDxe.h>
20 
21 #include <Protocol/DevicePath.h>
22 #include <Protocol/ComponentName.h>
23 #include <Protocol/DriverBinding.h>
24 #include <Protocol/SimplePointer.h>
25 #include <Protocol/AbsolutePointer.h>
26 #include <Protocol/SimpleTextOut.h>
27 #include <Protocol/SimpleTextIn.h>
28 #include <Protocol/SimpleTextInEx.h>
29 #include <Protocol/GraphicsOutput.h>
30 #include <Protocol/UgaDraw.h>
31 
32 #include <Guid/ConsoleInDevice.h>
33 #include <Guid/StandardErrorDevice.h>
34 #include <Guid/ConsoleOutDevice.h>
35 #include <Guid/ConnectConInEvent.h>
36 
37 #include <Library/PcdLib.h>
38 #include <Library/DebugLib.h>
39 #include <Library/UefiDriverEntryPoint.h>
40 #include <Library/UefiLib.h>
41 #include <Library/BaseLib.h>
42 #include <Library/BaseMemoryLib.h>
43 #include <Library/MemoryAllocationLib.h>
44 #include <Library/UefiBootServicesTableLib.h>
45 #include <Library/UefiRuntimeServicesTableLib.h>
46 
47 //
48 // Driver Binding Externs
49 //
50 extern EFI_DRIVER_BINDING_PROTOCOL  gConSplitterConInDriverBinding;
51 extern EFI_COMPONENT_NAME_PROTOCOL  gConSplitterConInComponentName;
52 extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConInComponentName2;
53 extern EFI_DRIVER_BINDING_PROTOCOL  gConSplitterSimplePointerDriverBinding;
54 extern EFI_COMPONENT_NAME_PROTOCOL  gConSplitterSimplePointerComponentName;
55 extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterSimplePointerComponentName2;
56 extern EFI_DRIVER_BINDING_PROTOCOL  gConSplitterAbsolutePointerDriverBinding;
57 extern EFI_COMPONENT_NAME_PROTOCOL  gConSplitterAbsolutePointerComponentName;
58 extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterAbsolutePointerComponentName2;
59 extern EFI_DRIVER_BINDING_PROTOCOL  gConSplitterConOutDriverBinding;
60 extern EFI_COMPONENT_NAME_PROTOCOL  gConSplitterConOutComponentName;
61 extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConOutComponentName2;
62 extern EFI_DRIVER_BINDING_PROTOCOL  gConSplitterStdErrDriverBinding;
63 extern EFI_COMPONENT_NAME_PROTOCOL  gConSplitterStdErrComponentName;
64 extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterStdErrComponentName2;
65 
66 
67 //
68 // These definitions were in the old Hii protocol, but are not in the new UEFI
69 // version. So they are defined locally.
70 //
71 #define UNICODE_NARROW_CHAR   0xFFF0
72 #define UNICODE_WIDE_CHAR     0xFFF1
73 
74 
75 //
76 // Private Data Structures
77 //
78 #define CONSOLE_SPLITTER_ALLOC_UNIT  32
79 
80 
81 typedef struct {
82   UINTN   Column;
83   UINTN   Row;
84 } CONSOLE_OUT_MODE;
85 
86 typedef struct {
87   UINTN   Columns;
88   UINTN   Rows;
89 } TEXT_OUT_SPLITTER_QUERY_DATA;
90 
91 
92 #define TEXT_IN_EX_SPLITTER_NOTIFY_SIGNATURE    SIGNATURE_32 ('T', 'i', 'S', 'n')
93 
94 //
95 // Private data for Text In Ex Splitter Notify
96 //
97 typedef struct _TEXT_IN_EX_SPLITTER_NOTIFY {
98   UINTN                                 Signature;
99   VOID                                  **NotifyHandleList;
100   EFI_KEY_DATA                          KeyData;
101   EFI_KEY_NOTIFY_FUNCTION               KeyNotificationFn;
102   LIST_ENTRY                            NotifyEntry;
103 } TEXT_IN_EX_SPLITTER_NOTIFY;
104 
105 #define TEXT_IN_EX_SPLITTER_NOTIFY_FROM_THIS(a)  \
106   CR ((a),                                       \
107       TEXT_IN_EX_SPLITTER_NOTIFY,                \
108       NotifyEntry,                               \
109       TEXT_IN_EX_SPLITTER_NOTIFY_SIGNATURE       \
110       )
111 
112 #define TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('T', 'i', 'S', 'p')
113 
114 //
115 // Private data for the Console In splitter
116 //
117 typedef struct {
118   UINT64                             Signature;
119   EFI_HANDLE                         VirtualHandle;
120 
121   EFI_SIMPLE_TEXT_INPUT_PROTOCOL     TextIn;
122   UINTN                              CurrentNumberOfConsoles;
123   EFI_SIMPLE_TEXT_INPUT_PROTOCOL     **TextInList;
124   UINTN                              TextInListCount;
125 
126   EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  TextInEx;
127   UINTN                              CurrentNumberOfExConsoles;
128   EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  **TextInExList;
129   UINTN                              TextInExListCount;
130   LIST_ENTRY                         NotifyList;
131 
132 
133   EFI_SIMPLE_POINTER_PROTOCOL        SimplePointer;
134   EFI_SIMPLE_POINTER_MODE            SimplePointerMode;
135   UINTN                              CurrentNumberOfPointers;
136   EFI_SIMPLE_POINTER_PROTOCOL        **PointerList;
137   UINTN                              PointerListCount;
138 
139   EFI_ABSOLUTE_POINTER_PROTOCOL      AbsolutePointer;
140   EFI_ABSOLUTE_POINTER_MODE          AbsolutePointerMode;
141   UINTN                              CurrentNumberOfAbsolutePointers;
142   EFI_ABSOLUTE_POINTER_PROTOCOL      **AbsolutePointerList;
143   UINTN                              AbsolutePointerListCount;
144   BOOLEAN                            AbsoluteInputEventSignalState;
145 
146   BOOLEAN                            KeyEventSignalState;
147   BOOLEAN                            InputEventSignalState;
148   EFI_EVENT                          ConnectConInEvent;
149 } TEXT_IN_SPLITTER_PRIVATE_DATA;
150 
151 #define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_THIS(a)  \
152   CR ((a),                                          \
153       TEXT_IN_SPLITTER_PRIVATE_DATA,                \
154       TextIn,                                       \
155       TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE       \
156       )
157 
158 #define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_SIMPLE_POINTER_THIS(a) \
159   CR ((a),                                                        \
160       TEXT_IN_SPLITTER_PRIVATE_DATA,                              \
161       SimplePointer,                                              \
162       TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE                     \
163       )
164 #define TEXT_IN_EX_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
165   CR (a,                                              \
166       TEXT_IN_SPLITTER_PRIVATE_DATA,                  \
167       TextInEx,                                       \
168       TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE         \
169       )
170 
171 #define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_ABSOLUTE_POINTER_THIS(a) \
172   CR (a,                                                            \
173       TEXT_IN_SPLITTER_PRIVATE_DATA,                                \
174       AbsolutePointer,                                              \
175       TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE                       \
176       )
177 
178 
179 #define TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('T', 'o', 'S', 'p')
180 
181 typedef struct {
182   EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput;
183   EFI_UGA_DRAW_PROTOCOL            *UgaDraw;
184   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut;
185 } TEXT_OUT_AND_GOP_DATA;
186 
187 //
188 // Private data for the Console Out splitter
189 //
190 typedef struct {
191   UINT64                                Signature;
192   EFI_HANDLE                            VirtualHandle;
193   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL       TextOut;
194   EFI_SIMPLE_TEXT_OUTPUT_MODE           TextOutMode;
195 
196   EFI_UGA_DRAW_PROTOCOL                 UgaDraw;
197   UINT32                                UgaHorizontalResolution;
198   UINT32                                UgaVerticalResolution;
199   UINT32                                UgaColorDepth;
200   UINT32                                UgaRefreshRate;
201 
202   EFI_GRAPHICS_OUTPUT_PROTOCOL          GraphicsOutput;
203   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *GraphicsOutputModeBuffer;
204   UINTN                                 CurrentNumberOfGraphicsOutput;
205   UINTN                                 CurrentNumberOfUgaDraw;
206 
207   UINTN                                 CurrentNumberOfConsoles;
208   TEXT_OUT_AND_GOP_DATA                 *TextOutList;
209   UINTN                                 TextOutListCount;
210   TEXT_OUT_SPLITTER_QUERY_DATA          *TextOutQueryData;
211   UINTN                                 TextOutQueryDataCount;
212   INT32                                 *TextOutModeMap;
213 
214 } TEXT_OUT_SPLITTER_PRIVATE_DATA;
215 
216 #define TEXT_OUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
217   CR ((a),                                          \
218       TEXT_OUT_SPLITTER_PRIVATE_DATA,               \
219       TextOut,                                      \
220       TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE      \
221       )
222 
223 #define GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a)  \
224   CR ((a),                                                  \
225       TEXT_OUT_SPLITTER_PRIVATE_DATA,                       \
226       GraphicsOutput,                                       \
227       TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE              \
228       )
229 
230 #define UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
231   CR ((a),                                          \
232       TEXT_OUT_SPLITTER_PRIVATE_DATA,               \
233       UgaDraw,                                      \
234       TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE      \
235       )
236 
237 #define CONSOLE_CONTROL_SPLITTER_PRIVATE_DATA_FROM_THIS(a)  \
238   CR ((a),                                                  \
239       TEXT_OUT_SPLITTER_PRIVATE_DATA,                       \
240       ConsoleControl,                                       \
241       TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE              \
242       )
243 
244 //
245 // Function Prototypes
246 //
247 
248 /**
249   The user Entry Point for module ConSplitter. The user code starts with this function.
250 
251   Installs driver module protocols and. Creates virtual device handles for ConIn,
252   ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,
253   Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
254   Installs Graphics Output protocol and/or UGA Draw protocol if needed.
255 
256   @param[in] ImageHandle    The firmware allocated handle for the EFI image.
257   @param[in] SystemTable    A pointer to the EFI System Table.
258 
259   @retval EFI_SUCCESS       The entry point is executed successfully.
260   @retval other             Some error occurs when executing this entry point.
261 
262 **/
263 EFI_STATUS
264 EFIAPI
265 ConSplitterDriverEntry (
266   IN EFI_HANDLE                       ImageHandle,
267   IN EFI_SYSTEM_TABLE                 *SystemTable
268   );
269 
270 /**
271   Construct console input devices' private data.
272 
273   @param  ConInPrivate             A pointer to the TEXT_IN_SPLITTER_PRIVATE_DATA
274                                    structure.
275 
276   @retval EFI_OUT_OF_RESOURCES     Out of resources.
277   @retval EFI_SUCCESS              Text Input Devcie's private data has been constructed.
278   @retval other                    Failed to construct private data.
279 
280 **/
281 EFI_STATUS
282 ConSplitterTextInConstructor (
283   TEXT_IN_SPLITTER_PRIVATE_DATA       *ConInPrivate
284   );
285 
286 /**
287   Construct console output devices' private data.
288 
289   @param  ConOutPrivate            A pointer to the TEXT_OUT_SPLITTER_PRIVATE_DATA
290                                    structure.
291 
292   @retval EFI_OUT_OF_RESOURCES     Out of resources.
293   @retval EFI_SUCCESS              Text Input Devcie's private data has been constructed.
294 
295 **/
296 EFI_STATUS
297 ConSplitterTextOutConstructor (
298   TEXT_OUT_SPLITTER_PRIVATE_DATA      *ConOutPrivate
299   );
300 
301 
302 /**
303   Test to see if Console In Device could be supported on the Controller.
304 
305   @param  This                Driver Binding protocol instance pointer.
306   @param  ControllerHandle    Handle of device to test.
307   @param  RemainingDevicePath Optional parameter use to pick a specific child
308                               device to start.
309 
310   @retval EFI_SUCCESS         This driver supports this device.
311   @retval other               This driver does not support this device.
312 
313 **/
314 EFI_STATUS
315 EFIAPI
316 ConSplitterConInDriverBindingSupported (
317   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
318   IN  EFI_HANDLE                      ControllerHandle,
319   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
320   );
321 
322 /**
323   Test to see if Simple Pointer protocol could be supported on the Controller.
324 
325   @param  This                Driver Binding protocol instance pointer.
326   @param  ControllerHandle    Handle of device to test.
327   @param  RemainingDevicePath Optional parameter use to pick a specific child
328                               device to start.
329 
330   @retval EFI_SUCCESS         This driver supports this device.
331   @retval other               This driver does not support this device.
332 
333 **/
334 EFI_STATUS
335 EFIAPI
336 ConSplitterSimplePointerDriverBindingSupported (
337   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
338   IN  EFI_HANDLE                      ControllerHandle,
339   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
340   );
341 
342 /**
343   Test to see if Console Out Device could be supported on the Controller.
344 
345   @param  This                Driver Binding protocol instance pointer.
346   @param  ControllerHandle    Handle of device to test.
347   @param  RemainingDevicePath Optional parameter use to pick a specific child
348                               device to start.
349 
350   @retval EFI_SUCCESS         This driver supports this device.
351   @retval other               This driver does not support this device.
352 
353 **/
354 EFI_STATUS
355 EFIAPI
356 ConSplitterConOutDriverBindingSupported (
357   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
358   IN  EFI_HANDLE                      ControllerHandle,
359   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
360   );
361 
362 /**
363   Test to see if Standard Error Device could be supported on the Controller.
364 
365   @param  This                Driver Binding protocol instance pointer.
366   @param  ControllerHandle    Handle of device to test.
367   @param  RemainingDevicePath Optional parameter use to pick a specific child
368                               device to start.
369 
370   @retval EFI_SUCCESS         This driver supports this device.
371   @retval other               This driver does not support this device.
372 
373 **/
374 EFI_STATUS
375 EFIAPI
376 ConSplitterStdErrDriverBindingSupported (
377   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
378   IN  EFI_HANDLE                      ControllerHandle,
379   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
380   );
381 
382 /**
383   Start Console In Consplitter on device handle.
384 
385   @param  This                 Driver Binding protocol instance pointer.
386   @param  ControllerHandle     Handle of device to bind driver to.
387   @param  RemainingDevicePath  Optional parameter use to pick a specific child
388                                device to start.
389 
390   @retval EFI_SUCCESS          Console In Consplitter is added to ControllerHandle.
391   @retval other                Console In Consplitter does not support this device.
392 
393 **/
394 EFI_STATUS
395 EFIAPI
396 ConSplitterConInDriverBindingStart (
397   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
398   IN  EFI_HANDLE                      ControllerHandle,
399   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
400   );
401 
402 /**
403   Start Simple Pointer Consplitter on device handle.
404 
405   @param  This                 Driver Binding protocol instance pointer.
406   @param  ControllerHandle     Handle of device to bind driver to.
407   @param  RemainingDevicePath  Optional parameter use to pick a specific child
408                                device to start.
409 
410   @retval EFI_SUCCESS          Simple Pointer Consplitter is added to ControllerHandle.
411   @retval other                Simple Pointer Consplitter does not support this device.
412 
413 **/
414 EFI_STATUS
415 EFIAPI
416 ConSplitterSimplePointerDriverBindingStart (
417   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
418   IN  EFI_HANDLE                      ControllerHandle,
419   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
420   );
421 
422 /**
423   Start Console Out Consplitter on device handle.
424 
425   @param  This                 Driver Binding protocol instance pointer.
426   @param  ControllerHandle     Handle of device to bind driver to.
427   @param  RemainingDevicePath  Optional parameter use to pick a specific child
428                                device to start.
429 
430   @retval EFI_SUCCESS          Console Out Consplitter is added to ControllerHandle.
431   @retval other                Console Out Consplitter does not support this device.
432 
433 **/
434 EFI_STATUS
435 EFIAPI
436 ConSplitterConOutDriverBindingStart (
437   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
438   IN  EFI_HANDLE                      ControllerHandle,
439   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
440   );
441 
442 /**
443   Start Standard Error Consplitter on device handle.
444 
445   @param  This                 Driver Binding protocol instance pointer.
446   @param  ControllerHandle     Handle of device to bind driver to.
447   @param  RemainingDevicePath  Optional parameter use to pick a specific child
448                                device to start.
449 
450   @retval EFI_SUCCESS          Standard Error Consplitter is added to ControllerHandle.
451   @retval other                Standard Error Consplitter does not support this device.
452 
453 **/
454 EFI_STATUS
455 EFIAPI
456 ConSplitterStdErrDriverBindingStart (
457   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
458   IN  EFI_HANDLE                      ControllerHandle,
459   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
460   );
461 
462 /**
463   Stop Console In ConSplitter on ControllerHandle by closing Console In Devcice GUID.
464 
465   @param  This              Driver Binding protocol instance pointer.
466   @param  ControllerHandle  Handle of device to stop driver on
467   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of
468                             children is zero stop the entire bus driver.
469   @param  ChildHandleBuffer List of Child Handles to Stop.
470 
471   @retval EFI_SUCCESS       This driver is removed ControllerHandle
472   @retval other             This driver was not removed from this device
473 
474 **/
475 EFI_STATUS
476 EFIAPI
477 ConSplitterConInDriverBindingStop (
478   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
479   IN  EFI_HANDLE                      ControllerHandle,
480   IN  UINTN                           NumberOfChildren,
481   IN  EFI_HANDLE                      *ChildHandleBuffer
482   );
483 
484 /**
485   Stop Simple Pointer protocol ConSplitter on ControllerHandle by closing
486   Simple Pointer protocol.
487 
488   @param  This              Driver Binding protocol instance pointer.
489   @param  ControllerHandle  Handle of device to stop driver on
490   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of
491                             children is zero stop the entire bus driver.
492   @param  ChildHandleBuffer List of Child Handles to Stop.
493 
494   @retval EFI_SUCCESS       This driver is removed ControllerHandle
495   @retval other             This driver was not removed from this device
496 
497 **/
498 EFI_STATUS
499 EFIAPI
500 ConSplitterSimplePointerDriverBindingStop (
501   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
502   IN  EFI_HANDLE                      ControllerHandle,
503   IN  UINTN                           NumberOfChildren,
504   IN  EFI_HANDLE                      *ChildHandleBuffer
505   );
506 
507 /**
508   Stop Console Out ConSplitter on device handle by closing Console Out Devcice GUID.
509 
510   @param  This              Driver Binding protocol instance pointer.
511   @param  ControllerHandle  Handle of device to stop driver on
512   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of
513                             children is zero stop the entire bus driver.
514   @param  ChildHandleBuffer List of Child Handles to Stop.
515 
516   @retval EFI_SUCCESS       This driver is removed ControllerHandle
517   @retval other             This driver was not removed from this device
518 
519 **/
520 EFI_STATUS
521 EFIAPI
522 ConSplitterConOutDriverBindingStop (
523   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
524   IN  EFI_HANDLE                      ControllerHandle,
525   IN  UINTN                           NumberOfChildren,
526   IN  EFI_HANDLE                      *ChildHandleBuffer
527   );
528 
529 /**
530   Stop Standard Error ConSplitter on ControllerHandle by closing Standard Error GUID.
531 
532   @param  This              Driver Binding protocol instance pointer.
533   @param  ControllerHandle  Handle of device to stop driver on
534   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of
535                             children is zero stop the entire bus driver.
536   @param  ChildHandleBuffer List of Child Handles to Stop.
537 
538   @retval EFI_SUCCESS       This driver is removed ControllerHandle
539   @retval other             This driver was not removed from this device
540 
541 **/
542 EFI_STATUS
543 EFIAPI
544 ConSplitterStdErrDriverBindingStop (
545   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
546   IN  EFI_HANDLE                      ControllerHandle,
547   IN  UINTN                           NumberOfChildren,
548   IN  EFI_HANDLE                      *ChildHandleBuffer
549   );
550 
551 
552 /**
553   Test to see if Absolute Pointer protocol could be supported on the Controller.
554 
555   @param  This                Driver Binding protocol instance pointer.
556   @param  ControllerHandle    Handle of device to test.
557   @param  RemainingDevicePath Optional parameter use to pick a specific child
558                               device to start.
559 
560   @retval EFI_SUCCESS         This driver supports this device.
561   @retval other               This driver does not support this device.
562 
563 **/
564 EFI_STATUS
565 EFIAPI
566 ConSplitterAbsolutePointerDriverBindingSupported (
567   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
568   IN  EFI_HANDLE                      ControllerHandle,
569   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
570   );
571 
572 /**
573   Start Absolute Pointer Consplitter on device handle.
574 
575   @param  This                 Driver Binding protocol instance pointer.
576   @param  ControllerHandle     Handle of device to bind driver to.
577   @param  RemainingDevicePath  Optional parameter use to pick a specific child
578                                device to start.
579 
580   @retval EFI_SUCCESS          Absolute Pointer Consplitter is added to ControllerHandle.
581   @retval other                Absolute Pointer Consplitter does not support this device.
582 
583 **/
584 EFI_STATUS
585 EFIAPI
586 ConSplitterAbsolutePointerDriverBindingStart (
587   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
588   IN  EFI_HANDLE                      ControllerHandle,
589   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
590   );
591 
592 /**
593   Stop Absolute Pointer protocol ConSplitter on ControllerHandle by closing
594   Absolute Pointer protocol.
595 
596   @param  This              Driver Binding protocol instance pointer.
597   @param  ControllerHandle  Handle of device to stop driver on
598   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of
599                             children is zero stop the entire bus driver.
600   @param  ChildHandleBuffer List of Child Handles to Stop.
601 
602   @retval EFI_SUCCESS       This driver is removed ControllerHandle
603   @retval other             This driver was not removed from this device
604 
605 **/
606 EFI_STATUS
607 EFIAPI
608 ConSplitterAbsolutePointerDriverBindingStop (
609   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
610   IN  EFI_HANDLE                      ControllerHandle,
611   IN  UINTN                           NumberOfChildren,
612   IN  EFI_HANDLE                      *ChildHandleBuffer
613   );
614 
615 /**
616   Add Absolute Pointer Device in Consplitter Absolute Pointer list.
617 
618   @param  Private                  Text In Splitter pointer.
619   @param  AbsolutePointer          Absolute Pointer protocol pointer.
620 
621   @retval EFI_SUCCESS              Absolute Pointer Device added successfully.
622   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
623 
624 **/
625 EFI_STATUS
626 ConSplitterAbsolutePointerAddDevice (
627   IN  TEXT_IN_SPLITTER_PRIVATE_DATA     *Private,
628   IN  EFI_ABSOLUTE_POINTER_PROTOCOL     *AbsolutePointer
629   );
630 
631 /**
632   Remove Absolute Pointer Device from Consplitter Absolute Pointer list.
633 
634   @param  Private                  Text In Splitter pointer.
635   @param  AbsolutePointer          Absolute Pointer protocol pointer.
636 
637   @retval EFI_SUCCESS              Absolute Pointer Device removed successfully.
638   @retval EFI_NOT_FOUND            No Absolute Pointer Device found.
639 
640 **/
641 EFI_STATUS
642 ConSplitterAbsolutePointerDeleteDevice (
643   IN  TEXT_IN_SPLITTER_PRIVATE_DATA     *Private,
644   IN  EFI_ABSOLUTE_POINTER_PROTOCOL     *AbsolutePointer
645   );
646 
647 //
648 // Absolute Pointer protocol interfaces
649 //
650 
651 
652 /**
653   Resets the pointer device hardware.
654 
655   @param  This                     Protocol instance pointer.
656   @param  ExtendedVerification     Driver may perform diagnostics on reset.
657 
658   @retval EFI_SUCCESS              The device was reset.
659   @retval EFI_DEVICE_ERROR         The device is not functioning correctly and
660                                    could not be reset.
661 
662 **/
663 EFI_STATUS
664 EFIAPI
665 ConSplitterAbsolutePointerReset (
666   IN EFI_ABSOLUTE_POINTER_PROTOCOL   *This,
667   IN BOOLEAN                         ExtendedVerification
668   );
669 
670 
671 /**
672   Retrieves the current state of a pointer device.
673 
674   @param  This                     Protocol instance pointer.
675   @param  State                    A pointer to the state information on the
676                                    pointer device.
677 
678   @retval EFI_SUCCESS              The state of the pointer device was returned in
679                                    State..
680   @retval EFI_NOT_READY            The state of the pointer device has not changed
681                                    since the last call to GetState().
682   @retval EFI_DEVICE_ERROR         A device error occurred while attempting to
683                                    retrieve the pointer device's current state.
684 
685 **/
686 EFI_STATUS
687 EFIAPI
688 ConSplitterAbsolutePointerGetState (
689   IN EFI_ABSOLUTE_POINTER_PROTOCOL   *This,
690   IN OUT EFI_ABSOLUTE_POINTER_STATE  *State
691   );
692 
693 /**
694   This event agregates all the events of the pointer devices in the splitter.
695 
696   If any events of physical pointer devices are signaled, signal the pointer
697   splitter event. This will cause the calling code to call
698   ConSplitterAbsolutePointerGetState ().
699 
700   @param  Event                    The Event assoicated with callback.
701   @param  Context                  Context registered when Event was created.
702 
703 **/
704 VOID
705 EFIAPI
706 ConSplitterAbsolutePointerWaitForInput (
707   IN  EFI_EVENT                       Event,
708   IN  VOID                            *Context
709   );
710 
711 /**
712   Retrieves a Unicode string that is the user readable name of the driver.
713 
714   This function retrieves the user readable name of a driver in the form of a
715   Unicode string. If the driver specified by This has a user readable name in
716   the language specified by Language, then a pointer to the driver name is
717   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
718   by This does not support the language specified by Language,
719   then EFI_UNSUPPORTED is returned.
720 
721   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
722                                 EFI_COMPONENT_NAME_PROTOCOL instance.
723 
724   @param  Language[in]          A pointer to a Null-terminated ASCII string
725                                 array indicating the language. This is the
726                                 language of the driver name that the caller is
727                                 requesting, and it must match one of the
728                                 languages specified in SupportedLanguages. The
729                                 number of languages supported by a driver is up
730                                 to the driver writer. Language is specified
731                                 in RFC 4646 or ISO 639-2 language code format.
732 
733   @param  DriverName[out]       A pointer to the Unicode string to return.
734                                 This Unicode string is the name of the
735                                 driver specified by This in the language
736                                 specified by Language.
737 
738   @retval EFI_SUCCESS           The Unicode string for the Driver specified by
739                                 This and the language specified by Language was
740                                 returned in DriverName.
741 
742   @retval EFI_INVALID_PARAMETER Language is NULL.
743 
744   @retval EFI_INVALID_PARAMETER DriverName is NULL.
745 
746   @retval EFI_UNSUPPORTED       The driver specified by This does not support
747                                 the language specified by Language.
748 
749 **/
750 EFI_STATUS
751 EFIAPI
752 ConSplitterComponentNameGetDriverName (
753   IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
754   IN  CHAR8                        *Language,
755   OUT CHAR16                       **DriverName
756   );
757 
758 
759 /**
760   Retrieves a Unicode string that is the user readable name of the controller
761   that is being managed by a driver.
762 
763   This function retrieves the user readable name of the controller specified by
764   ControllerHandle and ChildHandle in the form of a Unicode string. If the
765   driver specified by This has a user readable name in the language specified by
766   Language, then a pointer to the controller name is returned in ControllerName,
767   and EFI_SUCCESS is returned.  If the driver specified by This is not currently
768   managing the controller specified by ControllerHandle and ChildHandle,
769   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not
770   support the language specified by Language, then EFI_UNSUPPORTED is returned.
771 
772   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
773                                 EFI_COMPONENT_NAME_PROTOCOL instance.
774 
775   @param  ControllerHandle[in]  The handle of a controller that the driver
776                                 specified by This is managing.  This handle
777                                 specifies the controller whose name is to be
778                                 returned.
779 
780   @param  ChildHandle[in]       The handle of the child controller to retrieve
781                                 the name of.  This is an optional parameter that
782                                 may be NULL.  It will be NULL for device
783                                 drivers.  It will also be NULL for a bus drivers
784                                 that wish to retrieve the name of the bus
785                                 controller.  It will not be NULL for a bus
786                                 driver that wishes to retrieve the name of a
787                                 child controller.
788 
789   @param  Language[in]          A pointer to a Null-terminated ASCII string
790                                 array indicating the language.  This is the
791                                 language of the driver name that the caller is
792                                 requesting, and it must match one of the
793                                 languages specified in SupportedLanguages. The
794                                 number of languages supported by a driver is up
795                                 to the driver writer. Language is specified in
796                                 RFC 4646 or ISO 639-2 language code format.
797 
798   @param  ControllerName[out]   A pointer to the Unicode string to return.
799                                 This Unicode string is the name of the
800                                 controller specified by ControllerHandle and
801                                 ChildHandle in the language specified by
802                                 Language from the point of view of the driver
803                                 specified by This.
804 
805   @retval EFI_SUCCESS           The Unicode string for the user readable name in
806                                 the language specified by Language for the
807                                 driver specified by This was returned in
808                                 DriverName.
809 
810   @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
811 
812   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
813                                 EFI_HANDLE.
814 
815   @retval EFI_INVALID_PARAMETER Language is NULL.
816 
817   @retval EFI_INVALID_PARAMETER ControllerName is NULL.
818 
819   @retval EFI_UNSUPPORTED       The driver specified by This is not currently
820                                 managing the controller specified by
821                                 ControllerHandle and ChildHandle.
822 
823   @retval EFI_UNSUPPORTED       The driver specified by This does not support
824                                 the language specified by Language.
825 
826 **/
827 EFI_STATUS
828 EFIAPI
829 ConSplitterConInComponentNameGetControllerName (
830   IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,
831   IN  EFI_HANDLE                                      ControllerHandle,
832   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
833   IN  CHAR8                                           *Language,
834   OUT CHAR16                                          **ControllerName
835   );
836 
837 
838 /**
839   Retrieves a Unicode string that is the user readable name of the controller
840   that is being managed by a driver.
841 
842   This function retrieves the user readable name of the controller specified by
843   ControllerHandle and ChildHandle in the form of a Unicode string. If the
844   driver specified by This has a user readable name in the language specified by
845   Language, then a pointer to the controller name is returned in ControllerName,
846   and EFI_SUCCESS is returned.  If the driver specified by This is not currently
847   managing the controller specified by ControllerHandle and ChildHandle,
848   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not
849   support the language specified by Language, then EFI_UNSUPPORTED is returned.
850 
851   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
852                                 EFI_COMPONENT_NAME_PROTOCOL instance.
853 
854   @param  ControllerHandle[in]  The handle of a controller that the driver
855                                 specified by This is managing.  This handle
856                                 specifies the controller whose name is to be
857                                 returned.
858 
859   @param  ChildHandle[in]       The handle of the child controller to retrieve
860                                 the name of.  This is an optional parameter that
861                                 may be NULL.  It will be NULL for device
862                                 drivers.  It will also be NULL for a bus drivers
863                                 that wish to retrieve the name of the bus
864                                 controller.  It will not be NULL for a bus
865                                 driver that wishes to retrieve the name of a
866                                 child controller.
867 
868   @param  Language[in]          A pointer to a Null-terminated ASCII string
869                                 array indicating the language.  This is the
870                                 language of the driver name that the caller is
871                                 requesting, and it must match one of the
872                                 languages specified in SupportedLanguages. The
873                                 number of languages supported by a driver is up
874                                 to the driver writer. Language is specified in
875                                 RFC 4646 or ISO 639-2 language code format.
876 
877   @param  ControllerName[out]   A pointer to the Unicode string to return.
878                                 This Unicode string is the name of the
879                                 controller specified by ControllerHandle and
880                                 ChildHandle in the language specified by
881                                 Language from the point of view of the driver
882                                 specified by This.
883 
884   @retval EFI_SUCCESS           The Unicode string for the user readable name in
885                                 the language specified by Language for the
886                                 driver specified by This was returned in
887                                 DriverName.
888 
889   @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
890 
891   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
892                                 EFI_HANDLE.
893 
894   @retval EFI_INVALID_PARAMETER Language is NULL.
895 
896   @retval EFI_INVALID_PARAMETER ControllerName is NULL.
897 
898   @retval EFI_UNSUPPORTED       The driver specified by This is not currently
899                                 managing the controller specified by
900                                 ControllerHandle and ChildHandle.
901 
902   @retval EFI_UNSUPPORTED       The driver specified by This does not support
903                                 the language specified by Language.
904 
905 **/
906 EFI_STATUS
907 EFIAPI
908 ConSplitterSimplePointerComponentNameGetControllerName (
909   IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,
910   IN  EFI_HANDLE                                      ControllerHandle,
911   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
912   IN  CHAR8                                           *Language,
913   OUT CHAR16                                          **ControllerName
914   );
915 
916 /**
917   Retrieves a Unicode string that is the user readable name of the controller
918   that is being managed by an EFI Driver.
919 
920   @param  This                   A pointer to the EFI_COMPONENT_NAME_PROTOCOL
921                                  instance.
922   @param  ControllerHandle       The handle of a controller that the driver
923                                  specified by This is managing.  This handle
924                                  specifies the controller whose name is to be
925                                  returned.
926   @param  ChildHandle            The handle of the child controller to retrieve the
927                                  name of.  This is an optional parameter that may
928                                  be NULL.  It will be NULL for device drivers.  It
929                                  will also be NULL for a bus drivers that wish to
930                                  retrieve the name of the bus controller.  It will
931                                  not be NULL for a bus driver that wishes to
932                                  retrieve the name of a child controller.
933   @param  Language               A pointer to RFC4646 language identifier. This is
934                                  the language of the controller name that that the
935                                  caller is requesting, and it must match one of the
936                                  languages specified in SupportedLanguages.  The
937                                  number of languages supported by a driver is up to
938                                  the driver writer.
939   @param  ControllerName         A pointer to the Unicode string to return.  This
940                                  Unicode string is the name of the controller
941                                  specified by ControllerHandle and ChildHandle in
942                                  the language specified by Language from the point
943                                  of view of the driver specified by This.
944 
945   @retval EFI_SUCCESS            The Unicode string for the user readable name in
946                                  the language specified by Language for the driver
947                                  specified by This was returned in DriverName.
948   @retval EFI_INVALID_PARAMETER  ControllerHandle is NULL.
949   @retval EFI_INVALID_PARAMETER  ChildHandle is not NULL and it is not a valid
950                                  EFI_HANDLE.
951   @retval EFI_INVALID_PARAMETER  Language is NULL.
952   @retval EFI_INVALID_PARAMETER  ControllerName is NULL.
953   @retval EFI_UNSUPPORTED        The driver specified by This is not currently
954                                  managing the controller specified by
955                                  ControllerHandle and ChildHandle.
956   @retval EFI_UNSUPPORTED        The driver specified by This does not support the
957                                  language specified by Language.
958 
959 **/
960 EFI_STATUS
961 EFIAPI
962 ConSplitterAbsolutePointerComponentNameGetControllerName (
963   IN  EFI_COMPONENT_NAME_PROTOCOL                    *This,
964   IN  EFI_HANDLE                                      ControllerHandle,
965   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
966   IN  CHAR8                                           *Language,
967   OUT CHAR16                                          **ControllerName
968   );
969 
970 /**
971   Retrieves a Unicode string that is the user readable name of the controller
972   that is being managed by a driver.
973 
974   This function retrieves the user readable name of the controller specified by
975   ControllerHandle and ChildHandle in the form of a Unicode string. If the
976   driver specified by This has a user readable name in the language specified by
977   Language, then a pointer to the controller name is returned in ControllerName,
978   and EFI_SUCCESS is returned.  If the driver specified by This is not currently
979   managing the controller specified by ControllerHandle and ChildHandle,
980   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not
981   support the language specified by Language, then EFI_UNSUPPORTED is returned.
982 
983   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
984                                 EFI_COMPONENT_NAME_PROTOCOL instance.
985 
986   @param  ControllerHandle[in]  The handle of a controller that the driver
987                                 specified by This is managing.  This handle
988                                 specifies the controller whose name is to be
989                                 returned.
990 
991   @param  ChildHandle[in]       The handle of the child controller to retrieve
992                                 the name of.  This is an optional parameter that
993                                 may be NULL.  It will be NULL for device
994                                 drivers.  It will also be NULL for a bus drivers
995                                 that wish to retrieve the name of the bus
996                                 controller.  It will not be NULL for a bus
997                                 driver that wishes to retrieve the name of a
998                                 child controller.
999 
1000   @param  Language[in]          A pointer to a Null-terminated ASCII string
1001                                 array indicating the language.  This is the
1002                                 language of the driver name that the caller is
1003                                 requesting, and it must match one of the
1004                                 languages specified in SupportedLanguages. The
1005                                 number of languages supported by a driver is up
1006                                 to the driver writer. Language is specified in
1007                                 RFC 4646 or ISO 639-2 language code format.
1008 
1009   @param  ControllerName[out]   A pointer to the Unicode string to return.
1010                                 This Unicode string is the name of the
1011                                 controller specified by ControllerHandle and
1012                                 ChildHandle in the language specified by
1013                                 Language from the point of view of the driver
1014                                 specified by This.
1015 
1016   @retval EFI_SUCCESS           The Unicode string for the user readable name in
1017                                 the language specified by Language for the
1018                                 driver specified by This was returned in
1019                                 DriverName.
1020 
1021   @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
1022 
1023   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1024                                 EFI_HANDLE.
1025 
1026   @retval EFI_INVALID_PARAMETER Language is NULL.
1027 
1028   @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1029 
1030   @retval EFI_UNSUPPORTED       The driver specified by This is not currently
1031                                 managing the controller specified by
1032                                 ControllerHandle and ChildHandle.
1033 
1034   @retval EFI_UNSUPPORTED       The driver specified by This does not support
1035                                 the language specified by Language.
1036 
1037 **/
1038 EFI_STATUS
1039 EFIAPI
1040 ConSplitterConOutComponentNameGetControllerName (
1041   IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,
1042   IN  EFI_HANDLE                                      ControllerHandle,
1043   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
1044   IN  CHAR8                                           *Language,
1045   OUT CHAR16                                          **ControllerName
1046   );
1047 
1048 
1049 /**
1050   Retrieves a Unicode string that is the user readable name of the controller
1051   that is being managed by a driver.
1052 
1053   This function retrieves the user readable name of the controller specified by
1054   ControllerHandle and ChildHandle in the form of a Unicode string. If the
1055   driver specified by This has a user readable name in the language specified by
1056   Language, then a pointer to the controller name is returned in ControllerName,
1057   and EFI_SUCCESS is returned.  If the driver specified by This is not currently
1058   managing the controller specified by ControllerHandle and ChildHandle,
1059   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not
1060   support the language specified by Language, then EFI_UNSUPPORTED is returned.
1061 
1062   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1063                                 EFI_COMPONENT_NAME_PROTOCOL instance.
1064 
1065   @param  ControllerHandle[in]  The handle of a controller that the driver
1066                                 specified by This is managing.  This handle
1067                                 specifies the controller whose name is to be
1068                                 returned.
1069 
1070   @param  ChildHandle[in]       The handle of the child controller to retrieve
1071                                 the name of.  This is an optional parameter that
1072                                 may be NULL.  It will be NULL for device
1073                                 drivers.  It will also be NULL for a bus drivers
1074                                 that wish to retrieve the name of the bus
1075                                 controller.  It will not be NULL for a bus
1076                                 driver that wishes to retrieve the name of a
1077                                 child controller.
1078 
1079   @param  Language[in]          A pointer to a Null-terminated ASCII string
1080                                 array indicating the language.  This is the
1081                                 language of the driver name that the caller is
1082                                 requesting, and it must match one of the
1083                                 languages specified in SupportedLanguages. The
1084                                 number of languages supported by a driver is up
1085                                 to the driver writer. Language is specified in
1086                                 RFC 4646 or ISO 639-2 language code format.
1087 
1088   @param  ControllerName[out]   A pointer to the Unicode string to return.
1089                                 This Unicode string is the name of the
1090                                 controller specified by ControllerHandle and
1091                                 ChildHandle in the language specified by
1092                                 Language from the point of view of the driver
1093                                 specified by This.
1094 
1095   @retval EFI_SUCCESS           The Unicode string for the user readable name in
1096                                 the language specified by Language for the
1097                                 driver specified by This was returned in
1098                                 DriverName.
1099 
1100   @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
1101 
1102   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1103                                 EFI_HANDLE.
1104 
1105   @retval EFI_INVALID_PARAMETER Language is NULL.
1106 
1107   @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1108 
1109   @retval EFI_UNSUPPORTED       The driver specified by This is not currently
1110                                 managing the controller specified by
1111                                 ControllerHandle and ChildHandle.
1112 
1113   @retval EFI_UNSUPPORTED       The driver specified by This does not support
1114                                 the language specified by Language.
1115 
1116 **/
1117 EFI_STATUS
1118 EFIAPI
1119 ConSplitterStdErrComponentNameGetControllerName (
1120   IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,
1121   IN  EFI_HANDLE                                      ControllerHandle,
1122   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
1123   IN  CHAR8                                           *Language,
1124   OUT CHAR16                                          **ControllerName
1125   );
1126 
1127 
1128 //
1129 // TextIn Constructor/Destructor functions
1130 //
1131 
1132 /**
1133   Add Text Input Device in Consplitter Text Input list.
1134 
1135   @param  Private                  Text In Splitter pointer.
1136   @param  TextIn                   Simple Text Input protocol pointer.
1137 
1138   @retval EFI_SUCCESS              Text Input Device added successfully.
1139   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
1140 
1141 **/
1142 EFI_STATUS
1143 ConSplitterTextInAddDevice (
1144   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,
1145   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *TextIn
1146   );
1147 
1148 /**
1149   Remove Text Input Device from Consplitter Text Input list.
1150 
1151   @param  Private                  Text In Splitter pointer.
1152   @param  TextIn                   Simple Text protocol pointer.
1153 
1154   @retval EFI_SUCCESS              Simple Text Device removed successfully.
1155   @retval EFI_NOT_FOUND            No Simple Text Device found.
1156 
1157 **/
1158 EFI_STATUS
1159 ConSplitterTextInDeleteDevice (
1160   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,
1161   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *TextIn
1162   );
1163 
1164 //
1165 // SimplePointer Constuctor/Destructor functions
1166 //
1167 
1168 /**
1169   Add Simple Pointer Device in Consplitter Simple Pointer list.
1170 
1171   @param  Private                  Text In Splitter pointer.
1172   @param  SimplePointer            Simple Pointer protocol pointer.
1173 
1174   @retval EFI_SUCCESS              Simple Pointer Device added successfully.
1175   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
1176 
1177 **/
1178 EFI_STATUS
1179 ConSplitterSimplePointerAddDevice (
1180   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,
1181   IN  EFI_SIMPLE_POINTER_PROTOCOL     *SimplePointer
1182   );
1183 
1184 /**
1185   Remove Simple Pointer Device from Consplitter Simple Pointer list.
1186 
1187   @param  Private                  Text In Splitter pointer.
1188   @param  SimplePointer            Simple Pointer protocol pointer.
1189 
1190   @retval EFI_SUCCESS              Simple Pointer Device removed successfully.
1191   @retval EFI_NOT_FOUND            No Simple Pointer Device found.
1192 
1193 **/
1194 EFI_STATUS
1195 ConSplitterSimplePointerDeleteDevice (
1196   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,
1197   IN  EFI_SIMPLE_POINTER_PROTOCOL     *SimplePointer
1198   );
1199 
1200 //
1201 // TextOut Constuctor/Destructor functions
1202 //
1203 
1204 /**
1205   Add Text Output Device in Consplitter Text Output list.
1206 
1207   @param  Private                  Text Out Splitter pointer.
1208   @param  TextOut                  Simple Text Output protocol pointer.
1209   @param  GraphicsOutput           Graphics Output protocol pointer.
1210   @param  UgaDraw                  UGA Draw protocol pointer.
1211 
1212   @retval EFI_SUCCESS              Text Output Device added successfully.
1213   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
1214 
1215 **/
1216 EFI_STATUS
1217 ConSplitterTextOutAddDevice (
1218   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA     *Private,
1219   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *TextOut,
1220   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL       *GraphicsOutput,
1221   IN  EFI_UGA_DRAW_PROTOCOL              *UgaDraw
1222   );
1223 
1224 /**
1225   Remove Text Out Device in Consplitter Text Out list.
1226 
1227   @param  Private                  Text Out Splitter pointer.
1228   @param  TextOut                  Simple Text Output Pointer protocol pointer.
1229 
1230   @retval EFI_SUCCESS              Text Out Device removed successfully.
1231   @retval EFI_NOT_FOUND            No Text Out Device found.
1232 
1233 **/
1234 EFI_STATUS
1235 ConSplitterTextOutDeleteDevice (
1236   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA     *Private,
1237   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *TextOut
1238   );
1239 
1240 //
1241 // TextIn I/O Functions
1242 //
1243 
1244 /**
1245   Reset the input device and optionaly run diagnostics
1246 
1247   @param  This                     Protocol instance pointer.
1248   @param  ExtendedVerification     Driver may perform diagnostics on reset.
1249 
1250   @retval EFI_SUCCESS              The device was reset.
1251   @retval EFI_DEVICE_ERROR         The device is not functioning properly and could
1252                                    not be reset.
1253 
1254 **/
1255 EFI_STATUS
1256 EFIAPI
1257 ConSplitterTextInReset (
1258   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This,
1259   IN  BOOLEAN                         ExtendedVerification
1260   );
1261 
1262 /**
1263   Reads the next keystroke from the input device. The WaitForKey Event can
1264   be used to test for existance of a keystroke via WaitForEvent () call.
1265 
1266   @param  This                     Protocol instance pointer.
1267   @param  Key                      Driver may perform diagnostics on reset.
1268 
1269   @retval EFI_SUCCESS              The keystroke information was returned.
1270   @retval EFI_NOT_READY            There was no keystroke data availiable.
1271   @retval EFI_DEVICE_ERROR         The keydtroke information was not returned due
1272                                    to hardware errors.
1273 
1274 **/
1275 EFI_STATUS
1276 EFIAPI
1277 ConSplitterTextInReadKeyStroke (
1278   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This,
1279   OUT EFI_INPUT_KEY                   *Key
1280   );
1281 
1282 /**
1283   Add Text Input Ex Device in Consplitter Text Input Ex list.
1284 
1285   @param  Private                  Text In Splitter pointer.
1286   @param  TextInEx                 Simple Text Input Ex Input protocol pointer.
1287 
1288   @retval EFI_SUCCESS              Text Input Ex Device added successfully.
1289   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
1290 
1291 **/
1292 EFI_STATUS
1293 ConSplitterTextInExAddDevice (
1294   IN  TEXT_IN_SPLITTER_PRIVATE_DATA         *Private,
1295   IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL     *TextInEx
1296   );
1297 
1298 /**
1299   Remove Text Ex Device from Consplitter Text Input Ex list.
1300 
1301   @param  Private                  Text In Splitter pointer.
1302   @param  TextInEx                 Simple Text Ex protocol pointer.
1303 
1304   @retval EFI_SUCCESS              Simple Text Input Ex Device removed successfully.
1305   @retval EFI_NOT_FOUND            No Simple Text Input Ex Device found.
1306 
1307 **/
1308 EFI_STATUS
1309 ConSplitterTextInExDeleteDevice (
1310   IN  TEXT_IN_SPLITTER_PRIVATE_DATA         *Private,
1311   IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL     *TextInEx
1312   );
1313 
1314 //
1315 // Simple Text Input Ex protocol function prototypes
1316 //
1317 
1318 /**
1319   Reset the input device and optionaly run diagnostics
1320 
1321   @param  This                     Protocol instance pointer.
1322   @param  ExtendedVerification     Driver may perform diagnostics on reset.
1323 
1324   @retval EFI_SUCCESS              The device was reset.
1325   @retval EFI_DEVICE_ERROR         The device is not functioning properly and could
1326                                    not be reset.
1327 
1328 **/
1329 EFI_STATUS
1330 EFIAPI
1331 ConSplitterTextInResetEx (
1332   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
1333   IN BOOLEAN                            ExtendedVerification
1334   );
1335 
1336 
1337 /**
1338   Reads the next keystroke from the input device. The WaitForKey Event can
1339   be used to test for existance of a keystroke via WaitForEvent () call.
1340 
1341   @param  This                     Protocol instance pointer.
1342   @param  KeyData                  A pointer to a buffer that is filled in with the
1343                                    keystroke state data for the key that was
1344                                    pressed.
1345 
1346   @retval EFI_SUCCESS              The keystroke information was returned.
1347   @retval EFI_NOT_READY            There was no keystroke data availiable.
1348   @retval EFI_DEVICE_ERROR         The keystroke information was not returned due
1349                                    to hardware errors.
1350   @retval EFI_INVALID_PARAMETER    KeyData is NULL.
1351 
1352 **/
1353 EFI_STATUS
1354 EFIAPI
1355 ConSplitterTextInReadKeyStrokeEx (
1356   IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
1357   OUT EFI_KEY_DATA                      *KeyData
1358   );
1359 
1360 
1361 /**
1362   Set certain state for the input device.
1363 
1364   @param  This                     Protocol instance pointer.
1365   @param  KeyToggleState           A pointer to the EFI_KEY_TOGGLE_STATE to set the
1366                                    state for the input device.
1367 
1368   @retval EFI_SUCCESS              The device state was set successfully.
1369   @retval EFI_DEVICE_ERROR         The device is not functioning correctly and
1370                                    could not have the setting adjusted.
1371   @retval EFI_UNSUPPORTED          The device does not have the ability to set its
1372                                    state.
1373   @retval EFI_INVALID_PARAMETER    KeyToggleState is NULL.
1374 
1375 **/
1376 EFI_STATUS
1377 EFIAPI
1378 ConSplitterTextInSetState (
1379   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
1380   IN EFI_KEY_TOGGLE_STATE               *KeyToggleState
1381   );
1382 
1383 
1384 /**
1385   Register a notification function for a particular keystroke for the input device.
1386 
1387   @param  This                     Protocol instance pointer.
1388   @param  KeyData                  A pointer to a buffer that is filled in with the
1389                                    keystroke information data for the key that was
1390                                    pressed.
1391   @param  KeyNotificationFunction  Points to the function to be called when the key
1392                                    sequence is typed specified by KeyData.
1393   @param  NotifyHandle             Points to the unique handle assigned to the
1394                                    registered notification.
1395 
1396   @retval EFI_SUCCESS              The notification function was registered
1397                                    successfully.
1398   @retval EFI_OUT_OF_RESOURCES     Unable to allocate resources for necesssary data
1399                                    structures.
1400   @retval EFI_INVALID_PARAMETER    KeyData or KeyNotificationFunction or NotifyHandle is NULL.
1401 
1402 **/
1403 EFI_STATUS
1404 EFIAPI
1405 ConSplitterTextInRegisterKeyNotify (
1406   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
1407   IN EFI_KEY_DATA                       *KeyData,
1408   IN EFI_KEY_NOTIFY_FUNCTION            KeyNotificationFunction,
1409   OUT VOID                              **NotifyHandle
1410   );
1411 
1412 
1413 /**
1414   Remove a registered notification function from a particular keystroke.
1415 
1416   @param  This                     Protocol instance pointer.
1417   @param  NotificationHandle       The handle of the notification function being
1418                                    unregistered.
1419 
1420   @retval EFI_SUCCESS              The notification function was unregistered
1421                                    successfully.
1422   @retval EFI_INVALID_PARAMETER    The NotificationHandle is invalid.
1423   @retval EFI_NOT_FOUND            Can not find the matching entry in database.
1424 
1425 **/
1426 EFI_STATUS
1427 EFIAPI
1428 ConSplitterTextInUnregisterKeyNotify (
1429   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
1430   IN VOID                               *NotificationHandle
1431   );
1432 
1433 /**
1434   This event aggregates all the events of the ConIn devices in the spliter.
1435 
1436   If any events of physical ConIn devices are signaled, signal the ConIn
1437   spliter event. This will cause the calling code to call
1438   ConSplitterTextInReadKeyStroke ().
1439 
1440   @param  Event                    The Event assoicated with callback.
1441   @param  Context                  Context registered when Event was created.
1442 
1443 **/
1444 VOID
1445 EFIAPI
1446 ConSplitterTextInWaitForKey (
1447   IN  EFI_EVENT                       Event,
1448   IN  VOID                            *Context
1449   );
1450 
1451 
1452 /**
1453   Reads the next keystroke from the input device. The WaitForKey Event can
1454   be used to test for existance of a keystroke via WaitForEvent () call.
1455 
1456   @param  Private                  Protocol instance pointer.
1457   @param  Key                      Driver may perform diagnostics on reset.
1458 
1459   @retval EFI_SUCCESS              The keystroke information was returned.
1460   @retval EFI_NOT_READY            There was no keystroke data availiable.
1461   @retval EFI_DEVICE_ERROR         The keydtroke information was not returned due
1462                                    to hardware errors.
1463 
1464 **/
1465 EFI_STATUS
1466 EFIAPI
1467 ConSplitterTextInPrivateReadKeyStroke (
1468   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,
1469   OUT EFI_INPUT_KEY                   *Key
1470   );
1471 
1472 /**
1473   Reset the input device and optionaly run diagnostics
1474 
1475   @param  This                     Protocol instance pointer.
1476   @param  ExtendedVerification     Driver may perform diagnostics on reset.
1477 
1478   @retval EFI_SUCCESS              The device was reset.
1479   @retval EFI_DEVICE_ERROR         The device is not functioning properly and could
1480                                    not be reset.
1481 
1482 **/
1483 EFI_STATUS
1484 EFIAPI
1485 ConSplitterSimplePointerReset (
1486   IN  EFI_SIMPLE_POINTER_PROTOCOL     *This,
1487   IN  BOOLEAN                         ExtendedVerification
1488   );
1489 
1490 /**
1491   Reads the next keystroke from the input device. The WaitForKey Event can
1492   be used to test for existance of a keystroke via WaitForEvent () call.
1493 
1494   @param  This                     A pointer to protocol instance.
1495   @param  State                    A pointer to state information on the pointer device
1496 
1497   @retval EFI_SUCCESS              The keystroke information was returned in State.
1498   @retval EFI_NOT_READY            There was no keystroke data availiable.
1499   @retval EFI_DEVICE_ERROR         The keydtroke information was not returned due
1500                                    to hardware errors.
1501 
1502 **/
1503 EFI_STATUS
1504 EFIAPI
1505 ConSplitterSimplePointerGetState (
1506   IN  EFI_SIMPLE_POINTER_PROTOCOL     *This,
1507   IN OUT EFI_SIMPLE_POINTER_STATE     *State
1508   );
1509 
1510 /**
1511   This event agregates all the events of the ConIn devices in the spliter.
1512   If any events of physical ConIn devices are signaled, signal the ConIn
1513   spliter event. This will cause the calling code to call
1514   ConSplitterTextInReadKeyStroke ().
1515 
1516   @param  Event                    The Event assoicated with callback.
1517   @param  Context                  Context registered when Event was created.
1518 
1519 **/
1520 VOID
1521 EFIAPI
1522 ConSplitterSimplePointerWaitForInput (
1523   IN  EFI_EVENT                       Event,
1524   IN  VOID                            *Context
1525   );
1526 
1527 //
1528 // TextOut I/O Functions
1529 //
1530 
1531 /**
1532   Reset the text output device hardware and optionaly run diagnostics
1533 
1534   @param  This                     Protocol instance pointer.
1535   @param  ExtendedVerification     Driver may perform more exhaustive verfication
1536                                    operation of the device during reset.
1537 
1538   @retval EFI_SUCCESS              The text output device was reset.
1539   @retval EFI_DEVICE_ERROR         The text output device is not functioning
1540                                    correctly and could not be reset.
1541 
1542 **/
1543 EFI_STATUS
1544 EFIAPI
1545 ConSplitterTextOutReset (
1546   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1547   IN  BOOLEAN                            ExtendedVerification
1548   );
1549 
1550 /**
1551   Write a Unicode string to the output device.
1552 
1553   @param  This                     Protocol instance pointer.
1554   @param  WString                  The NULL-terminated Unicode string to be
1555                                    displayed on the output device(s). All output
1556                                    devices must also support the Unicode drawing
1557                                    defined in this file.
1558 
1559   @retval EFI_SUCCESS              The string was output to the device.
1560   @retval EFI_DEVICE_ERROR         The device reported an error while attempting to
1561                                    output the text.
1562   @retval EFI_UNSUPPORTED          The output device's mode is not currently in a
1563                                    defined text mode.
1564   @retval EFI_WARN_UNKNOWN_GLYPH   This warning code indicates that some of the
1565                                    characters in the Unicode string could not be
1566                                    rendered and were skipped.
1567 
1568 **/
1569 EFI_STATUS
1570 EFIAPI
1571 ConSplitterTextOutOutputString (
1572   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1573   IN  CHAR16                             *WString
1574   );
1575 
1576 /**
1577   Verifies that all characters in a Unicode string can be output to the
1578   target device.
1579 
1580   @param  This                     Protocol instance pointer.
1581   @param  WString                  The NULL-terminated Unicode string to be
1582                                    examined for the output device(s).
1583 
1584   @retval EFI_SUCCESS              The device(s) are capable of rendering the
1585                                    output string.
1586   @retval EFI_UNSUPPORTED          Some of the characters in the Unicode string
1587                                    cannot be rendered by one or more of the output
1588                                    devices mapped by the EFI handle.
1589 
1590 **/
1591 EFI_STATUS
1592 EFIAPI
1593 ConSplitterTextOutTestString (
1594   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1595   IN  CHAR16                             *WString
1596   );
1597 
1598 /**
1599   Returns information for an available text mode that the output device(s)
1600   supports.
1601 
1602   @param  This                     Protocol instance pointer.
1603   @param  ModeNumber               The mode number to return information on.
1604   @param  Columns                  Returns the columns of the text output device
1605                                    for the requested ModeNumber.
1606   @param  Rows                     Returns the rows of the text output device
1607                                    for the requested ModeNumber.
1608 
1609   @retval EFI_SUCCESS              The requested mode information was returned.
1610   @retval EFI_DEVICE_ERROR         The device had an error and could not complete
1611                                    the request.
1612   @retval EFI_UNSUPPORTED          The mode number was not valid.
1613 
1614 **/
1615 EFI_STATUS
1616 EFIAPI
1617 ConSplitterTextOutQueryMode (
1618   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1619   IN  UINTN                              ModeNumber,
1620   OUT UINTN                              *Columns,
1621   OUT UINTN                              *Rows
1622   );
1623 
1624 /**
1625   Sets the output device(s) to a specified mode.
1626 
1627   @param  This                     Protocol instance pointer.
1628   @param  ModeNumber               The mode number to set.
1629 
1630   @retval EFI_SUCCESS              The requested text mode was set.
1631   @retval EFI_DEVICE_ERROR         The device had an error and could not complete
1632                                    the request.
1633   @retval EFI_UNSUPPORTED          The mode number was not valid.
1634 
1635 **/
1636 EFI_STATUS
1637 EFIAPI
1638 ConSplitterTextOutSetMode (
1639   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1640   IN  UINTN                              ModeNumber
1641   );
1642 
1643 /**
1644   Sets the background and foreground colors for the OutputString () and
1645   ClearScreen () functions.
1646 
1647   @param  This                     Protocol instance pointer.
1648   @param  Attribute                The attribute to set. Bits 0..3 are the
1649                                    foreground color, and bits 4..6 are the
1650                                    background color. All other bits are undefined
1651                                    and must be zero. The valid Attributes are
1652                                    defined in this file.
1653 
1654   @retval EFI_SUCCESS              The attribute was set.
1655   @retval EFI_DEVICE_ERROR         The device had an error and could not complete
1656                                    the request.
1657   @retval EFI_UNSUPPORTED          The attribute requested is not defined.
1658 
1659 **/
1660 EFI_STATUS
1661 EFIAPI
1662 ConSplitterTextOutSetAttribute (
1663   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1664   IN  UINTN                              Attribute
1665   );
1666 
1667 /**
1668   Clears the output device(s) display to the currently selected background
1669   color.
1670 
1671   @param  This                     Protocol instance pointer.
1672 
1673   @retval EFI_SUCCESS              The operation completed successfully.
1674   @retval EFI_DEVICE_ERROR         The device had an error and could not complete
1675                                    the request.
1676   @retval EFI_UNSUPPORTED          The output device is not in a valid text mode.
1677 
1678 **/
1679 EFI_STATUS
1680 EFIAPI
1681 ConSplitterTextOutClearScreen (
1682   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This
1683   );
1684 
1685 /**
1686   Sets the current coordinates of the cursor position
1687 
1688   @param  This                     Protocol instance pointer.
1689   @param  Column                   The column position to set the cursor to. Must be
1690                                    greater than or equal to zero and less than the
1691                                    number of columns by QueryMode ().
1692   @param  Row                      The row position to set the cursor to. Must be
1693                                    greater than or equal to zero and less than the
1694                                    number of rows by QueryMode ().
1695 
1696   @retval EFI_SUCCESS              The operation completed successfully.
1697   @retval EFI_DEVICE_ERROR         The device had an error and could not complete
1698                                    the request.
1699   @retval EFI_UNSUPPORTED          The output device is not in a valid text mode,
1700                                    or the cursor position is invalid for the
1701                                    current mode.
1702 
1703 **/
1704 EFI_STATUS
1705 EFIAPI
1706 ConSplitterTextOutSetCursorPosition (
1707   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1708   IN  UINTN                              Column,
1709   IN  UINTN                              Row
1710   );
1711 
1712 
1713 /**
1714   Makes the cursor visible or invisible
1715 
1716   @param  This                     Protocol instance pointer.
1717   @param  Visible                  If TRUE, the cursor is set to be visible. If
1718                                    FALSE, the cursor is set to be invisible.
1719 
1720   @retval EFI_SUCCESS              The operation completed successfully.
1721   @retval EFI_DEVICE_ERROR         The device had an error and could not complete
1722                                    the request, or the device does not support
1723                                    changing the cursor mode.
1724   @retval EFI_UNSUPPORTED          The output device is not in a valid text mode.
1725 
1726 **/
1727 EFI_STATUS
1728 EFIAPI
1729 ConSplitterTextOutEnableCursor (
1730   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,
1731   IN  BOOLEAN                            Visible
1732   );
1733 
1734 /**
1735   Take the passed in Buffer of size ElementSize and grow the buffer
1736   by CONSOLE_SPLITTER_ALLOC_UNIT * ElementSize bytes.
1737   Copy the current data in Buffer to the new version of Buffer and
1738   free the old version of buffer.
1739 
1740   @param  ElementSize              Size of element in array.
1741   @param  Count                    Current number of elements in array.
1742   @param  Buffer                   Bigger version of passed in Buffer with all the
1743                                    data.
1744 
1745   @retval EFI_SUCCESS              Buffer size has grown.
1746   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
1747 
1748 **/
1749 EFI_STATUS
1750 ConSplitterGrowBuffer (
1751   IN      UINTN                       ElementSize,
1752   IN OUT  UINTN                       *Count,
1753   IN OUT  VOID                        **Buffer
1754   );
1755 
1756 /**
1757   Returns information for an available graphics mode that the graphics device
1758   and the set of active video output devices supports.
1759 
1760   @param  This                  The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
1761   @param  ModeNumber            The mode number to return information on.
1762   @param  SizeOfInfo            A pointer to the size, in bytes, of the Info buffer.
1763   @param  Info                  A pointer to callee allocated buffer that returns information about ModeNumber.
1764 
1765   @retval EFI_SUCCESS           Mode information returned.
1766   @retval EFI_BUFFER_TOO_SMALL  The Info buffer was too small.
1767   @retval EFI_DEVICE_ERROR      A hardware error occurred trying to retrieve the video mode.
1768   @retval EFI_INVALID_PARAMETER One of the input args was NULL.
1769   @retval EFI_OUT_OF_RESOURCES  No resource available.
1770 
1771 **/
1772 EFI_STATUS
1773 EFIAPI
1774 ConSplitterGraphicsOutputQueryMode (
1775   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL          *This,
1776   IN  UINT32                                ModeNumber,
1777   OUT UINTN                                 *SizeOfInfo,
1778   OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info
1779   );
1780 
1781 /**
1782   Set the video device into the specified mode and clears the visible portions of
1783   the output display to black.
1784 
1785   @param  This                  The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
1786   @param  ModeNumber            Abstraction that defines the current video mode.
1787 
1788   @retval EFI_SUCCESS           The graphics mode specified by ModeNumber was selected.
1789   @retval EFI_DEVICE_ERROR      The device had an error and could not complete the request.
1790   @retval EFI_UNSUPPORTED       ModeNumber is not supported by this device.
1791   @retval EFI_OUT_OF_RESOURCES  No resource available.
1792 
1793 **/
1794 EFI_STATUS
1795 EFIAPI
1796 ConSplitterGraphicsOutputSetMode (
1797   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL * This,
1798   IN  UINT32                       ModeNumber
1799   );
1800 
1801 /**
1802   The following table defines actions for BltOperations.
1803 
1804   EfiBltVideoFill - Write data from the  BltBuffer pixel (SourceX, SourceY)
1805   directly to every pixel of the video display rectangle
1806   (DestinationX, DestinationY)
1807   (DestinationX + Width, DestinationY + Height).
1808   Only one pixel will be used from the BltBuffer. Delta is NOT used.
1809   EfiBltVideoToBltBuffer - Read data from the video display rectangle
1810   (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
1811   the BltBuffer rectangle (DestinationX, DestinationY )
1812   (DestinationX + Width, DestinationY + Height). If DestinationX or
1813   DestinationY is not zero then Delta must be set to the length in bytes
1814   of a row in the BltBuffer.
1815   EfiBltBufferToVideo - Write data from the  BltBuffer rectangle
1816   (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
1817   video display rectangle (DestinationX, DestinationY)
1818   (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
1819   not zero then Delta must be set to the length in bytes of a row in the
1820   BltBuffer.
1821   EfiBltVideoToVideo - Copy from the video display rectangle
1822   (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
1823   to the video display rectangle (DestinationX, DestinationY)
1824   (DestinationX + Width, DestinationY + Height).
1825   The BltBuffer and Delta  are not used in this mode.
1826 
1827   @param  This                    Protocol instance pointer.
1828   @param  BltBuffer               Buffer containing data to blit into video buffer.
1829                                   This buffer has a size of
1830                                   Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
1831   @param  BltOperation            Operation to perform on BlitBuffer and video
1832                                   memory
1833   @param  SourceX                 X coordinate of source for the BltBuffer.
1834   @param  SourceY                 Y coordinate of source for the BltBuffer.
1835   @param  DestinationX            X coordinate of destination for the BltBuffer.
1836   @param  DestinationY            Y coordinate of destination for the BltBuffer.
1837   @param  Width                   Width of rectangle in BltBuffer in pixels.
1838   @param  Height                  Hight of rectangle in BltBuffer in pixels.
1839   @param  Delta                   OPTIONAL.
1840 
1841   @retval EFI_SUCCESS             The Blt operation completed.
1842   @retval EFI_INVALID_PARAMETER   BltOperation is not valid.
1843   @retval EFI_DEVICE_ERROR        A hardware error occured writting to the video
1844                                   buffer.
1845 
1846 **/
1847 EFI_STATUS
1848 EFIAPI
1849 ConSplitterGraphicsOutputBlt (
1850   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL                  *This,
1851   IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL                 *BltBuffer, OPTIONAL
1852   IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION             BltOperation,
1853   IN  UINTN                                         SourceX,
1854   IN  UINTN                                         SourceY,
1855   IN  UINTN                                         DestinationX,
1856   IN  UINTN                                         DestinationY,
1857   IN  UINTN                                         Width,
1858   IN  UINTN                                         Height,
1859   IN  UINTN                                         Delta         OPTIONAL
1860   );
1861 
1862 
1863 /**
1864   Return the current video mode information.
1865 
1866   @param  This                  The EFI_UGA_DRAW_PROTOCOL instance.
1867   @param  HorizontalResolution  The size of video screen in pixels in the X dimension.
1868   @param  VerticalResolution    The size of video screen in pixels in the Y dimension.
1869   @param  ColorDepth            Number of bits per pixel, currently defined to be 32.
1870   @param  RefreshRate           The refresh rate of the monitor in Hertz.
1871 
1872   @retval EFI_SUCCESS           Mode information returned.
1873   @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()
1874   @retval EFI_INVALID_PARAMETER One of the input args was NULL.
1875 
1876 **/
1877 EFI_STATUS
1878 EFIAPI
1879 ConSplitterUgaDrawGetMode (
1880   IN  EFI_UGA_DRAW_PROTOCOL           *This,
1881   OUT UINT32                          *HorizontalResolution,
1882   OUT UINT32                          *VerticalResolution,
1883   OUT UINT32                          *ColorDepth,
1884   OUT UINT32                          *RefreshRate
1885   );
1886 
1887 /**
1888   Set the current video mode information.
1889 
1890   @param  This                 The EFI_UGA_DRAW_PROTOCOL instance.
1891   @param  HorizontalResolution The size of video screen in pixels in the X dimension.
1892   @param  VerticalResolution   The size of video screen in pixels in the Y dimension.
1893   @param  ColorDepth           Number of bits per pixel, currently defined to be 32.
1894   @param  RefreshRate          The refresh rate of the monitor in Hertz.
1895 
1896   @retval EFI_SUCCESS          Mode information returned.
1897   @retval EFI_NOT_STARTED      Video display is not initialized. Call SetMode ()
1898   @retval EFI_OUT_OF_RESOURCES Out of resources.
1899 
1900 **/
1901 EFI_STATUS
1902 EFIAPI
1903 ConSplitterUgaDrawSetMode (
1904   IN  EFI_UGA_DRAW_PROTOCOL           *This,
1905   IN UINT32                           HorizontalResolution,
1906   IN UINT32                           VerticalResolution,
1907   IN UINT32                           ColorDepth,
1908   IN UINT32                           RefreshRate
1909   );
1910 
1911 /**
1912   Blt a rectangle of pixels on the graphics screen.
1913 
1914   The following table defines actions for BltOperations.
1915 
1916   EfiUgaVideoFill:
1917     Write data from the  BltBuffer pixel (SourceX, SourceY)
1918     directly to every pixel of the video display rectangle
1919     (DestinationX, DestinationY)
1920     (DestinationX + Width, DestinationY + Height).
1921     Only one pixel will be used from the BltBuffer. Delta is NOT used.
1922   EfiUgaVideoToBltBuffer:
1923     Read data from the video display rectangle
1924     (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
1925     the BltBuffer rectangle (DestinationX, DestinationY )
1926     (DestinationX + Width, DestinationY + Height). If DestinationX or
1927     DestinationY is not zero then Delta must be set to the length in bytes
1928     of a row in the BltBuffer.
1929   EfiUgaBltBufferToVideo:
1930     Write data from the  BltBuffer rectangle
1931     (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
1932     video display rectangle (DestinationX, DestinationY)
1933     (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
1934     not zero then Delta must be set to the length in bytes of a row in the
1935     BltBuffer.
1936   EfiUgaVideoToVideo:
1937     Copy from the video display rectangle
1938     (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
1939     to the video display rectangle (DestinationX, DestinationY)
1940     (DestinationX + Width, DestinationY + Height).
1941     The BltBuffer and Delta  are not used in this mode.
1942 
1943   @param  This           Protocol instance pointer.
1944   @param  BltBuffer      Buffer containing data to blit into video buffer. This
1945                          buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
1946   @param  BltOperation   Operation to perform on BlitBuffer and video memory
1947   @param  SourceX        X coordinate of source for the BltBuffer.
1948   @param  SourceY        Y coordinate of source for the BltBuffer.
1949   @param  DestinationX   X coordinate of destination for the BltBuffer.
1950   @param  DestinationY   Y coordinate of destination for the BltBuffer.
1951   @param  Width          Width of rectangle in BltBuffer in pixels.
1952   @param  Height         Hight of rectangle in BltBuffer in pixels.
1953   @param  Delta          OPTIONAL
1954 
1955   @retval EFI_SUCCESS            The Blt operation completed.
1956   @retval EFI_INVALID_PARAMETER  BltOperation is not valid.
1957   @retval EFI_DEVICE_ERROR       A hardware error occured writting to the video buffer.
1958 
1959 **/
1960 EFI_STATUS
1961 EFIAPI
1962 ConSplitterUgaDrawBlt (
1963   IN  EFI_UGA_DRAW_PROTOCOL                         *This,
1964   IN  EFI_UGA_PIXEL                                 *BltBuffer, OPTIONAL
1965   IN  EFI_UGA_BLT_OPERATION                         BltOperation,
1966   IN  UINTN                                         SourceX,
1967   IN  UINTN                                         SourceY,
1968   IN  UINTN                                         DestinationX,
1969   IN  UINTN                                         DestinationY,
1970   IN  UINTN                                         Width,
1971   IN  UINTN                                         Height,
1972   IN  UINTN                                         Delta         OPTIONAL
1973   );
1974 
1975 /**
1976   Sets the output device(s) to a specified mode.
1977 
1978   @param  Private                 Text Out Splitter pointer.
1979   @param  ModeNumber              The mode number to set.
1980 
1981 **/
1982 VOID
1983 TextOutSetMode (
1984   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,
1985   IN  UINTN                           ModeNumber
1986   );
1987 
1988 /**
1989   An empty function to pass error checking of CreateEventEx ().
1990 
1991   @param  Event                 Event whose notification function is being invoked.
1992   @param  Context               Pointer to the notification function's context,
1993                                 which is implementation-dependent.
1994 
1995 **/
1996 VOID
1997 EFIAPI
1998 ConSplitterEmptyCallbackFunction (
1999   IN EFI_EVENT                Event,
2000   IN VOID                     *Context
2001   );
2002 
2003 
2004 #endif
2005