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