blob: 662bec863219f31a85bd4d009904640a4ca87cb7 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Alexander Graf97d44b12016-05-20 23:28:22 +02002/*
Philipp Tomsichb4806d62017-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 Graf97d44b12016-05-20 23:28:22 +02005 */
6
7#ifndef _SETJMP_H_
8#define _SETJMP_H_ 1
9
Philipp Tomsichb4806d62017-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 Graf97d44b12016-05-20 23:28:22 +020014struct jmp_buf_data {
Philipp Tomsichb4806d62017-10-10 16:21:13 +020015#if defined(__aarch64__)
16 u64 regs[13];
17#else
18 u32 regs[10]; /* r4-r9, sl, fp, sp, lr */
19#endif
Alexander Graf97d44b12016-05-20 23:28:22 +020020};
21
22typedef struct jmp_buf_data jmp_buf[1];
23
Philipp Tomsichb4806d62017-10-10 16:21:13 +020024int setjmp(jmp_buf jmp);
25void longjmp(jmp_buf jmp, int ret);
Alexander Graf97d44b12016-05-20 23:28:22 +020026
27#endif /* _SETJMP_H_ */