x86: fix longjmp() implementation

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

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Heinrich Schuchardt
2022-10-29 07:36:33 -06:00
committed by Simon Glass
parent 1fcfadcb82
commit fc872ee84c
+5
View File
@@ -49,12 +49,17 @@ longjmp:
xchgl %eax, %edx
#else
movl 4(%esp), %edx /* jmp_ptr address */
movl 8(%esp), %eax /* Return value */
#endif
movl (%edx), %ebx
movl 4(%edx), %esp
movl 8(%edx), %ebp
movl 12(%edx), %esi
movl 16(%edx), %edi
test %eax, %eax
jnz nz
inc %eax
nz:
jmp *20(%edx)
.size longjmp, .-longjmp