blob: 517beebdeab50fe5afcaad278a3a7086f4420dae [file] [log] [blame]
Alexander Grafab94e472016-05-20 23:28:22 +02001/*
Philipp Tomsiche5a246f2017-10-10 16:21:13 +02002 * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
3 * (C) Copyright 2016 Alexander Graf <agraf@suse.de>
Alexander Grafab94e472016-05-20 23:28:22 +02004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#ifndef _SETJMP_H_
9#define _SETJMP_H_ 1
10
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020011/*
12 * This really should be opaque, but the EFI implementation wrongly
13 * assumes that a 'struct jmp_buf_data' is defined.
14 */
Alexander Grafab94e472016-05-20 23:28:22 +020015struct jmp_buf_data {
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020016#if defined(__aarch64__)
17 u64 regs[13];
Alexander Grafab94e472016-05-20 23:28:22 +020018#else
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020019 u32 regs[10]; /* r4-r9, sl, fp, sp, lr */
Alexander Grafab94e472016-05-20 23:28:22 +020020#endif
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020021};
Alexander Grafab94e472016-05-20 23:28:22 +020022
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020023typedef struct jmp_buf_data jmp_buf[1];
Alexander Grafab94e472016-05-20 23:28:22 +020024
Philipp Tomsiche5a246f2017-10-10 16:21:13 +020025int setjmp(jmp_buf jmp);
26void longjmp(jmp_buf jmp, int ret);
Alexander Grafab94e472016-05-20 23:28:22 +020027
28#endif /* _SETJMP_H_ */