diff --git a/src/arch/arm32/include/setjmp.h b/src/arch/arm32/include/bits/setjmp.h similarity index 68% rename from src/arch/arm32/include/setjmp.h rename to src/arch/arm32/include/bits/setjmp.h index 4828b47a2..9ee264ecd 100644 --- a/src/arch/arm32/include/setjmp.h +++ b/src/arch/arm32/include/bits/setjmp.h @@ -1,5 +1,5 @@ -#ifndef _SETJMP_H -#define _SETJMP_H +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); @@ -29,10 +29,4 @@ typedef struct { uint32_t lr; } jmp_buf[1]; -extern int __asmcall __attribute__ (( returns_twice )) -setjmp ( jmp_buf env ); - -extern void __asmcall __attribute__ (( noreturn )) -longjmp ( jmp_buf env, int val ); - -#endif /* _SETJMP_H */ +#endif /* _BITS_SETJMP_H */ diff --git a/src/arch/arm64/include/setjmp.h b/src/arch/arm64/include/bits/setjmp.h similarity index 72% rename from src/arch/arm64/include/setjmp.h rename to src/arch/arm64/include/bits/setjmp.h index 85a7a9cad..6ffd2fb0a 100644 --- a/src/arch/arm64/include/setjmp.h +++ b/src/arch/arm64/include/bits/setjmp.h @@ -1,5 +1,5 @@ -#ifndef _SETJMP_H -#define _SETJMP_H +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); @@ -35,10 +35,4 @@ typedef struct { uint64_t sp; } jmp_buf[1]; -extern int __asmcall __attribute__ (( returns_twice )) -setjmp ( jmp_buf env ); - -extern void __asmcall __attribute__ (( noreturn )) -longjmp ( jmp_buf env, int val ); - -#endif /* _SETJMP_H */ +#endif /* _BITS_SETJMP_H */ diff --git a/src/arch/i386/include/setjmp.h b/src/arch/i386/include/bits/setjmp.h similarity index 60% rename from src/arch/i386/include/setjmp.h rename to src/arch/i386/include/bits/setjmp.h index 98566696a..6b2ec9613 100644 --- a/src/arch/i386/include/setjmp.h +++ b/src/arch/i386/include/bits/setjmp.h @@ -1,5 +1,5 @@ -#ifndef _SETJMP_H -#define _SETJMP_H +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); @@ -21,10 +21,4 @@ typedef struct { uint32_t ebp; } jmp_buf[1]; -extern int __asmcall __attribute__ (( returns_twice )) -setjmp ( jmp_buf env ); - -extern void __asmcall __attribute__ (( noreturn )) -longjmp ( jmp_buf env, int val ); - -#endif /* _SETJMP_H */ +#endif /* _BITS_SETJMP_H */ diff --git a/src/arch/loong64/include/bits/setjmp.h b/src/arch/loong64/include/bits/setjmp.h new file mode 100644 index 000000000..c8d7cef0e --- /dev/null +++ b/src/arch/loong64/include/bits/setjmp.h @@ -0,0 +1,23 @@ +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +/** A jump buffer */ +typedef struct { + uint64_t s0; + uint64_t s1; + uint64_t s2; + uint64_t s3; + uint64_t s4; + uint64_t s5; + uint64_t s6; + uint64_t s7; + uint64_t s8; + + uint64_t fp; + uint64_t sp; + uint64_t ra; +} jmp_buf[1]; + +#endif /* _BITS_SETJMP_H */ diff --git a/src/arch/x86_64/include/setjmp.h b/src/arch/x86_64/include/bits/setjmp.h similarity index 64% rename from src/arch/x86_64/include/setjmp.h rename to src/arch/x86_64/include/bits/setjmp.h index 69835d9fa..adfb869ea 100644 --- a/src/arch/x86_64/include/setjmp.h +++ b/src/arch/x86_64/include/bits/setjmp.h @@ -1,5 +1,5 @@ -#ifndef _SETJMP_H -#define _SETJMP_H +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); @@ -25,10 +25,4 @@ typedef struct { uint64_t r15; } jmp_buf[1]; -extern int __asmcall __attribute__ (( returns_twice )) -setjmp ( jmp_buf env ); - -extern void __asmcall __attribute__ (( noreturn )) -longjmp ( jmp_buf env, int val ); - -#endif /* _SETJMP_H */ +#endif /* _BITS_SETJMP_H */ diff --git a/src/arch/loong64/include/setjmp.h b/src/include/setjmp.h similarity index 52% rename from src/arch/loong64/include/setjmp.h rename to src/include/setjmp.h index 1e5168338..d8cd02f46 100644 --- a/src/arch/loong64/include/setjmp.h +++ b/src/include/setjmp.h @@ -3,24 +3,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); -#include - -/** jump buffer env*/ -typedef struct { - uint64_t s0; - uint64_t s1; - uint64_t s2; - uint64_t s3; - uint64_t s4; - uint64_t s5; - uint64_t s6; - uint64_t s7; - uint64_t s8; - - uint64_t fp; - uint64_t sp; - uint64_t ra; -} jmp_buf[1]; +#include extern int __asmcall __attribute__ (( returns_twice )) setjmp ( jmp_buf env );