blob: 662bec863219f31a85bd4d009904640a4ca87cb7 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Alexander Grafab94e472016-05-20 23:28:22 +02002/*
Philipp Tomsiche5a246f2017-10-10 16:21:13 +02003 * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
4 * (C) Copyright 2016 Alexander Graf <agraf@suse.de>
Alexander Grafab94e472016-05-20 23:28:22 +02005 */
6
7#ifndef _SETJMP_H_
8#define _SETJMP_H_ 1
9
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020010/*
11 * This really should be opaque, but the EFI implementation wrongly
12 * assumes that a 'struct jmp_buf_data' is defined.
13 */
Alexander Grafab94e472016-05-20 23:28:22 +020014struct jmp_buf_data {
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020015#if defined(__aarch64__)
16 u64 regs[13];
Alexander Grafab94e472016-05-20 23:28:22 +020017#else
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020018 u32 regs[10]; /* r4-r9, sl, fp, sp, lr */
Alexander Grafab94e472016-05-20 23:28:22 +020019#endif
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020020};
Alexander Grafab94e472016-05-20 23:28:22 +020021
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020022typedef struct jmp_buf_data jmp_buf[1];
Alexander Grafab94e472016-05-20 23:28:22 +020023
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020024int setjmp(jmp_buf jmp);
25void longjmp(jmp_buf jmp, int ret);
Alexander Grafab94e472016-05-20 23:28:22 +020026
27#endif /* _SETJMP_H_ */