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
= EfiLibInstallDriverBindingComponentName2 (
54 &gVgaClassDriverBinding
,
56 &gVgaClassComponentName
,
57 &gVgaClassComponentName2
59 ASSERT_EFI_ERROR (Status
);
68 static CHAR16 CrLfString
[3] = { CHAR_CARRIAGE_RETURN
, CHAR_LINEFEED
, CHAR_NULL
};
77 // This list is used to define the valid extend chars.
78 // It also provides a mapping from Unicode to PCANSI or
79 // ASCII. The ASCII mapping we just made up.
82 STATIC UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii
[] = {
114 BOXDRAW_VERTICAL_RIGHT
,
119 BOXDRAW_VERTICAL_LEFT
,
124 BOXDRAW_DOWN_HORIZONTAL
,
129 BOXDRAW_UP_HORIZONTAL
,
134 BOXDRAW_VERTICAL_HORIZONTAL
,
139 BOXDRAW_DOUBLE_HORIZONTAL
,
144 BOXDRAW_DOUBLE_VERTICAL
,
149 BOXDRAW_DOWN_RIGHT_DOUBLE
,
154 BOXDRAW_DOWN_DOUBLE_RIGHT
,
159 BOXDRAW_DOUBLE_DOWN_RIGHT
,
164 BOXDRAW_DOWN_LEFT_DOUBLE
,
169 BOXDRAW_DOWN_DOUBLE_LEFT
,
174 BOXDRAW_DOUBLE_DOWN_LEFT
,
179 BOXDRAW_UP_RIGHT_DOUBLE
,
184 BOXDRAW_UP_DOUBLE_RIGHT
,
189 BOXDRAW_DOUBLE_UP_RIGHT
,
194 BOXDRAW_UP_LEFT_DOUBLE
,
199 BOXDRAW_UP_DOUBLE_LEFT
,
204 BOXDRAW_DOUBLE_UP_LEFT
,
209 BOXDRAW_VERTICAL_RIGHT_DOUBLE
,
214 BOXDRAW_VERTICAL_DOUBLE_RIGHT
,
219 BOXDRAW_DOUBLE_VERTICAL_RIGHT
,
224 BOXDRAW_VERTICAL_LEFT_DOUBLE
,
229 BOXDRAW_VERTICAL_DOUBLE_LEFT
,
234 BOXDRAW_DOUBLE_VERTICAL_LEFT
,
239 BOXDRAW_DOWN_HORIZONTAL_DOUBLE
,
244 BOXDRAW_DOWN_DOUBLE_HORIZONTAL
,
249 BOXDRAW_DOUBLE_DOWN_HORIZONTAL
,
254 BOXDRAW_UP_HORIZONTAL_DOUBLE
,
259 BOXDRAW_UP_DOUBLE_HORIZONTAL
,
264 BOXDRAW_DOUBLE_UP_HORIZONTAL
,
269 BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE
,
274 BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL
,
279 BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL
,
285 BLOCKELEMENT_FULL_BLOCK
,
290 BLOCKELEMENT_LIGHT_SHADE
,
296 GEOMETRICSHAPE_UP_TRIANGLE
,
301 GEOMETRICSHAPE_RIGHT_TRIANGLE
,
306 GEOMETRICSHAPE_DOWN_TRIANGLE
,
311 GEOMETRICSHAPE_LEFT_TRIANGLE
,
348 // Private worker functions
352 SetVideoCursorPosition (
353 IN VGA_CLASS_DEV
*VgaClassDev
,
362 IN VGA_CLASS_DEV
*VgaClassDev
,
369 LibIsValidTextGraphics (
371 OUT CHAR8
*PcAnsi
, OPTIONAL
372 OUT CHAR8
*Ascii OPTIONAL
389 VgaClassDriverBindingSupported (
390 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
391 IN EFI_HANDLE Controller
,
392 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
402 (Standard DriverBinding Protocol Supported() function)
409 // GC_TODO: This - add argument and description to function comment
410 // GC_TODO: Controller - add argument and description to function comment
411 // GC_TODO: RemainingDevicePath - add argument and description to function comment
414 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
417 // Open the IO Abstraction(s) needed to perform the supported test
419 Status
= gBS
->OpenProtocol (
421 &gEfiVgaMiniPortProtocolGuid
,
422 (VOID
**) &VgaMiniPort
,
423 This
->DriverBindingHandle
,
425 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
427 if (EFI_ERROR (Status
)) {
431 // Open the IO Abstraction(s) needed to perform the supported test
433 Status
= gBS
->OpenProtocol (
435 &gEfiPciIoProtocolGuid
,
437 This
->DriverBindingHandle
,
439 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
441 if (EFI_ERROR (Status
)) {
450 VgaClassDriverBindingStart (
451 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
452 IN EFI_HANDLE Controller
,
453 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
459 Layers the Simple Text Output Protocol on top of the
460 VGA Mini Port Protocol
464 (Standard DriverBinding Protocol Start() function)
471 // GC_TODO: This - add argument and description to function comment
472 // GC_TODO: Controller - add argument and description to function comment
473 // GC_TODO: RemainingDevicePath - add argument and description to function comment
474 // GC_TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
477 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
478 EFI_PCI_IO_PROTOCOL
*PciIo
;
479 VGA_CLASS_DEV
*VgaClassPrivate
;
480 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
482 Status
= gBS
->HandleProtocol (
484 &gEfiDevicePathProtocolGuid
,
485 (VOID
**) &DevicePath
487 if (EFI_ERROR (Status
)) {
491 // Report that VGA Class driver is being enabled
493 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
495 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_ENABLE
,
500 // Open the IO Abstraction(s) needed
502 Status
= gBS
->OpenProtocol (
504 &gEfiPciIoProtocolGuid
,
506 This
->DriverBindingHandle
,
508 EFI_OPEN_PROTOCOL_GET_PROTOCOL
510 if (EFI_ERROR (Status
)) {
514 Status
= gBS
->OpenProtocol (
516 &gEfiVgaMiniPortProtocolGuid
,
517 (VOID
**) &VgaMiniPort
,
518 This
->DriverBindingHandle
,
520 EFI_OPEN_PROTOCOL_BY_DRIVER
522 if (EFI_ERROR (Status
)) {
526 // Allocate the private device structure
528 Status
= gBS
->AllocatePool (
530 sizeof (VGA_CLASS_DEV
),
531 (VOID
**) &VgaClassPrivate
533 if (EFI_ERROR (Status
)) {
536 &gEfiVgaMiniPortProtocolGuid
,
537 This
->DriverBindingHandle
,
540 return EFI_OUT_OF_RESOURCES
;
543 ZeroMem (VgaClassPrivate
, sizeof (VGA_CLASS_DEV
));
546 // Initialize the private device structure
548 VgaClassPrivate
->Signature
= VGA_CLASS_DEV_SIGNATURE
;
549 VgaClassPrivate
->Handle
= Controller
;
550 VgaClassPrivate
->VgaMiniPort
= VgaMiniPort
;
551 VgaClassPrivate
->PciIo
= PciIo
;
553 VgaClassPrivate
->SimpleTextOut
.Reset
= VgaClassReset
;
554 VgaClassPrivate
->SimpleTextOut
.OutputString
= VgaClassOutputString
;
555 VgaClassPrivate
->SimpleTextOut
.TestString
= VgaClassTestString
;
556 VgaClassPrivate
->SimpleTextOut
.ClearScreen
= VgaClassClearScreen
;
557 VgaClassPrivate
->SimpleTextOut
.SetAttribute
= VgaClassSetAttribute
;
558 VgaClassPrivate
->SimpleTextOut
.SetCursorPosition
= VgaClassSetCursorPosition
;
559 VgaClassPrivate
->SimpleTextOut
.EnableCursor
= VgaClassEnableCursor
;
560 VgaClassPrivate
->SimpleTextOut
.QueryMode
= VgaClassQueryMode
;
561 VgaClassPrivate
->SimpleTextOut
.SetMode
= VgaClassSetMode
;
563 VgaClassPrivate
->SimpleTextOut
.Mode
= &VgaClassPrivate
->SimpleTextOutputMode
;
564 VgaClassPrivate
->SimpleTextOutputMode
.MaxMode
= VgaMiniPort
->MaxMode
;
565 VgaClassPrivate
->DevicePath
= DevicePath
;
567 Status
= VgaClassPrivate
->SimpleTextOut
.SetAttribute (
568 &VgaClassPrivate
->SimpleTextOut
,
569 EFI_TEXT_ATTR (EFI_WHITE
,
572 if (EFI_ERROR (Status
)) {
576 Status
= VgaClassPrivate
->SimpleTextOut
.Reset (
577 &VgaClassPrivate
->SimpleTextOut
,
580 if (EFI_ERROR (Status
)) {
584 Status
= VgaClassPrivate
->SimpleTextOut
.EnableCursor (
585 &VgaClassPrivate
->SimpleTextOut
,
588 if (EFI_ERROR (Status
)) {
592 Status
= gBS
->InstallMultipleProtocolInterfaces (
594 &gEfiSimpleTextOutProtocolGuid
,
595 &VgaClassPrivate
->SimpleTextOut
,
602 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
603 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
604 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_EC_CONTROLLER_ERROR
,
614 VgaClassDriverBindingStop (
615 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
616 IN EFI_HANDLE Controller
,
617 IN UINTN NumberOfChildren
,
618 IN EFI_HANDLE
*ChildHandleBuffer
628 (Standard DriverBinding Protocol Stop() function)
635 // GC_TODO: This - add argument and description to function comment
636 // GC_TODO: Controller - add argument and description to function comment
637 // GC_TODO: NumberOfChildren - add argument and description to function comment
638 // GC_TODO: ChildHandleBuffer - add argument and description to function comment
639 // GC_TODO: EFI_SUCCESS - add return value to function comment
642 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*SimpleTextOut
;
643 VGA_CLASS_DEV
*VgaClassPrivate
;
645 Status
= gBS
->OpenProtocol (
647 &gEfiSimpleTextOutProtocolGuid
,
648 (VOID
**) &SimpleTextOut
,
649 This
->DriverBindingHandle
,
651 EFI_OPEN_PROTOCOL_GET_PROTOCOL
653 if (EFI_ERROR (Status
)) {
657 VgaClassPrivate
= VGA_CLASS_DEV_FROM_THIS (SimpleTextOut
);
660 // Report that VGA Class driver is being disabled
662 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
664 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_DISABLE
,
665 VgaClassPrivate
->DevicePath
668 Status
= gBS
->UninstallProtocolInterface (
670 &gEfiSimpleTextOutProtocolGuid
,
671 &VgaClassPrivate
->SimpleTextOut
673 if (EFI_ERROR (Status
)) {
677 // Release PCI I/O and VGA Mini Port Protocols on the controller handle.
681 &gEfiPciIoProtocolGuid
,
682 This
->DriverBindingHandle
,
688 &gEfiVgaMiniPortProtocolGuid
,
689 This
->DriverBindingHandle
,
693 gBS
->FreePool (VgaClassPrivate
);
698 // Simple Text Output Protocol Functions
703 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
704 IN BOOLEAN ExtendedVerification
710 GC_TODO: Add function description
714 This - GC_TODO: add argument description
715 ExtendedVerification - GC_TODO: add argument description
719 GC_TODO: add return values
724 VGA_CLASS_DEV
*VgaClassPrivate
;
726 VgaClassPrivate
= VGA_CLASS_DEV_FROM_THIS (This
);
728 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
730 EFI_PERIPHERAL_LOCAL_CONSOLE
| EFI_P_PC_RESET
,
731 VgaClassPrivate
->DevicePath
734 This
->SetAttribute (This
, EFI_TEXT_ATTR (This
->Mode
->Attribute
& 0x0F, EFI_BACKGROUND_BLACK
));
736 Status
= This
->SetMode (This
, 0);
737 if (EFI_ERROR (Status
)) {
741 return This
->ClearScreen (This
);
746 VgaClassOutputString (
747 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
754 GC_TODO: Add function description
758 This - GC_TODO: add argument description
759 WString - GC_TODO: add argument description
763 EFI_SUCCESS - GC_TODO: Add description for return value
768 VGA_CLASS_DEV
*VgaClassDev
;
769 EFI_SIMPLE_TEXT_OUTPUT_MODE
*Mode
;
775 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
779 Status
= This
->QueryMode (
785 if (EFI_ERROR (Status
)) {
789 for (; *WString
!= CHAR_NULL
; WString
++) {
793 if (Mode
->CursorColumn
> 0) {
794 Mode
->CursorColumn
--;
799 if (Mode
->CursorRow
== (INT32
) (MaxRow
- 1)) {
801 // Scroll the screen by copying the contents
802 // of the VGA display up one line
804 VgaClassDev
->PciIo
->CopyMem (
807 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
808 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
,
809 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
810 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ MaxColumn
* 2,
811 ((MaxRow
- 1) * MaxColumn
) >> 1
815 // Print Blank Line of spaces with the current color attributes
817 VideoChar
= (Mode
->Attribute
<< 8) | ' ';
818 VideoChar
= (VideoChar
<< 16) | VideoChar
;
819 VgaClassDev
->PciIo
->Mem
.Write (
821 EfiPciIoWidthFillUint32
,
822 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
823 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ (MaxRow
- 1) * MaxColumn
* 2,
829 if (Mode
->CursorRow
< (INT32
) (MaxRow
- 1)) {
834 case CHAR_CARRIAGE_RETURN
:
835 Mode
->CursorColumn
= 0;
839 if (!LibIsValidTextGraphics (*WString
, &GraphicChar
, NULL
)) {
841 // Just convert to ASCII
843 GraphicChar
= (CHAR8
) *WString
;
844 if (!IsValidAscii (GraphicChar
)) {
846 // Keep the API from supporting PCANSI Graphics chars
852 VideoChar
= (Mode
->Attribute
<< 8) | GraphicChar
;
853 VgaClassDev
->PciIo
->Mem
.Write (
856 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
857 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
+ ((Mode
->CursorRow
* MaxColumn
+ Mode
->CursorColumn
) * 2),
862 if (Mode
->CursorColumn
>= (INT32
) (MaxColumn
- 1)) {
863 This
->OutputString (This
, CrLfString
);
865 Mode
->CursorColumn
++;
871 SetVideoCursorPosition (
873 (UINTN
) Mode
->CursorColumn
,
874 (UINTN
) Mode
->CursorRow
,
884 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
891 GC_TODO: Add function description
895 This - GC_TODO: add argument description
896 WString - GC_TODO: add argument description
900 EFI_UNSUPPORTED - GC_TODO: Add description for return value
901 EFI_SUCCESS - GC_TODO: Add description for return value
905 while (*WString
!= 0x0000) {
906 if (!(IsValidAscii (*WString
) || IsValidEfiCntlChar (*WString
) || LibIsValidTextGraphics (*WString
, NULL
, NULL
))) {
907 return EFI_UNSUPPORTED
;
918 VgaClassClearScreen (
919 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
925 GC_TODO: Add function description
929 This - GC_TODO: add argument description
933 EFI_SUCCESS - GC_TODO: Add description for return value
938 VGA_CLASS_DEV
*VgaClassDev
;
943 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
945 Status
= This
->QueryMode (
951 if (EFI_ERROR (Status
)) {
955 VideoChar
= (This
->Mode
->Attribute
<< 8) | ' ';
956 VideoChar
= (VideoChar
<< 16) | VideoChar
;
957 VgaClassDev
->PciIo
->Mem
.Write (
959 EfiPciIoWidthFillUint32
,
960 VgaClassDev
->VgaMiniPort
->VgaMemoryBar
,
961 VgaClassDev
->VgaMiniPort
->VgaMemoryOffset
,
962 (MaxRow
* MaxColumn
) >> 1,
966 This
->SetCursorPosition (This
, 0, 0);
973 VgaClassSetAttribute (
974 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
981 GC_TODO: Add function description
985 This - GC_TODO: add argument description
986 Attribute - GC_TODO: add argument description
990 EFI_SUCCESS - GC_TODO: Add description for return value
991 EFI_UNSUPPORTED - GC_TODO: Add description for return value
995 if (Attribute
<= EFI_MAX_ATTRIBUTE
) {
996 This
->Mode
->Attribute
= (INT32
) Attribute
;
1000 return EFI_UNSUPPORTED
;
1005 VgaClassSetCursorPosition (
1006 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1012 Routine Description:
1014 GC_TODO: Add function description
1018 This - GC_TODO: add argument description
1019 Column - GC_TODO: add argument description
1020 Row - GC_TODO: add argument description
1024 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1025 EFI_SUCCESS - GC_TODO: Add description for return value
1030 VGA_CLASS_DEV
*VgaClassDev
;
1034 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1036 Status
= This
->QueryMode (
1042 if (EFI_ERROR (Status
)) {
1046 if (Column
>= MaxColumn
|| Row
>= MaxRow
) {
1047 return EFI_UNSUPPORTED
;
1050 SetVideoCursorPosition (VgaClassDev
, Column
, Row
, MaxColumn
);
1052 This
->Mode
->CursorColumn
= (INT32
) Column
;
1053 This
->Mode
->CursorRow
= (INT32
) Row
;
1060 VgaClassEnableCursor (
1061 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1066 Routine Description:
1068 GC_TODO: Add function description
1072 This - GC_TODO: add argument description
1073 Visible - GC_TODO: add argument description
1077 EFI_SUCCESS - GC_TODO: Add description for return value
1081 VGA_CLASS_DEV
*VgaClassDev
;
1083 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1085 switch (This
->Mode
->Mode
) {
1087 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x06);
1088 WriteCrtc (VgaClassDev
, CRTC_CURSOR_END
, 0x07);
1092 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x0e);
1093 WriteCrtc (VgaClassDev
, CRTC_CURSOR_END
, 0x0f);
1097 WriteCrtc (VgaClassDev
, CRTC_CURSOR_START
, 0x20);
1100 This
->Mode
->CursorVisible
= Visible
;
1107 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1108 IN UINTN ModeNumber
,
1114 Routine Description:
1116 GC_TODO: Add function description
1120 This - GC_TODO: add argument description
1121 ModeNumber - GC_TODO: add argument description
1122 Columns - GC_TODO: add argument description
1123 Rows - GC_TODO: add argument description
1127 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1128 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1129 EFI_SUCCESS - GC_TODO: Add description for return value
1133 if ((INT32
) ModeNumber
>= This
->Mode
->MaxMode
) {
1136 return EFI_UNSUPPORTED
;
1139 switch (ModeNumber
) {
1153 return EFI_UNSUPPORTED
;
1162 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
1167 Routine Description:
1169 GC_TODO: Add function description
1173 This - GC_TODO: add argument description
1174 ModeNumber - GC_TODO: add argument description
1178 EFI_UNSUPPORTED - GC_TODO: Add description for return value
1183 VGA_CLASS_DEV
*VgaClassDev
;
1185 VgaClassDev
= VGA_CLASS_DEV_FROM_THIS (This
);
1187 if ((INT32
) ModeNumber
>= This
->Mode
->MaxMode
) {
1188 return EFI_UNSUPPORTED
;
1191 This
->ClearScreen (This
);
1193 This
->Mode
->Mode
= (INT32
) ModeNumber
;
1195 Status
= VgaClassDev
->VgaMiniPort
->SetMode (VgaClassDev
->VgaMiniPort
, ModeNumber
);
1200 // Private Worker Functions
1204 SetVideoCursorPosition (
1205 IN VGA_CLASS_DEV
*VgaClassDev
,
1212 Routine Description:
1214 GC_TODO: Add function description
1218 VgaClassDev - GC_TODO: add argument description
1219 Column - GC_TODO: add argument description
1220 Row - GC_TODO: add argument description
1221 MaxColumn - GC_TODO: add argument description
1225 GC_TODO: add return values
1229 Column
= Column
& 0xff;
1231 MaxColumn
= MaxColumn
& 0xff;
1234 CRTC_CURSOR_LOCATION_HIGH
,
1235 (UINT8
) ((Row
* MaxColumn
+ Column
) >> 8)
1239 CRTC_CURSOR_LOCATION_LOW
,
1240 (UINT8
) ((Row
* MaxColumn
+ Column
) & 0xff)
1247 IN VGA_CLASS_DEV
*VgaClassDev
,
1253 Routine Description:
1255 GC_TODO: Add function description
1259 VgaClassDev - GC_TODO: add argument description
1260 Address - GC_TODO: add argument description
1261 Data - GC_TODO: add argument description
1265 GC_TODO: add return values
1269 VgaClassDev
->PciIo
->Io
.Write (
1272 VgaClassDev
->VgaMiniPort
->CrtcAddressRegisterBar
,
1273 VgaClassDev
->VgaMiniPort
->CrtcAddressRegisterOffset
,
1278 VgaClassDev
->PciIo
->Io
.Write (
1281 VgaClassDev
->VgaMiniPort
->CrtcDataRegisterBar
,
1282 VgaClassDev
->VgaMiniPort
->CrtcDataRegisterOffset
,
1290 LibIsValidTextGraphics (
1292 OUT CHAR8
*PcAnsi
, OPTIONAL
1293 OUT CHAR8
*Ascii OPTIONAL
1297 Routine Description:
1299 Detects if a Unicode char is for Box Drawing text graphics.
1303 Grphic - Unicode char to test.
1305 PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.
1307 Asci - Optional pointer to return Ascii equivalent of Graphic.
1311 TRUE if Gpaphic is a supported Unicode Box Drawing character.
1314 // GC_TODO: Graphic - add argument and description to function comment
1316 UNICODE_TO_CHAR
*Table
;
1318 if ((((Graphic
& 0xff00) != 0x2500) && ((Graphic
& 0xff00) != 0x2100))) {
1320 // Unicode drawing code charts are all in the 0x25xx range,
1321 // arrows are 0x21xx
1326 for (Table
= UnicodeToPcAnsiOrAscii
; Table
->Unicode
!= 0x0000; Table
++) {
1327 if (Graphic
== Table
->Unicode
) {
1329 *PcAnsi
= Table
->PcAnsi
;
1333 *Ascii
= Table
->Ascii
;
1350 Routine Description:
1352 GC_TODO: Add function description
1356 Ascii - GC_TODO: add argument description
1360 GC_TODO: add return values
1364 if ((Ascii
>= 0x20) && (Ascii
<= 0x7f)) {
1373 IsValidEfiCntlChar (
1378 Routine Description:
1380 GC_TODO: Add function description
1384 c - GC_TODO: add argument description
1388 GC_TODO: add return values
1392 if (c
== CHAR_NULL
|| c
== CHAR_BACKSPACE
|| c
== CHAR_LINEFEED
|| c
== CHAR_CARRIAGE_RETURN
) {