Skip to content

Commit

Permalink
TerminalDxe/TerminalConIn.c: add extra debug prints for SerialIO reset
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Lewinski <[email protected]>
  • Loading branch information
filipleple committed Feb 19, 2025
1 parent bc7ef16 commit 4b2b5b6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ TerminalConInReset (
TerminalDevice->DevicePath
);

DEBUG ((DEBUG_INFO, "TERMINAL: TerminalConInReset() called\n"));
Status = TerminalDevice->SerialIo->Reset (TerminalDevice->SerialIo);

DEBUG ((DEBUG_INFO, "TERMINAL: SerialIo->Reset() returned %r\n", Status));

//
// Make all the internal buffer empty for keys
//
Expand All @@ -95,6 +97,7 @@ TerminalConInReset (
);
}

DEBUG ((DEBUG_INFO, "TERMINAL: Reset() finished successfully\n"));
return Status;
}

Expand Down Expand Up @@ -127,13 +130,17 @@ TerminalConInReadKeyStroke (
//
TerminalDevice = TERMINAL_CON_IN_DEV_FROM_THIS (This);

DEBUG ((DEBUG_INFO, "TERMINAL: ReadKeyStroke() called\n"));
Status = ReadKeyStrokeWorker (TerminalDevice, &KeyData);
DEBUG ((DEBUG_INFO, "TERMINAL: ReadKeyStrokeWorker() returned %r\n", Status));
if (EFI_ERROR (Status)) {
return Status;
}

CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));

DEBUG ((DEBUG_INFO, "TERMINAL: ReadKeyStroke() Key -> ScanCode: %x, Unicode: %x\n",
Key->ScanCode, Key->UnicodeChar));
return EFI_SUCCESS;
}

Expand Down Expand Up @@ -486,8 +493,13 @@ TerminalConInWaitForKey (
// Someone is waiting on the keystroke event, if there's
// a key pending, signal the event
//
DEBUG ((DEBUG_INFO, "TERMINAL: WaitForKey() called\n"));

if (!IsEfiKeyFiFoEmpty ((TERMINAL_DEV *)Context)) {
DEBUG ((DEBUG_INFO, "TERMINAL: FIFO not empty, signaling event\n"));
gBS->SignalEvent (Event);
} else {
DEBUG ((DEBUG_INFO, "TERMINAL: FIFO empty, not signaling\n"));
}
}

Expand Down

0 comments on commit 4b2b5b6

Please sign in to comment.