The platform_watchdog_ methods are optional features that the target
platform can choose to implement.
If they are implemented, then BootService.SetWatchdogTimer() would call
them to setup the hardware watchdog.
If they are not implemented (for example presubmit targets), then
BootService.SetWatchdogTimer() would test the WEAK symbol against a NULL
pointer and error out.
To use BootService.SetWatchdogTimer(), platforms can choose to either
implement platform_watchdog_init and platform_watchdog_set_enabled, or
override the entire BootService.SetWatchdogTimer() method.
GBL needs to read an UEFI variable called "gbl_debug".
We add 2 commands. "uefi_set_var" to set an UEFI variable. And
"uefi_list_var" to list the UEFI variables.
For GBL, we can use "uefi_set_var gbl_debug 1" to enable its
debug mode.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
The UEFI variable names are in UTF-16. We add several helper
functions to convert US-ASCII to UTF-16.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Add EfiSystemTablePointer structure for remote debugger to locate
the address of EfiSystemTable.
This feature is described in UEFI SPEC version 2.10. Section 18.4.2.
The implementation ensures support for hardware-assisted debugging and
provides a standardized mechanism for debuggers to discover the EFI
system table.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
LK already has events APIs. To support events protocols in UEFI spec,
I created a wrapper object for LK events. This wrapper object keeps
additional data that are necessary to support UEFI events spec:
* Notification function, or callbacks
* Argument for the notification function
* Type of this UEFI event (which specifies when the callback should be
called)
The events API is essential for supporting async I/O in UEFI. Intended
use case looks like:
* UEFI app creates an event object, attatch callback to this event
* UEFI app calls LK for asynchronous read/write on a block device, with
the newly created events object
* LK executes IO operation in background, after IO finishes, signal the
specified event object
* UEFI's callback gets executed
This loads all sections specified by PE header at the correct memory
location, and executes the entry point function. Only the
OutputString function of text output protocol is implemented,
so the only application we can run is hello world.
Test: th
Bug: 294283461
Change-Id: I786bc8b7db9e1c0a6019b8fe4ba5a8c8ab4f2936
Thids adds a uefi_load <block dev name> command, which will
parse the PE header and do some basic validation checks.
Bug: 294283461
Test: uefi_load virtio0
Change-Id: I97393652526bda5be1b995e59647e239c64d31d6