UEFIStarter
a simple UEFI framework
|
This application shows how to wait for events and register a timer. More...
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <UEFIStarter/core.h>
Functions | |
void | callback (EFI_EVENT event, void *context) |
Callback function for the timer. More... | |
void | do_gettime_tests () |
Prints the current date/time info and timing capabilities of the UEFI runtime service's GetTime(). More... | |
void | do_timestamp_tests () |
Compares the internal get_timestamp() against the UEFI service's timer functions. More... | |
void | do_event_tests () |
Registers events to wait for. More... | |
INTN EFIAPI | ShellAppMain (UINTN argc, CHAR16 **argv) |
Main function, gets invoked by UEFI shell. More... | |
This application shows how to wait for events and register a timer.
void callback | ( | EFI_EVENT | event, |
void * | context | ||
) |
Callback function for the timer.
Contains a Print() call that may crash a Virtualbox VM. In current builds it does not, but it used to for some reason. Calling Print() in a timer callback is just for demonstration anyway.
event | (unused) the triggered timer event |
context | (unused) the triggered timer event's context data |
void do_gettime_tests | ( | ) |
Prints the current date/time info and timing capabilities of the UEFI runtime service's GetTime().
This shows resolutions of 1Hz on all tested systems, the nanosecond field seems to be always empty. This makes GetTime() useless for timing e.g. animation frames.
void do_timestamp_tests | ( | ) |
Compares the internal get_timestamp() against the UEFI service's timer functions.
The timer interval is 1s, so the internal timestamp should increase by 1 for each Hz of CPU frequency.
void do_event_tests | ( | ) |
Registers events to wait for.
One of the events is a callback function, it will get called asynchronously whenever the event is fired. The called handler currently prints to the console - this used to hang when executed inside a VirtualBox VM.
INTN EFIAPI ShellAppMain | ( | UINTN | argc, |
CHAR16 ** | argv | ||
) |
Main function, gets invoked by UEFI shell.
argc | the number of command-line arguments passed |
argv | the command-line arguments passed |