Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 2 | /* |
Philipp Tomsich | e5a246f | 2017-10-10 16:21:13 +0200 | [diff] [blame] | 3 | * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH |
| 4 | * (C) Copyright 2016 Alexander Graf <agraf@suse.de> |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef _SETJMP_H_ |
| 8 | #define _SETJMP_H_ 1 |
| 9 | |
Philipp Tomsich | e5a246f | 2017-10-10 16:21:13 +0200 | [diff] [blame] | 10 | /* |
| 11 | * This really should be opaque, but the EFI implementation wrongly |
| 12 | * assumes that a 'struct jmp_buf_data' is defined. |
| 13 | */ |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 14 | struct jmp_buf_data { |
Philipp Tomsich | e5a246f | 2017-10-10 16:21:13 +0200 | [diff] [blame] | 15 | #if defined(__aarch64__) |
| 16 | u64 regs[13]; |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 17 | #else |
Philipp Tomsich | e5a246f | 2017-10-10 16:21:13 +0200 | [diff] [blame] | 18 | u32 regs[10]; /* r4-r9, sl, fp, sp, lr */ |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 19 | #endif |
Philipp Tomsich | e5a246f | 2017-10-10 16:21:13 +0200 | [diff] [blame] | 20 | }; |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 21 | |
Philipp Tomsich | e5a246f | 2017-10-10 16:21:13 +0200 | [diff] [blame] | 22 | typedef struct jmp_buf_data jmp_buf[1]; |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 23 | |
Philipp Tomsich | e5a246f | 2017-10-10 16:21:13 +0200 | [diff] [blame] | 24 | int setjmp(jmp_buf jmp); |
| 25 | void longjmp(jmp_buf jmp, int ret); |
Alexander Graf | ab94e47 | 2016-05-20 23:28:22 +0200 | [diff] [blame] | 26 | |
| 27 | #endif /* _SETJMP_H_ */ |