3 Copyright (c) 2006, Intel Corporation. All rights reserved. <BR>
4 This software and associated documentation (if any) is furnished
5 under a license and may only be used or copied in accordance
6 with the terms of the license. Except as permitted by such
7 license, no part of this software or documentation may be
8 reproduced, stored in a retrieval system, or transmitted in any
9 form or by any means without the express written consent of
18 This driver produces a VGA console.
25 // EFI Driver Binding Protocol for the VGA Class Driver
27 EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding
= {
28 VgaClassDriverBindingSupported
,
29 VgaClassDriverBindingStart
,
30 VgaClassDriverBindingStop
,
37 The user Entry Point for module VgaClass. The user code starts with this function.
39 @param[in] ImageHandle The firmware allocated handle for the EFI image.
40 @param[in] SystemTable A pointer to the EFI System Table.
42 @retval EFI_SUCCESS The entry point is executed successfully.
43 @retval other Some error occurs when executing this entry point.
49 IN EFI_HANDLE ImageHandle
,
50 IN EFI_SYSTEM_TABLE
*SystemTable
56 // Install driver model protocol(s).
58 Status
= EfiLibInstallAllDriverProtocols (
61 &gVgaClassDriverBinding
,
63 &gVgaClassComponentName
,
67 ASSERT_EFI_ERROR (Status
);
76 static CHAR16 CrLfString
[3] = { CHAR_CARRIAGE_RETURN
, CHAR_LINEFEED
, CHAR_NULL
};
85 // This list is used to define the valid extend chars.
86 // It also provides a mapping from Unicode to PCANSI or
87 // ASCII. The ASCII mapping we just made up.
90 STATIC UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii
[] = {
122 BOXDRAW_VERTICAL_RIGHT
,
127 BOXDRAW_VERTICAL_LEFT
,
132 BOXDRAW_DOWN_HORIZONTAL
,
137 BOXDRAW_UP_HORIZONTAL
,
142 BOXDRAW_VERTICAL_HORIZONTAL
,
147 BOXDRAW_DOUBLE_HORIZONTAL
,
152 BOXDRAW_DOUBLE_VERTICAL
,
157 BOXDRAW_DOWN_RIGHT_DOUBLE
,
162 BOXDRAW_DOWN_DOUBLE_RIGHT
,
167 BOXDRAW_DOUBLE_DOWN_RIGHT
,
172 BOXDRAW_DOWN_LEFT_DOUBLE
,
177 BOXDRAW_DOWN_DOUBLE_LEFT
,
182 BOXDRAW_DOUBLE_DOWN_LEFT
,
187 BOXDRAW_UP_RIGHT_DOUBLE
,
192 BOXDRAW_UP_DOUBLE_RIGHT
,
197 BOXDRAW_DOUBLE_UP_RIGHT
,
202 BOXDRAW_UP_LEFT_DOUBLE
,
207 BOXDRAW_UP_DOUBLE_LEFT
,
212 BOXDRAW_DOUBLE_UP_LEFT
,
217 BOXDRAW_VERTICAL_RIGHT_DOUBLE
,
222 BOXDRAW_VERTICAL_DOUBLE_RIGHT
,
227 BOXDRAW_DOUBLE_VERTICAL_RIGHT
,
232 BOXDRAW_VERTICAL_LEFT_DOUBLE
,
237 BOXDRAW_VERTICAL_DOUBLE_LEFT
,
242 BOXDRAW_DOUBLE_VERTICAL_LEFT
,
247 BOXDRAW_DOWN_HORIZONTAL_DOUBLE
,
252 BOXDRAW_DOWN_DOUBLE_HORIZONTAL
,
257 BOXDRAW_DOUBLE_DOWN_HORIZONTAL
,
262 BOXDRAW_UP_HORIZONTAL_DOUBLE
,
267 BOXDRAW_UP_DOUBLE_HORIZONTAL
,
272 BOXDRAW_DOUBLE_UP_HORIZONTAL
,
277 BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE
,
282 BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL
,
287 BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL
,
293 BLOCKELEMENT_FULL_BLOCK
,
298 BLOCKELEMENT_LIGHT_SHADE
,
304 GEOMETRICSHAPE_UP_TRIANGLE
,
309 GEOMETRICSHAPE_RIGHT_TRIANGLE
,
314 GEOMETRICSHAPE_DOWN_TRIANGLE
,
319 GEOMETRICSHAPE_LEFT_TRIANGLE
,
356 // Private worker functions
360 SetVideoCursorPosition (
361 IN VGA_CLASS_DEV
*VgaClassDev
,
370 IN VGA_CLASS_DEV
*VgaClassDev
,
377 LibIsValidTextGraphics (
379 OUT CHAR8
*PcAnsi
, OPTIONAL
380 OUT CHAR8
*Ascii OPTIONAL
397 VgaClassDriverBindingSupported (
398 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
399 IN EFI_HANDLE Controller
,
400 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
410 (Standard DriverBinding Protocol Supported() function)
417 // GC_TODO: This - add argument and description to function comment
418 // GC_TODO: Controller - add argument and description to function comment
419 // GC_TODO: RemainingDevicePath - add argument and description to function comment
422 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
425 // Open the IO Abstraction(s) needed to perform the supported test
427 Status
= gBS
->OpenProtocol (
429 &gEfiVgaMiniPortProtocolGuid
,
430 (VOID
**) &VgaMiniPort
,
431 This
->DriverBindingHandle
,
433 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
435 if (EFI_ERROR (Status
)) {
439 // Open the IO Abstraction(s) needed to perform the supported test
441 Status
= gBS
->OpenProtocol (
443 &gEfiPciIoProtocolGuid
,
445 This
->DriverBindingHandle
,
447 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
449 if (EFI_ERROR (Status
)) {
458 VgaClassDriverBindingStart (
459 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
460 IN EFI_HANDLE Controller
,
461 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
467 Layers the Simple Text Output Protocol on top of the
468 VGA Mini Port Protocol
472 (Standard DriverBinding Protocol Start() function)
479 // GC_TODO: This - add argument and description to function comment
480 // GC_TODO: Controller - add argument and description to function comment
481 // GC_TODO: RemainingDevicePath - add argument and description to function comment
482 // GC_TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
485 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
486 EFI_PCI_IO_PROTOCOL
*PciIo
;
487 VGA_CLASS_DEV
*VgaClassPrivate
;
488 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
490 Status
= gBS
->HandleProtocol (
492 &gEfiDevicePathProtocolGuid
,
493 (VOID
**) &DevicePath
495 if (EFI_ERROR (Status
)) {
499 // Report that VGA Class driver is being enabled
501 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
503 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_ENABLE
,
508 // Open the IO Abstraction(s) needed
510 Status
= gBS
->OpenProtocol (
512 &gEfiPciIoProtocolGuid
,
514 This
->DriverBindingHandle
,
516 EFI_OPEN_PROTOCOL_GET_PROTOCOL
518 if (EFI_ERROR (Status
)) {
522 Status
= gBS
->OpenProtocol (
524 &gEfiVgaMiniPortProtocolGuid
,
525 (VOID
**) &VgaMiniPort
,
526 This
->DriverBindingHandle
,
528 EFI_OPEN_PROTOCOL_BY_DRIVER
530 if (EFI_ERROR (Status
)) {
534 // Allocate the private device structure
536 Status
= gBS
->AllocatePool (
538 sizeof (VGA_CLASS_DEV
),
539 (VOID
**) &VgaClassPrivate
541 if (EFI_ERROR (Status
)) {
544 &gEfiVgaMiniPortProtocolGuid
,
545 This
->DriverBindingHandle
,
548 return EFI_OUT_OF_RESOURCES
;
551 ZeroMem (VgaClassPrivate
, sizeof (VGA_CLASS_DEV
));
554 // Initialize the private device structure
556 VgaClassPrivate
->Signature
= VGA_CLASS_DEV_SIGNATURE
;
557 VgaClassPrivate
->Handle
= Controller
;
558 VgaClassPrivate
->VgaMiniPort
= VgaMiniPort
;
559 VgaClassPrivate
->PciIo
= PciIo
;
561 VgaClassPrivate
->SimpleTextOut
.Reset
= VgaClassReset
;
562 VgaClassPrivate
->SimpleTextOut
.OutputString
= VgaClassOutputString
;
563 VgaClassPrivate
->SimpleTextOut
.TestString
= VgaClassTestString
;
564 VgaClassPrivate
->SimpleTextOut
.ClearScreen
= VgaClassClearScreen
;
565 VgaClassPrivate
->SimpleTextOut
.SetAttribute
= VgaClassSetAttribute
;
566 VgaClassPrivate
->SimpleTextOut
.SetCursorPosition
= VgaClassSetCursorPosition
;
567 VgaClassPrivate
->SimpleTextOut
.EnableCursor
= VgaClassEnableCursor
;
568 VgaClassPrivate
->SimpleTextOut
.QueryMode
= VgaClassQueryMode
;
569 VgaClassPrivate
->SimpleTextOut
.SetMode
= VgaClassSetMode
;
571 VgaClassPrivate
->SimpleTextOut
.Mode
= &VgaClassPrivate
->SimpleTextOutputMode
;
572 VgaClassPrivate
->SimpleTextOutputMode
.MaxMode
= VgaMiniPort
->MaxMode
;
573 VgaClassPrivate
->DevicePath
= DevicePath
;
575 Status
= VgaClassPrivate
->SimpleTextOut
.SetAttribute (
576 &VgaClassPrivate
->SimpleTextOut
,
577 EFI_TEXT_ATTR (EFI_WHITE
,
580 if (EFI_ERROR (Status
)) {
584 Status
= VgaClassPrivate
->SimpleTextOut
.Reset (
585 &VgaClassPrivate
->SimpleTextOut
,
588 if (EFI_ERROR (Status
)) {
592 Status
= VgaClassPrivate
->SimpleTextOut
.EnableCursor (
593 &VgaClassPrivate
->SimpleTextOut
,
596 if (EFI_ERROR (Status
)) {
600 Status
= gBS
->InstallMultipleProtocolInterfaces (
602 &gEfiSimpleTextOutProtocolGuid
,
603 &VgaClassPrivate
->SimpleTextOut
,
610 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
611 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
612 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_EC_CONTROLLER_ERROR
,
622 VgaClassDriverBindingStop (
623 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
624 IN EFI_HANDLE Controller
,
625 IN UINTN NumberOfChildren
,
626 IN EFI_HANDLE
*ChildHandleBuffer
636 (Standard DriverBinding Protocol Stop() function)
643 // GC_TODO: This - add argument and description to function comment
644 // GC_TODO: Controller - add argument and description to function comment
645 // GC_TODO: NumberOfChildren - add argument and description to function comment
646 // GC_TODO: ChildHandleBuffer - add argument and description to function comment
647 // GC_TODO: EFI_SUCCESS - add return value to function comment
650 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*SimpleTextOut
;
651 VGA_CLASS_DEV
*VgaClassPrivate
;
653 Status
= gBS
->OpenProtocol (
655 &gEfiSimpleTextOutProtocolGuid
,
656 (VOID
**) &SimpleTextOut
,
657 This
->DriverBindingHandle
,
659 EFI_OPEN_PROTOCOL_GET_PROTOCOL
661 if (EFI_ERROR (Status
)) {
665 VgaClassPrivate
= VGA_CLASS_DEV_FROM_THIS (SimpleTextOut
);
668 // Report that VGA Class driver is being disabled
670 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
672 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_DISABLE
,
673 VgaClassPrivate
->DevicePath
676 Status
= gBS
->UninstallProtocolInterface (
678 &gEfiSimpleTextOutProtocolGuid
,
679 &VgaClassPrivate
->SimpleTextOut
681 if (EFI_ERROR (Status
)) {
685 // Release PCI I/O and VGA Mini Port Protocols on the controller handle.
689 &gEfiPciIoProtocolGuid
,
690 This
->DriverBindingHandle
,
696 &gEfiVgaMiniPortProtocolGuid
,
697 This
->DriverBindingHandle
,
701 gBS
->FreePool (VgaClassPrivate
);
706 // Simple Text Output Protocol Functions
711 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
712 IN BOOLEAN ExtendedVerification
718 GC_TODO: Add function description
722 This - GC_TODO: add argument description
723 ExtendedVerification - GC_TODO: add argument description
727 GC_TODO: add return values
732 VGA_CLASS_DEV
*VgaClassPrivate
;
734 VgaClassPrivate
= VGA_CLASS_DEV_FROM_THIS (This
);
736 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
738 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_RESET
,
739 VgaClassPrivate
->DevicePath
742 This
->SetAttribute (This
, EFI_TEXT_ATTR (This
->Mode
->Attribute
& 0x0F, EFI_BACKGROUND_BLACK
));
744 Status
= This
->SetMode (This
, 0);
745 if (EFI_ERROR (Status
)) {
749 return This
->ClearScreen (This
);
754 VgaClassOutputString (
755 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
762 GC_TODO: Add function description
766 This - GC_TODO: add argument description
767 WString - GC_TODO: add argument description
771 EFI_SUCCESS - GC_TODO: Add description for return value
776 VGA_CLASS_DEV
*VgaClassDev
;
777 EFI_SIMPLE_TEXT_OUTPUT_MODE
*Mode
;
783 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
787 Status
= This
->QueryMode (
793 if (EFI_ERROR (Status
)) {
797 for (; *WString
!= CHAR_NULL
; WString
++) {
801 if (Mode
->CursorColumn
> 0) {
802 Mode
->CursorColumn
--;
807 if (Mode
->CursorRow
== (INT32
) (MaxRow
- 1)) {
809 // Scroll the screen by copying the contents
810 // of the VGA display up one line
812 VgaClassDev
->PciIo
->CopyMem (
815 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
816 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
,
817 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
818 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ MaxColumn
* 2,
819 ((MaxRow
- 1) * MaxColumn
) >> 1
823 // Print Blank Line of spaces with the current color attributes
825 VideoChar
= (Mode
->Attribute
<< 8) | ' ';
826 VideoChar
= (VideoChar
<< 16) | VideoChar
;
827 VgaClassDev
->PciIo
->Mem
.Write (
829 EfiPciIoWidthFillUint32
,
830 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
831 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ (MaxRow
- 1) * MaxColumn
* 2,
837 if (Mode
->CursorRow
< (INT32
) (MaxRow
- 1)) {
842 case CHAR_CARRIAGE_RETURN
:
843 Mode
->CursorColumn
= 0;
847 if (!LibIsValidTextGraphics (*WString
, &GraphicChar
, NULL
)) {
849 // Just convert to ASCII
851 GraphicChar
= (CHAR8
) *WString
;
852 if (!IsValidAscii (GraphicChar
)) {
854 // Keep the API from supporting PCANSI Graphics chars
860 VideoChar
= (Mode
->Attribute
<< 8) | GraphicChar
;
861 VgaClassDev
->PciIo
->Mem
.Write (
864 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
865 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ ((Mode
->CursorRow
* MaxColumn
+ Mode
->CursorColumn
) * 2),
870 if (Mode
->CursorColumn
>= (INT32
) (MaxColumn
- 1)) {
871 This
->OutputString (This
, CrLfString
);
873 Mode
->CursorColumn
++;
879 SetVideoCursorPosition (
881 (UINTN
) Mode
->CursorColumn
,
882 (UINTN
) Mode
->CursorRow
,
892 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
899 GC_TODO: Add function description
903 This - GC_TODO: add argument description
904 WString - GC_TODO: add argument description
908 EFI_UNSUPPORTED - GC_TODO: Add description for return value
909 EFI_SUCCESS - GC_TODO: Add description for return value
913 while (*WString
!= 0x0000) {
914 if (!(IsValidAscii (*WString
) || IsValidEfiCntlChar (*WString
) || LibIsValidTextGraphics (*WString
, NULL
, NULL
))) {
915 return EFI_UNSUPPORTED
;
926 VgaClassClearScreen (
927 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
933 GC_TODO: Add function description
937 This - GC_TODO: add argument description
941 EFI_SUCCESS - GC_TODO: Add description for return value
946 VGA_CLASS_DEV
*VgaClassDev
;
951 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
953 Status
= This
->QueryMode (
959 if (EFI_ERROR (Status
)) {
963 VideoChar
= (This
->Mode
->Attribute
<< 8) | ' ';
964 VideoChar
= (VideoChar
<< 16) | VideoChar
;
965 VgaClassDev
->PciIo
->Mem
.Write (
967 EfiPciIoWidthFillUint32
,
968 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
969 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
,
970 (MaxRow
* MaxColumn
) >> 1,
974 This
->SetCursorPosition (This
, 0, 0);
981 VgaClassSetAttribute (
982 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
989 GC_TODO: Add function description
993 This - GC_TODO: add argument description
994 Attribute - GC_TODO: add argument description
998 EFI_SUCCESS - GC_TODO: Add description for return value
999 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1003 if (Attribute
<= EFI_MAX_ATTRIBUTE
) {
1004 This
->Mode
->Attribute
= (INT32
) Attribute
;
1008 return EFI_UNSUPPORTED
;
1013 VgaClassSetCursorPosition (
1014 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1020 Routine Description:
1022 GC_TODO: Add function description
1026 This - GC_TODO: add argument description
1027 Column - GC_TODO: add argument description
1028 Row - GC_TODO: add argument description
1032 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1033 EFI_SUCCESS - GC_TODO: Add description for return value
1038 VGA_CLASS_DEV
*VgaClassDev
;
1042 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1044 Status
= This
->QueryMode (
1050 if (EFI_ERROR (Status
)) {
1054 if (Column
>= MaxColumn
|| Row
>= MaxRow
) {
1055 return EFI_UNSUPPORTED
;
1058 SetVideoCursorPosition (VgaClassDev
, Column
, Row
, MaxColumn
);
1060 This
->Mode
->CursorColumn
= (INT32
) Column
;
1061 This
->Mode
->CursorRow
= (INT32
) Row
;
1068 VgaClassEnableCursor (
1069 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1074 Routine Description:
1076 GC_TODO: Add function description
1080 This - GC_TODO: add argument description
1081 Visible - GC_TODO: add argument description
1085 EFI_SUCCESS - GC_TODO: Add description for return value
1089 VGA_CLASS_DEV
*VgaClassDev
;
1091 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1093 switch (This
->Mode
->Mode
) {
1095 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x06);
1096 WriteCrtc (VgaClassDev
, CRTC_CURSOR_END
, 0x07);
1100 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x0e);
1101 WriteCrtc (VgaClassDev
, CRTC_CURSOR_END
, 0x0f);
1105 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x20);
1108 This
->Mode
->CursorVisible
= Visible
;
1115 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1116 IN UINTN ModeNumber
,
1122 Routine Description:
1124 GC_TODO: Add function description
1128 This - GC_TODO: add argument description
1129 ModeNumber - GC_TODO: add argument description
1130 Columns - GC_TODO: add argument description
1131 Rows - GC_TODO: add argument description
1135 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1136 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1137 EFI_SUCCESS - GC_TODO: Add description for return value
1141 if ((INT32
) ModeNumber
>= This
->Mode
->MaxMode
) {
1144 return EFI_UNSUPPORTED
;
1147 switch (ModeNumber
) {
1161 return EFI_UNSUPPORTED
;
1170 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1175 Routine Description:
1177 GC_TODO: Add function description
1181 This - GC_TODO: add argument description
1182 ModeNumber - GC_TODO: add argument description
1186 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1191 VGA_CLASS_DEV
*VgaClassDev
;
1193 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1195 if ((INT32
) ModeNumber
>= This
->Mode
->MaxMode
) {
1196 return EFI_UNSUPPORTED
;
1199 This
->ClearScreen (This
);
1201 This
->Mode
->Mode
= (INT32
) ModeNumber
;
1203 Status
= VgaClassDev
->VgaMiniPort
->SetMode (VgaClassDev
->VgaMiniPort
, ModeNumber
);
1208 // Private Worker Functions
1212 SetVideoCursorPosition (
1213 IN VGA_CLASS_DEV
*VgaClassDev
,
1220 Routine Description:
1222 GC_TODO: Add function description
1226 VgaClassDev - GC_TODO: add argument description
1227 Column - GC_TODO: add argument description
1228 Row - GC_TODO: add argument description
1229 MaxColumn - GC_TODO: add argument description
1233 GC_TODO: add return values
1237 Column
= Column
& 0xff;
1239 MaxColumn
= MaxColumn
& 0xff;
1242 CRTC_CURSOR_LOCATION_HIGH
,
1243 (UINT8
) ((Row
* MaxColumn
+ Column
) >> 8)
1247 CRTC_CURSOR_LOCATION_LOW
,
1248 (UINT8
) ((Row
* MaxColumn
+ Column
) & 0xff)
1255 IN VGA_CLASS_DEV
*VgaClassDev
,
1261 Routine Description:
1263 GC_TODO: Add function description
1267 VgaClassDev - GC_TODO: add argument description
1268 Address - GC_TODO: add argument description
1269 Data - GC_TODO: add argument description
1273 GC_TODO: add return values
1277 VgaClassDev
->PciIo
->Io
.Write (
1280 VgaClassDev
->VgaMiniPort
->CrtcAddressRegisterBar
,
1281 VgaClassDev
->VgaMiniPort
->CrtcAddressRegisterOffset
,
1286 VgaClassDev
->PciIo
->Io
.Write (
1289 VgaClassDev
->VgaMiniPort
->CrtcDataRegisterBar
,
1290 VgaClassDev
->VgaMiniPort
->CrtcDataRegisterOffset
,
1298 LibIsValidTextGraphics (
1300 OUT CHAR8
*PcAnsi
, OPTIONAL
1301 OUT CHAR8
*Ascii OPTIONAL
1305 Routine Description:
1307 Detects if a Unicode char is for Box Drawing text graphics.
1311 Grphic - Unicode char to test.
1313 PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.
1315 Asci - Optional pointer to return Ascii equivalent of Graphic.
1319 TRUE if Gpaphic is a supported Unicode Box Drawing character.
1322 // GC_TODO: Graphic - add argument and description to function comment
1324 UNICODE_TO_CHAR
*Table
;
1326 if ((((Graphic
& 0xff00) != 0x2500) && ((Graphic
& 0xff00) != 0x2100))) {
1328 // Unicode drawing code charts are all in the 0x25xx range,
1329 // arrows are 0x21xx
1334 for (Table
= UnicodeToPcAnsiOrAscii
; Table
->Unicode
!= 0x0000; Table
++) {
1335 if (Graphic
== Table
->Unicode
) {
1337 *PcAnsi
= Table
->PcAnsi
;
1341 *Ascii
= Table
->Ascii
;
1358 Routine Description:
1360 GC_TODO: Add function description
1364 Ascii - GC_TODO: add argument description
1368 GC_TODO: add return values
1372 if ((Ascii
>= 0x20) && (Ascii
<= 0x7f)) {
1381 IsValidEfiCntlChar (
1386 Routine Description:
1388 GC_TODO: Add function description
1392 c - GC_TODO: add argument description
1396 GC_TODO: add return values
1400 if (c
== CHAR_NULL
|| c
== CHAR_BACKSPACE
|| c
== CHAR_LINEFEED
|| c
== CHAR_CARRIAGE_RETURN
) {