blob: 49c36c1cc883a5aa6e4289e74413ba848a6e724b [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Simon Glassf8224032016-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 Glassf8224032016-10-17 20:29:07 -06006 */
7
8#ifndef __setjmp_h
9#define __setjmp_h
10
Ivan Gorinov96492732018-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 Glassf8224032016-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 Gorinov96492732018-06-19 11:40:42 -070035#endif
36
Simon Glassf8224032016-10-17 20:29:07 -060037int setjmp(struct jmp_buf_data *jmp_buf);
38void longjmp(struct jmp_buf_data *jmp_buf, int val);
39
40#endif