Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Simon Glass | f822403 | 2016-10-17 20:29:07 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Written by H. Peter Anvin <hpa@zytor.com> |
| 4 | * Brought in from Linux v4.4 and modified for U-Boot |
| 5 | * From Linux arch/um/sys-i386/setjmp.S |
Simon Glass | f822403 | 2016-10-17 20:29:07 -0600 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __setjmp_h |
| 9 | #define __setjmp_h |
| 10 | |
Ivan Gorinov | 9649273 | 2018-06-19 11:40:42 -0700 | [diff] [blame] | 11 | #ifdef CONFIG_X86_64 |
| 12 | |
| 13 | struct jmp_buf_data { |
| 14 | unsigned long __rip; |
| 15 | unsigned long __rsp; |
| 16 | unsigned long __rbp; |
| 17 | unsigned long __rbx; |
| 18 | unsigned long __r12; |
| 19 | unsigned long __r13; |
| 20 | unsigned long __r14; |
| 21 | unsigned long __r15; |
| 22 | }; |
| 23 | |
| 24 | #else |
| 25 | |
Simon Glass | f822403 | 2016-10-17 20:29:07 -0600 | [diff] [blame] | 26 | struct jmp_buf_data { |
| 27 | unsigned int __ebx; |
| 28 | unsigned int __esp; |
| 29 | unsigned int __ebp; |
| 30 | unsigned int __esi; |
| 31 | unsigned int __edi; |
| 32 | unsigned int __eip; |
| 33 | }; |
| 34 | |
Ivan Gorinov | 9649273 | 2018-06-19 11:40:42 -0700 | [diff] [blame] | 35 | #endif |
| 36 | |
Heinrich Schuchardt | 95e7caf | 2022-10-01 15:00:22 +0200 | [diff] [blame] | 37 | typedef struct jmp_buf_data jmp_buf[1]; |
| 38 | |
| 39 | int setjmp(jmp_buf env); |
| 40 | void longjmp(jmp_buf env, int val); |
Simon Glass | f822403 | 2016-10-17 20:29:07 -0600 | [diff] [blame] | 41 | |
| 42 | #endif |