2 This driver produces a VGA console.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
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.
18 // EFI Driver Binding Protocol for the VGA Class Driver
20 EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding
= {
21 VgaClassDriverBindingSupported
,
22 VgaClassDriverBindingStart
,
23 VgaClassDriverBindingStop
,
30 The user Entry Point for module VgaClass. The user code starts with this function.
32 @param[in] ImageHandle The firmware allocated handle for the EFI image.
33 @param[in] SystemTable A pointer to the EFI System Table.
35 @retval EFI_SUCCESS The entry point is executed successfully.
36 @retval other Some error occurs when executing this entry point.
42 IN EFI_HANDLE ImageHandle
,
43 IN EFI_SYSTEM_TABLE
*SystemTable
49 // Install driver model protocol(s).
51 Status
= EfiLibInstallAllDriverProtocols (
54 &gVgaClassDriverBinding
,
56 &gVgaClassComponentName
,
60 ASSERT_EFI_ERROR (Status
);
69 static CHAR16 CrLfString
[3] = { CHAR_CARRIAGE_RETURN
, CHAR_LINEFEED
, CHAR_NULL
};
78 // This list is used to define the valid extend chars.
79 // It also provides a mapping from Unicode to PCANSI or
80 // ASCII. The ASCII mapping we just made up.
83 STATIC UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii
[] = {
115 BOXDRAW_VERTICAL_RIGHT
,
120 BOXDRAW_VERTICAL_LEFT
,
125 BOXDRAW_DOWN_HORIZONTAL
,
130 BOXDRAW_UP_HORIZONTAL
,
135 BOXDRAW_VERTICAL_HORIZONTAL
,
140 BOXDRAW_DOUBLE_HORIZONTAL
,
145 BOXDRAW_DOUBLE_VERTICAL
,
150 BOXDRAW_DOWN_RIGHT_DOUBLE
,
155 BOXDRAW_DOWN_DOUBLE_RIGHT
,
160 BOXDRAW_DOUBLE_DOWN_RIGHT
,
165 BOXDRAW_DOWN_LEFT_DOUBLE
,
170 BOXDRAW_DOWN_DOUBLE_LEFT
,
175 BOXDRAW_DOUBLE_DOWN_LEFT
,
180 BOXDRAW_UP_RIGHT_DOUBLE
,
185 BOXDRAW_UP_DOUBLE_RIGHT
,
190 BOXDRAW_DOUBLE_UP_RIGHT
,
195 BOXDRAW_UP_LEFT_DOUBLE
,
200 BOXDRAW_UP_DOUBLE_LEFT
,
205 BOXDRAW_DOUBLE_UP_LEFT
,
210 BOXDRAW_VERTICAL_RIGHT_DOUBLE
,
215 BOXDRAW_VERTICAL_DOUBLE_RIGHT
,
220 BOXDRAW_DOUBLE_VERTICAL_RIGHT
,
225 BOXDRAW_VERTICAL_LEFT_DOUBLE
,
230 BOXDRAW_VERTICAL_DOUBLE_LEFT
,
235 BOXDRAW_DOUBLE_VERTICAL_LEFT
,
240 BOXDRAW_DOWN_HORIZONTAL_DOUBLE
,
245 BOXDRAW_DOWN_DOUBLE_HORIZONTAL
,
250 BOXDRAW_DOUBLE_DOWN_HORIZONTAL
,
255 BOXDRAW_UP_HORIZONTAL_DOUBLE
,
260 BOXDRAW_UP_DOUBLE_HORIZONTAL
,
265 BOXDRAW_DOUBLE_UP_HORIZONTAL
,
270 BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE
,
275 BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL
,
280 BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL
,
286 BLOCKELEMENT_FULL_BLOCK
,
291 BLOCKELEMENT_LIGHT_SHADE
,
297 GEOMETRICSHAPE_UP_TRIANGLE
,
302 GEOMETRICSHAPE_RIGHT_TRIANGLE
,
307 GEOMETRICSHAPE_DOWN_TRIANGLE
,
312 GEOMETRICSHAPE_LEFT_TRIANGLE
,
349 // Private worker functions
353 SetVideoCursorPosition (
354 IN VGA_CLASS_DEV
*VgaClassDev
,
363 IN VGA_CLASS_DEV
*VgaClassDev
,
370 LibIsValidTextGraphics (
372 OUT CHAR8
*PcAnsi
, OPTIONAL
373 OUT CHAR8
*Ascii OPTIONAL
390 VgaClassDriverBindingSupported (
391 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
392 IN EFI_HANDLE Controller
,
393 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
403 (Standard DriverBinding Protocol Supported() function)
410 // GC_TODO: This - add argument and description to function comment
411 // GC_TODO: Controller - add argument and description to function comment
412 // GC_TODO: RemainingDevicePath - add argument and description to function comment
415 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
418 // Open the IO Abstraction(s) needed to perform the supported test
420 Status
= gBS
->OpenProtocol (
422 &gEfiVgaMiniPortProtocolGuid
,
423 (VOID
**) &VgaMiniPort
,
424 This
->DriverBindingHandle
,
426 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
428 if (EFI_ERROR (Status
)) {
432 // Open the IO Abstraction(s) needed to perform the supported test
434 Status
= gBS
->OpenProtocol (
436 &gEfiPciIoProtocolGuid
,
438 This
->DriverBindingHandle
,
440 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
442 if (EFI_ERROR (Status
)) {
451 VgaClassDriverBindingStart (
452 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
453 IN EFI_HANDLE Controller
,
454 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
460 Layers the Simple Text Output Protocol on top of the
461 VGA Mini Port Protocol
465 (Standard DriverBinding Protocol Start() function)
472 // GC_TODO: This - add argument and description to function comment
473 // GC_TODO: Controller - add argument and description to function comment
474 // GC_TODO: RemainingDevicePath - add argument and description to function comment
475 // GC_TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
478 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
479 EFI_PCI_IO_PROTOCOL
*PciIo
;
480 VGA_CLASS_DEV
*VgaClassPrivate
;
481 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
483 Status
= gBS
->HandleProtocol (
485 &gEfiDevicePathProtocolGuid
,
486 (VOID
**) &DevicePath
488 if (EFI_ERROR (Status
)) {
492 // Report that VGA Class driver is being enabled
494 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
496 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_ENABLE
,
501 // Open the IO Abstraction(s) needed
503 Status
= gBS
->OpenProtocol (
505 &gEfiPciIoProtocolGuid
,
507 This
->DriverBindingHandle
,
509 EFI_OPEN_PROTOCOL_GET_PROTOCOL
511 if (EFI_ERROR (Status
)) {
515 Status
= gBS
->OpenProtocol (
517 &gEfiVgaMiniPortProtocolGuid
,
518 (VOID
**) &VgaMiniPort
,
519 This
->DriverBindingHandle
,
521 EFI_OPEN_PROTOCOL_BY_DRIVER
523 if (EFI_ERROR (Status
)) {
527 // Allocate the private device structure
529 Status
= gBS
->AllocatePool (
531 sizeof (VGA_CLASS_DEV
),
532 (VOID
**) &VgaClassPrivate
534 if (EFI_ERROR (Status
)) {
537 &gEfiVgaMiniPortProtocolGuid
,
538 This
->DriverBindingHandle
,
541 return EFI_OUT_OF_RESOURCES
;
544 ZeroMem (VgaClassPrivate
, sizeof (VGA_CLASS_DEV
));
547 // Initialize the private device structure
549 VgaClassPrivate
->Signature
= VGA_CLASS_DEV_SIGNATURE
;
550 VgaClassPrivate
->Handle
= Controller
;
551 VgaClassPrivate
->VgaMiniPort
= VgaMiniPort
;
552 VgaClassPrivate
->PciIo
= PciIo
;
554 VgaClassPrivate
->SimpleTextOut
.Reset
= VgaClassReset
;
555 VgaClassPrivate
->SimpleTextOut
.OutputString
= VgaClassOutputString
;
556 VgaClassPrivate
->SimpleTextOut
.TestString
= VgaClassTestString
;
557 VgaClassPrivate
->SimpleTextOut
.ClearScreen
= VgaClassClearScreen
;
558 VgaClassPrivate
->SimpleTextOut
.SetAttribute
= VgaClassSetAttribute
;
559 VgaClassPrivate
->SimpleTextOut
.SetCursorPosition
= VgaClassSetCursorPosition
;
560 VgaClassPrivate
->SimpleTextOut
.EnableCursor
= VgaClassEnableCursor
;
561 VgaClassPrivate
->SimpleTextOut
.QueryMode
= VgaClassQueryMode
;
562 VgaClassPrivate
->SimpleTextOut
.SetMode
= VgaClassSetMode
;
564 VgaClassPrivate
->SimpleTextOut
.Mode
= &VgaClassPrivate
->SimpleTextOutputMode
;
565 VgaClassPrivate
->SimpleTextOutputMode
.MaxMode
= VgaMiniPort
->MaxMode
;
566 VgaClassPrivate
->DevicePath
= DevicePath
;
568 Status
= VgaClassPrivate
->SimpleTextOut
.SetAttribute (
569 &VgaClassPrivate
->SimpleTextOut
,
570 EFI_TEXT_ATTR (EFI_WHITE
,
573 if (EFI_ERROR (Status
)) {
577 Status
= VgaClassPrivate
->SimpleTextOut
.Reset (
578 &VgaClassPrivate
->SimpleTextOut
,
581 if (EFI_ERROR (Status
)) {
585 Status
= VgaClassPrivate
->SimpleTextOut
.EnableCursor (
586 &VgaClassPrivate
->SimpleTextOut
,
589 if (EFI_ERROR (Status
)) {
593 Status
= gBS
->InstallMultipleProtocolInterfaces (
595 &gEfiSimpleTextOutProtocolGuid
,
596 &VgaClassPrivate
->SimpleTextOut
,
603 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
604 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
605 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_EC_CONTROLLER_ERROR
,
615 VgaClassDriverBindingStop (
616 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
617 IN EFI_HANDLE Controller
,
618 IN UINTN NumberOfChildren
,
619 IN EFI_HANDLE
*ChildHandleBuffer
629 (Standard DriverBinding Protocol Stop() function)
636 // GC_TODO: This - add argument and description to function comment
637 // GC_TODO: Controller - add argument and description to function comment
638 // GC_TODO: NumberOfChildren - add argument and description to function comment
639 // GC_TODO: ChildHandleBuffer - add argument and description to function comment
640 // GC_TODO: EFI_SUCCESS - add return value to function comment
643 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*SimpleTextOut
;
644 VGA_CLASS_DEV
*VgaClassPrivate
;
646 Status
= gBS
->OpenProtocol (
648 &gEfiSimpleTextOutProtocolGuid
,
649 (VOID
**) &SimpleTextOut
,
650 This
->DriverBindingHandle
,
652 EFI_OPEN_PROTOCOL_GET_PROTOCOL
654 if (EFI_ERROR (Status
)) {
658 VgaClassPrivate
= VGA_CLASS_DEV_FROM_THIS (SimpleTextOut
);
661 // Report that VGA Class driver is being disabled
663 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
665 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_DISABLE
,
666 VgaClassPrivate
->DevicePath
669 Status
= gBS
->UninstallProtocolInterface (
671 &gEfiSimpleTextOutProtocolGuid
,
672 &VgaClassPrivate
->SimpleTextOut
674 if (EFI_ERROR (Status
)) {
678 // Release PCI I/O and VGA Mini Port Protocols on the controller handle.
682 &gEfiPciIoProtocolGuid
,
683 This
->DriverBindingHandle
,
689 &gEfiVgaMiniPortProtocolGuid
,
690 This
->DriverBindingHandle
,
694 gBS
->FreePool (VgaClassPrivate
);
699 // Simple Text Output Protocol Functions
704 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
705 IN BOOLEAN ExtendedVerification
711 GC_TODO: Add function description
715 This - GC_TODO: add argument description
716 ExtendedVerification - GC_TODO: add argument description
720 GC_TODO: add return values
725 VGA_CLASS_DEV
*VgaClassPrivate
;
727 VgaClassPrivate
= VGA_CLASS_DEV_FROM_THIS (This
);
729 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
731 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_RESET
,
732 VgaClassPrivate
->DevicePath
735 This
->SetAttribute (This
, EFI_TEXT_ATTR (This
->Mode
->Attribute
& 0x0F, EFI_BACKGROUND_BLACK
));
737 Status
= This
->SetMode (This
, 0);
738 if (EFI_ERROR (Status
)) {
742 return This
->ClearScreen (This
);
747 VgaClassOutputString (
748 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
755 GC_TODO: Add function description
759 This - GC_TODO: add argument description
760 WString - GC_TODO: add argument description
764 EFI_SUCCESS - GC_TODO: Add description for return value
769 VGA_CLASS_DEV
*VgaClassDev
;
770 EFI_SIMPLE_TEXT_OUTPUT_MODE
*Mode
;
776 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
780 Status
= This
->QueryMode (
786 if (EFI_ERROR (Status
)) {
790 for (; *WString
!= CHAR_NULL
; WString
++) {
794 if (Mode
->CursorColumn
> 0) {
795 Mode
->CursorColumn
--;
800 if (Mode
->CursorRow
== (INT32
) (MaxRow
- 1)) {
802 // Scroll the screen by copying the contents
803 // of the VGA display up one line
805 VgaClassDev
->PciIo
->CopyMem (
808 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
809 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
,
810 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
811 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ MaxColumn
* 2,
812 ((MaxRow
- 1) * MaxColumn
) >> 1
816 // Print Blank Line of spaces with the current color attributes
818 VideoChar
= (Mode
->Attribute
<< 8) | ' ';
819 VideoChar
= (VideoChar
<< 16) | VideoChar
;
820 VgaClassDev
->PciIo
->Mem
.Write (
822 EfiPciIoWidthFillUint32
,
823 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
824 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ (MaxRow
- 1) * MaxColumn
* 2,
830 if (Mode
->CursorRow
< (INT32
) (MaxRow
- 1)) {
835 case CHAR_CARRIAGE_RETURN
:
836 Mode
->CursorColumn
= 0;
840 if (!LibIsValidTextGraphics (*WString
, &GraphicChar
, NULL
)) {
842 // Just convert to ASCII
844 GraphicChar
= (CHAR8
) *WString
;
845 if (!IsValidAscii (GraphicChar
)) {
847 // Keep the API from supporting PCANSI Graphics chars
853 VideoChar
= (Mode
->Attribute
<< 8) | GraphicChar
;
854 VgaClassDev
->PciIo
->Mem
.Write (
857 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
858 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ ((Mode
->CursorRow
* MaxColumn
+ Mode
->CursorColumn
) * 2),
863 if (Mode
->CursorColumn
>= (INT32
) (MaxColumn
- 1)) {
864 This
->OutputString (This
, CrLfString
);
866 Mode
->CursorColumn
++;
872 SetVideoCursorPosition (
874 (UINTN
) Mode
->CursorColumn
,
875 (UINTN
) Mode
->CursorRow
,
885 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
892 GC_TODO: Add function description
896 This - GC_TODO: add argument description
897 WString - GC_TODO: add argument description
901 EFI_UNSUPPORTED - GC_TODO: Add description for return value
902 EFI_SUCCESS - GC_TODO: Add description for return value
906 while (*WString
!= 0x0000) {
907 if (!(IsValidAscii (*WString
) || IsValidEfiCntlChar (*WString
) || LibIsValidTextGraphics (*WString
, NULL
, NULL
))) {
908 return EFI_UNSUPPORTED
;
919 VgaClassClearScreen (
920 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
926 GC_TODO: Add function description
930 This - GC_TODO: add argument description
934 EFI_SUCCESS - GC_TODO: Add description for return value
939 VGA_CLASS_DEV
*VgaClassDev
;
944 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
946 Status
= This
->QueryMode (
952 if (EFI_ERROR (Status
)) {
956 VideoChar
= (This
->Mode
->Attribute
<< 8) | ' ';
957 VideoChar
= (VideoChar
<< 16) | VideoChar
;
958 VgaClassDev
->PciIo
->Mem
.Write (
960 EfiPciIoWidthFillUint32
,
961 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
962 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
,
963 (MaxRow
* MaxColumn
) >> 1,
967 This
->SetCursorPosition (This
, 0, 0);
974 VgaClassSetAttribute (
975 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
982 GC_TODO: Add function description
986 This - GC_TODO: add argument description
987 Attribute - GC_TODO: add argument description
991 EFI_SUCCESS - GC_TODO: Add description for return value
992 EFI_UNSUPPORTED - GC_TODO: Add description for return value
996 if (Attribute
<= EFI_MAX_ATTRIBUTE
) {
997 This
->Mode
->Attribute
= (INT32
) Attribute
;
1001 return EFI_UNSUPPORTED
;
1006 VgaClassSetCursorPosition (
1007 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1013 Routine Description:
1015 GC_TODO: Add function description
1019 This - GC_TODO: add argument description
1020 Column - GC_TODO: add argument description
1021 Row - GC_TODO: add argument description
1025 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1026 EFI_SUCCESS - GC_TODO: Add description for return value
1031 VGA_CLASS_DEV
*VgaClassDev
;
1035 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1037 Status
= This
->QueryMode (
1043 if (EFI_ERROR (Status
)) {
1047 if (Column
>= MaxColumn
|| Row
>= MaxRow
) {
1048 return EFI_UNSUPPORTED
;
1051 SetVideoCursorPosition (VgaClassDev
, Column
, Row
, MaxColumn
);
1053 This
->Mode
->CursorColumn
= (INT32
) Column
;
1054 This
->Mode
->CursorRow
= (INT32
) Row
;
1061 VgaClassEnableCursor (
1062 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1067 Routine Description:
1069 GC_TODO: Add function description
1073 This - GC_TODO: add argument description
1074 Visible - GC_TODO: add argument description
1078 EFI_SUCCESS - GC_TODO: Add description for return value
1082 VGA_CLASS_DEV
*VgaClassDev
;
1084 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1086 switch (This
->Mode
->Mode
) {
1088 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x06);
1089 WriteCrtc (VgaClassDev
, CRTC_CURSOR_END
, 0x07);
1093 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x0e);
1094 WriteCrtc (VgaClassDev
, CRTC_CURSOR_END
, 0x0f);
1098 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x20);
1101 This
->Mode
->CursorVisible
= Visible
;
1108 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1109 IN UINTN ModeNumber
,
1115 Routine Description:
1117 GC_TODO: Add function description
1121 This - GC_TODO: add argument description
1122 ModeNumber - GC_TODO: add argument description
1123 Columns - GC_TODO: add argument description
1124 Rows - GC_TODO: add argument description
1128 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1129 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1130 EFI_SUCCESS - GC_TODO: Add description for return value
1134 if ((INT32
) ModeNumber
>= This
->Mode
->MaxMode
) {
1137 return EFI_UNSUPPORTED
;
1140 switch (ModeNumber
) {
1154 return EFI_UNSUPPORTED
;
1163 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1168 Routine Description:
1170 GC_TODO: Add function description
1174 This - GC_TODO: add argument description
1175 ModeNumber - GC_TODO: add argument description
1179 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1184 VGA_CLASS_DEV
*VgaClassDev
;
1186 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1188 if ((INT32
) ModeNumber
>= This
->Mode
->MaxMode
) {
1189 return EFI_UNSUPPORTED
;
1192 This
->ClearScreen (This
);
1194 This
->Mode
->Mode
= (INT32
) ModeNumber
;
1196 Status
= VgaClassDev
->VgaMiniPort
->SetMode (VgaClassDev
->VgaMiniPort
, ModeNumber
);
1201 // Private Worker Functions
1205 SetVideoCursorPosition (
1206 IN VGA_CLASS_DEV
*VgaClassDev
,
1213 Routine Description:
1215 GC_TODO: Add function description
1219 VgaClassDev - GC_TODO: add argument description
1220 Column - GC_TODO: add argument description
1221 Row - GC_TODO: add argument description
1222 MaxColumn - GC_TODO: add argument description
1226 GC_TODO: add return values
1230 Column
= Column
& 0xff;
1232 MaxColumn
= MaxColumn
& 0xff;
1235 CRTC_CURSOR_LOCATION_HIGH
,
1236 (UINT8
) ((Row
* MaxColumn
+ Column
) >> 8)
1240 CRTC_CURSOR_LOCATION_LOW
,
1241 (UINT8
) ((Row
* MaxColumn
+ Column
) & 0xff)
1248 IN VGA_CLASS_DEV
*VgaClassDev
,
1254 Routine Description:
1256 GC_TODO: Add function description
1260 VgaClassDev - GC_TODO: add argument description
1261 Address - GC_TODO: add argument description
1262 Data - GC_TODO: add argument description
1266 GC_TODO: add return values
1270 VgaClassDev
->PciIo
->Io
.Write (
1273 VgaClassDev
->VgaMiniPort
->CrtcAddressRegisterBar
,
1274 VgaClassDev
->VgaMiniPort
->CrtcAddressRegisterOffset
,
1279 VgaClassDev
->PciIo
->Io
.Write (
1282 VgaClassDev
->VgaMiniPort
->CrtcDataRegisterBar
,
1283 VgaClassDev
->VgaMiniPort
->CrtcDataRegisterOffset
,
1291 LibIsValidTextGraphics (
1293 OUT CHAR8
*PcAnsi
, OPTIONAL
1294 OUT CHAR8
*Ascii OPTIONAL
1298 Routine Description:
1300 Detects if a Unicode char is for Box Drawing text graphics.
1304 Grphic - Unicode char to test.
1306 PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.
1308 Asci - Optional pointer to return Ascii equivalent of Graphic.
1312 TRUE if Gpaphic is a supported Unicode Box Drawing character.
1315 // GC_TODO: Graphic - add argument and description to function comment
1317 UNICODE_TO_CHAR
*Table
;
1319 if ((((Graphic
& 0xff00) != 0x2500) && ((Graphic
& 0xff00) != 0x2100))) {
1321 // Unicode drawing code charts are all in the 0x25xx range,
1322 // arrows are 0x21xx
1327 for (Table
= UnicodeToPcAnsiOrAscii
; Table
->Unicode
!= 0x0000; Table
++) {
1328 if (Graphic
== Table
->Unicode
) {
1330 *PcAnsi
= Table
->PcAnsi
;
1334 *Ascii
= Table
->Ascii
;
1351 Routine Description:
1353 GC_TODO: Add function description
1357 Ascii - GC_TODO: add argument description
1361 GC_TODO: add return values
1365 if ((Ascii
>= 0x20) && (Ascii
<= 0x7f)) {
1374 IsValidEfiCntlChar (
1379 Routine Description:
1381 GC_TODO: Add function description
1385 c - GC_TODO: add argument description
1389 GC_TODO: add return values
1393 if (c
== CHAR_NULL
|| c
== CHAR_BACKSPACE
|| c
== CHAR_LINEFEED
|| c
== CHAR_CARRIAGE_RETURN
) {