]> git.baikalelectronics.ru Git - uboot.git/commit
efi_selftest: implement exception test for sandbox
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 11 Nov 2020 23:29:58 +0000 (00:29 +0100)
committerSimon Glass <sjg@chromium.org>
Sun, 13 Dec 2020 14:58:17 +0000 (07:58 -0700)
commitee22437b93d7c13632c2448df1778c8068506b42
treef3d09f1bb14bfafa937bb70e0ac8d6641ac9df70
parentb02efa55f030fdb434cee4cc95cb22779c17231c
efi_selftest: implement exception test for sandbox

Provide a unit test that causes an illegal instruction to occur.

The test can be run with the following commands:

    => setenv efi_selftest exception
    => bootefi selftest

This might be the output:

    Executing 'exception'
    EFI application triggers exception.
    Illegal instruction
    pc = 0x1444d016, pc_reloc = 0xffffaa078e8dd016
    UEFI image [0x0000000000000000:0xffffffffffffffff] '/\selftest'
    UEFI image [0x000000001444b000:0x0000000014451fff] pc=0x2016 '/bug.efi'
    Resetting ...

It would tell us that the exception was triggered by an instruction
0x2016 bytes after the load address of the binary with filename /bug.efi.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/efi_selftest/efi_selftest_miniapp_exception.c