68#define MODE0_COLUMN_COUNT 80
69#define MODE0_ROW_COUNT 25
75 IN BOOLEAN ExtendedVerification
89 IN BOOLEAN ExtendedVerification
94SafeUnicodeStrToAsciiStr (
96 OUT CHAR8 *Destination
166 EFI_TEXT_ATTR (EFI_LIGHTGRAY,EFI_BLACK),
220 if ((Ascii >= 0x20) && (Ascii <= 0x7F)) {
228TextOutIsValidEfiCntlChar (
235 if ((Char == CHAR_NULL) ||
236 (Char == CHAR_BACKSPACE) ||
237 (Char == CHAR_LINEFEED) ||
238 (Char == CHAR_CARRIAGE_RETURN) ||
255 gBS->SignalEvent (Event);
263 IN BOOLEAN ExtendedVerification
279 return EFI_NOT_READY;
291 Key->UnicodeChar = 0;
292 Key->ScanCode = SCAN_NULL;
299 Key->ScanCode = SCAN_UP;
302 Key->ScanCode = SCAN_DOWN;
305 Key->ScanCode = SCAN_RIGHT;
308 Key->ScanCode = SCAN_LEFT;
311 Key->ScanCode = SCAN_HOME;
315 Key->ScanCode = SCAN_END;
319 Key->ScanCode = SCAN_INSERT;
323 Key->ScanCode = SCAN_DELETE;
328 Key->ScanCode = SCAN_PAGE_DOWN;
333 Key->ScanCode = SCAN_PAGE_UP;
338 Key->ScanCode = SCAN_F1;
341 Key->ScanCode = SCAN_F2;
344 Key->ScanCode = SCAN_F3;
347 Key->ScanCode = SCAN_F5;
350 Key->ScanCode = SCAN_F6;
353 Key->ScanCode = SCAN_F7;
356 Key->ScanCode = SCAN_F8;
360 Key->UnicodeChar = Char;
363 }
else if (Char ==
'0') {
367 Key->ScanCode = SCAN_F1;
370 Key->ScanCode = SCAN_F2;
373 Key->ScanCode = SCAN_F3;
376 Key->ScanCode = SCAN_F4;
379 Key->ScanCode = SCAN_F5;
382 Key->ScanCode = SCAN_F6;
385 Key->ScanCode = SCAN_F7;
388 Key->ScanCode = SCAN_F8;
391 Key->ScanCode = SCAN_F9;
394 Key->ScanCode = SCAN_F10;
400 }
else if (Char <
' ') {
401 if ((Char == CHAR_BACKSPACE) ||
402 (Char == CHAR_TAB) ||
403 (Char == CHAR_LINEFEED) ||
404 (Char == CHAR_CARRIAGE_RETURN))
407 Key->UnicodeChar = (CHAR16)Char;
409 }
else if (Char == 0x7f) {
410 Key->ScanCode = SCAN_DELETE;
412 Key->UnicodeChar = (CHAR16)Char;
422 IN BOOLEAN ExtendedVerification
429 EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK)
432 Status = This->SetMode (This, 0);
439SafeUnicodeStrToAsciiStr (
441 OUT CHAR8 *Destination
446 ASSERT (Destination !=
NULL);
452 ASSERT (
StrSize (Source) != 0);
457 ASSERT ((
UINTN)((CHAR16 *)Destination - Source) >
StrLen (Source));
458 ASSERT ((
UINTN)((CHAR8 *)Source - Destination) >
StrLen (Source));
460 ReturnValue = Destination;
461 while (*Source !=
'\0') {
465 if (*Source < 0x80) {
466 *Destination = (CHAR8)*Source;
471 if ((*Source >= 0xD800) && (*Source <= 0xDFFF)) {
505 Size =
StrLen (String) + 1;
510 SafeUnicodeStrToAsciiStr (String, OutputString);
519 Status = This->QueryMode (
525 if (EFI_ERROR (Status)) {
529 for ( ; *String != CHAR_NULL; String++) {
539 if (Mode->
CursorRow < (INT32)(MaxRow - 1)) {
545 case CHAR_CARRIAGE_RETURN:
553 if (Mode->
CursorRow < (INT32)(MaxRow - 1)) {
581 for ( ; *String != CHAR_NULL; String++) {
582 Character = (CHAR8)*String;
583 if (!(TextOutIsValidAscii (Character) || TextOutIsValidEfiCntlChar (Character))) {
584 return EFI_UNSUPPORTED;
600 if (This->Mode->MaxMode > 1) {
601 return EFI_DEVICE_ERROR;
604 if (ModeNumber == 0) {
605 *Columns = MODE0_COLUMN_COUNT;
606 *Rows = MODE0_ROW_COUNT;
610 return EFI_UNSUPPORTED;
620 if (ModeNumber != 0) {
621 return EFI_UNSUPPORTED;
624 This->Mode->Mode = 0;
625 This->ClearScreen (This);
636 This->Mode->Attribute = (INT32)Attribute;
648 Status = This->SetCursorPosition (This, 0, 0);
667 Status = This->QueryMode (
673 if (EFI_ERROR (Status)) {
674 return EFI_UNSUPPORTED;
677 if ((Column >= MaxColumn) || (Row >= MaxRow)) {
678 return EFI_UNSUPPORTED;
695 return EFI_UNSUPPORTED;
703SimpleTextInOutEntryPoint (
710 Status =
gBS->CreateEvent (
719 Status =
gBS->InstallMultipleProtocolInterfaces (
721 &gEfiSimpleTextInProtocolGuid,
723 &gEfiSimpleTextOutProtocolGuid,
725 &gEfiDevicePathProtocolGuid,
729 if (!EFI_ERROR (Status)) {
BOOLEAN EFIAPI SerialPortPoll(VOID)
UINTN EFIAPI SerialPortRead(OUT UINT8 *Buffer, IN UINTN NumberOfBytes)
UINTN EFIAPI SerialPortWrite(IN UINT8 *Buffer, IN UINTN NumberOfBytes)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
#define HARDWARE_DEVICE_PATH
#define MESSAGING_DEVICE_PATH
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define FixedPcdGet64(TokenName)
#define FixedPcdGet8(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut