xref: /rk3399_rockchip-uboot/arch/arm/include/asm/setjmp.h (revision c1da286a086ecbd7b2ee6837047dcc5707cf985f)
197d44b1fSAlexander Graf /*
2*c1da286aSPhilipp Tomsich  * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
3*c1da286aSPhilipp Tomsich  * (C) Copyright 2016 Alexander Graf <agraf@suse.de>
497d44b1fSAlexander Graf  *
597d44b1fSAlexander Graf  * SPDX-License-Identifier:	GPL-2.0+
697d44b1fSAlexander Graf  */
797d44b1fSAlexander Graf 
897d44b1fSAlexander Graf #ifndef _SETJMP_H_
997d44b1fSAlexander Graf #define _SETJMP_H_	1
1097d44b1fSAlexander Graf 
11*c1da286aSPhilipp Tomsich /*
12*c1da286aSPhilipp Tomsich  * This really should be opaque, but the EFI implementation wrongly
13*c1da286aSPhilipp Tomsich  * assumes that a 'struct jmp_buf_data' is defined.
14*c1da286aSPhilipp Tomsich  */
1597d44b1fSAlexander Graf struct jmp_buf_data {
16*c1da286aSPhilipp Tomsich #if defined(__aarch64__)
17*c1da286aSPhilipp Tomsich 	u64  regs[13];
18*c1da286aSPhilipp Tomsich #else
19*c1da286aSPhilipp Tomsich 	u32  regs[10];  /* r4-r9, sl, fp, sp, lr */
20*c1da286aSPhilipp Tomsich #endif
2197d44b1fSAlexander Graf };
2297d44b1fSAlexander Graf 
2397d44b1fSAlexander Graf typedef struct jmp_buf_data jmp_buf[1];
2497d44b1fSAlexander Graf 
25*c1da286aSPhilipp Tomsich int setjmp(jmp_buf jmp);
26*c1da286aSPhilipp Tomsich void longjmp(jmp_buf jmp, int ret);
2797d44b1fSAlexander Graf 
2897d44b1fSAlexander Graf #endif /* _SETJMP_H_ */
29