Fixed issue #14

merge-requests/1/head
bzt 3 years ago
parent 917906bf6c
commit 652f983375

@ -765,23 +765,18 @@ int fprintf (FILE *__stream, const char_t *__format, ...)
return vfprintf(__stream, __format, args);
}
int getchar (void)
int getchar_ifany (void)
{
efi_input_key_t key;
efi_input_key_t key = { 0 };
efi_status_t status = ST->ConIn->ReadKeyStroke(ST->ConIn, &key);
return EFI_ERROR(status) ? -1 : key.UnicodeChar;
}
int getchar_ifany (void)
int getchar (void)
{
efi_input_key_t key;
efi_status_t status = BS->CheckEvent(ST->ConIn->WaitForKey);
if(!status) {
status = ST->ConIn->ReadKeyStroke(ST->ConIn, &key);
return EFI_ERROR(status) ? -1 : key.UnicodeChar;
}
return 0;
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…
Cancel
Save