diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-02-05 18:24:26 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2018-04-04 11:00:07 +0200 |
commit | f7c342f413a97c8fb097c3a0649aa5bbc2bcfd26 (patch) | |
tree | 25e83721a89daf2fb62044277880de223249fc5a /lib | |
parent | 0aa2da788bb5c6dd249e33a8d3416f9d2ae9ee09 (diff) | |
download | u-boot-f7c342f413a97c8fb097c3a0649aa5bbc2bcfd26.zip u-boot-f7c342f413a97c8fb097c3a0649aa5bbc2bcfd26.tar.gz u-boot-f7c342f413a97c8fb097c3a0649aa5bbc2bcfd26.tar.bz2 |
efi_loader: show UEFI revision in helloworld
Output the UEFI revision number in helloworld.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/helloworld.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c index 1ec0179..6c539ba 100644 --- a/lib/efi_loader/helloworld.c +++ b/lib/efi_loader/helloworld.c @@ -46,9 +46,27 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, struct efi_loaded_image *loaded_image; efi_status_t ret; efi_uintn_t i; + u16 rev[] = L"0.0.0"; con_out->output_string(con_out, L"Hello, world!\n"); + /* Print the revision number */ + rev[0] = (systable->hdr.revision >> 16) + '0'; + rev[4] = systable->hdr.revision & 0xffff; + for (; rev[4] >= 10;) { + rev[4] -= 10; + ++rev[2]; + } + /* Third digit is only to be shown if non-zero */ + if (rev[4]) + rev[4] += '0'; + else + rev[3] = 0; + + con_out->output_string(con_out, L"Running on UEFI "); + con_out->output_string(con_out, rev); + con_out->output_string(con_out, L"\n"); + /* Get the loaded image protocol */ ret = boottime->handle_protocol(handle, &loaded_image_guid, (void **)&loaded_image); |