mbox series

[0/2] x86: fix longjmp() implementation

Message ID 20221001130022.161518-1-heinrich.schuchardt@canonical.com
Headers show
Series x86: fix longjmp() implementation | expand

Message

Heinrich Schuchardt Oct. 1, 2022, 1 p.m. UTC
longjmp() must be defined as

    void longjmp(jmp_buf env, int val)

Add the missing jmp_buf type and fix the definition.
This fixes building the longjmp unit test on qemu-x86_defconfig.

If longjmp(jmp_buf env, int val) is invoked with val == 0, the setjmp()
macro must return 1.

We could have easily discovered this problem and others if unit tests
(CONFIG_UNIT_TEST) were enabled for qemu-x86_defconfig. We should try
to get there in the 2023.01 cycle.

Heinrich Schuchardt (2):
  x86: fix longjmp() implementation
  x86: provide typedef jmp_buf

 arch/x86/cpu/i386/setjmp.S    | 5 +++++
 arch/x86/include/asm/setjmp.h | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)