blob: 9a7f5af9f8f8c06376c66b971feae8e55ace5378 [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
Heinrich Schuchardt735916f2025-03-02 15:21:18 +010010#include <asm-generic/int-ll64.h>
11
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020012/*
13 * This really should be opaque, but the EFI implementation wrongly
14 * assumes that a 'struct jmp_buf_data' is defined.
15 */
Alexander Grafab94e472016-05-20 23:28:22 +020016struct jmp_buf_data {
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020017#if defined(__aarch64__)
18 u64 regs[13];
Alexander Grafab94e472016-05-20 23:28:22 +020019#else
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020020 u32 regs[10]; /* r4-r9, sl, fp, sp, lr */
Alexander Grafab94e472016-05-20 23:28:22 +020021#endif
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020022};
Alexander Grafab94e472016-05-20 23:28:22 +020023
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020024typedef struct jmp_buf_data jmp_buf[1];
Alexander Grafab94e472016-05-20 23:28:22 +020025
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020026int setjmp(jmp_buf jmp);
27void longjmp(jmp_buf jmp, int ret);
Alexander Grafab94e472016-05-20 23:28:22 +020028
29#endif /* _SETJMP_H_ */