14b6da826SThomas Huth /* 24b6da826SThomas Huth * setjmp/longjmp prototypes 34b6da826SThomas Huth * 44b6da826SThomas Huth * This code is free software; you can redistribute it and/or modify it 54b6da826SThomas Huth * under the terms of the GNU Library General Public License version 2. 64b6da826SThomas Huth */ 79f0ae301SCornelia Huck #ifndef _LIBCFLAT_SETJMP_H_ 89f0ae301SCornelia Huck #define _LIBCFLAT_SETJMP_H_ 99dde4243SPaolo Bonzini 109dde4243SPaolo Bonzini typedef struct jmp_buf_tag { 11*53cded04SAndrew Jones #if defined(__i386__) || defined(__x86_64__) 129dde4243SPaolo Bonzini long int regs[8]; 13*53cded04SAndrew Jones #elif defined(__riscv) 14*53cded04SAndrew Jones long int regs[16]; 15*53cded04SAndrew Jones #endif 169dde4243SPaolo Bonzini } jmp_buf[1]; 179dde4243SPaolo Bonzini 189dde4243SPaolo Bonzini extern int setjmp (struct jmp_buf_tag env[1]); 199dde4243SPaolo Bonzini extern void longjmp (struct jmp_buf_tag env[1], int val) 209dde4243SPaolo Bonzini __attribute__ ((__noreturn__)); 219dde4243SPaolo Bonzini 229dde4243SPaolo Bonzini #endif /* setjmp.h */ 23