mirror of
https://gitlab.com/bztsrc/posix-uefi.git
synced 2025-01-01 03:25:52 +01:00
Fixed issue #14
This commit is contained in:
parent
917906bf6c
commit
652f983375
2 changed files with 11 additions and 16 deletions
23
uefi/stdio.c
23
uefi/stdio.c
|
@ -765,23 +765,18 @@ int fprintf (FILE *__stream, const char_t *__format, ...)
|
|||
return vfprintf(__stream, __format, args);
|
||||
}
|
||||
|
||||
int getchar (void)
|
||||
{
|
||||
efi_input_key_t key;
|
||||
efi_status_t status = ST->ConIn->ReadKeyStroke(ST->ConIn, &key);
|
||||
return EFI_ERROR(status) ? -1 : key.UnicodeChar;
|
||||
|
||||
}
|
||||
|
||||
int getchar_ifany (void)
|
||||
{
|
||||
efi_input_key_t key;
|
||||
efi_status_t status = BS->CheckEvent(ST->ConIn->WaitForKey);
|
||||
if(!status) {
|
||||
status = ST->ConIn->ReadKeyStroke(ST->ConIn, &key);
|
||||
efi_input_key_t key = { 0 };
|
||||
efi_status_t status = ST->ConIn->ReadKeyStroke(ST->ConIn, &key);
|
||||
return EFI_ERROR(status) ? -1 : key.UnicodeChar;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int getchar (void)
|
||||
{
|
||||
uintn_t idx;
|
||||
BS->WaitForEvent(1, &ST->ConIn->WaitForKey, &idx);
|
||||
return getchar_ifany();
|
||||
}
|
||||
|
||||
int putchar (int __c)
|
||||
|
|
|
@ -704,7 +704,7 @@ typedef void (EFIAPI *efi_event_notify_t)(efi_event_t Event, void *Context);
|
|||
typedef efi_status_t (EFIAPI *efi_create_event_t)(uint32_t Type, efi_tpl_t NotifyTpl, efi_event_notify_t NotifyFunction,
|
||||
void *NextContext, efi_event_t *Event);
|
||||
typedef efi_status_t (EFIAPI *efi_set_timer_t)(efi_event_t Event, efi_timer_delay_t Type, uint64_t TriggerTime);
|
||||
typedef efi_status_t (EFIAPI *efi_wait_for_event_t)(uintn_t NumberOfEvents, efi_event_t *Event, uintn_t Index);
|
||||
typedef efi_status_t (EFIAPI *efi_wait_for_event_t)(uintn_t NumberOfEvents, efi_event_t *Event, uintn_t *Index);
|
||||
typedef efi_status_t (EFIAPI *efi_signal_event_t)(efi_event_t Event);
|
||||
typedef efi_status_t (EFIAPI *efi_close_event_t)(efi_event_t Event);
|
||||
typedef efi_status_t (EFIAPI *efi_check_event_t)(efi_event_t Event);
|
||||
|
|
Loading…
Reference in a new issue