blob: 15915d0dc6bf858056b4742ee9da8ad3d887d2a5 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Simon Glass70785632016-10-17 20:29:07 -06002/*
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 Glass70785632016-10-17 20:29:07 -06006 */
7
8#ifndef __setjmp_h
9#define __setjmp_h
10
Ivan Gorinov8a57ea72018-06-19 11:40:42 -070011#ifdef CONFIG_X86_64
12
13struct 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 Glass70785632016-10-17 20:29:07 -060026struct 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 Gorinov8a57ea72018-06-19 11:40:42 -070035#endif
36
Heinrich Schuchardt0085d0f2022-10-01 15:00:22 +020037typedef struct jmp_buf_data jmp_buf[1];
38
39int setjmp(jmp_buf env);
40void longjmp(jmp_buf env, int val);
Simon Glass70785632016-10-17 20:29:07 -060041
42#endif