Skip to contentSkip to conversation

<asm/setjmp.h>: Don't use __noreturn without header

PATCH Applied Ahmad Fatoum 2 participants 10 messages Mar 17, 2021

Subsystems (6)
Arm (32-bit) x86 PowerPC MIPS +2 more subsystems
lore
Share & tools
lore
#0 lore raw

cover <asm/setjmp.h>: Don't use __noreturn without header

__noreturn is defined in <linux/compiler.h>, which isn't included in every <asm/setjmp>, so arm32 that uses setjmp outside of bthreads fails to build. In order to keep changes to a minimum, just replace __noreturn with __attribute__((noreturn))

Tested on:
arm32, aarch64, mipsel, mips, riscv32, riscv64

Ahmad Fatoum (8):
fixup! ARM: asm: setjmp: implement coroutine dependency initjmp() fixup! kvx: Implement setjmp/longjmp/initjmp
fixup! mips: Implement setjmp/longjmp/initjmp for 32BIT fixup! openrisc: Implement setjmp/longjmp/initjmp fixup! powerpc: Implement initjmp/setjmp/longjmp fixup! riscv: Implement setjmp/longjmp/initjmp for RV32I fixup! sandbox: asm: implement setjmp/longjmp/initjmp fixup! x86: implement setjmp/longjmp/initjmp

 arch/arm/include/asm/setjmp.h      | 2 +-
 arch/kvx/include/asm/setjmp.h      | 2 +-
 arch/mips/include/asm/setjmp.h     | 2 +-
 arch/openrisc/include/asm/setjmp.h | 2 +-
 arch/powerpc/include/asm/setjmp.h  | 2 +-
 arch/riscv/include/asm/setjmp.h    | 2 +-
 arch/sandbox/include/asm/setjmp.h  | 2 +-
 arch/x86/include/asm/setjmp.h      | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/8 fixup! ARM: asm: setjmp: implement coroutine dependency initjmp()

---
 arch/arm/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/setjmp.h +1 -1
index 4877e4312411..0cee5bfdda60 100644
@@ -26,6 +26,6 @@ typedef struct jmp_buf_data jmp_buf[1];
 int setjmp(jmp_buf jmp) __attribute__((returns_twice));
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn));
 
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top);
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top);
 
 #endif /* _SETJMP_H_ */
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/8 fixup! kvx: Implement setjmp/longjmp/initjmp

In reply to Ahmad Fatoum
---
 arch/kvx/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/kvx/include/asm/setjmp.h +1 -1
index 3cfc698d9006..3c23576e6e82 100644
@@ -8,7 +8,7 @@
 
 typedef u64 jmp_buf[22];
 
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top);
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top);
 int setjmp(jmp_buf jmp) __attribute__((returns_twice));
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn));
 
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/8 fixup! mips: Implement setjmp/longjmp/initjmp for 32BIT

In reply to Ahmad Fatoum
---
 arch/mips/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/setjmp.h +1 -1
index 5a9af7773a5f..81f4d4c15f6d 100644
@@ -27,6 +27,6 @@ typedef struct __jmp_buf_internal_tag {
 
 int setjmp(jmp_buf jmp) __attribute__((returns_twice));
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn));
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top);
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top);
 
 #endif /* _MIPS_BITS_SETJMP_H */
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/8 fixup! openrisc: Implement setjmp/longjmp/initjmp

In reply to Ahmad Fatoum
---
 arch/openrisc/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/openrisc/include/asm/setjmp.h +1 -1
index 40f55b7eb594..ee73306d189d 100644
@@ -12,6 +12,6 @@ typedef long int jmp_buf[13];
 
 int setjmp(jmp_buf jmp) __attribute__((returns_twice));
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn));
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top);
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top);
 
 #endif /* _OR1K_BITS_SETJMP_H */
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 5/8 fixup! powerpc: Implement initjmp/setjmp/longjmp

In reply to Ahmad Fatoum
---
 arch/powerpc/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/setjmp.h +1 -1
index c558415c99d9..91bfcdb7f442 100644
@@ -16,6 +16,6 @@ typedef struct __jmp_buf_internal_tag {
 int setjmp(jmp_buf jmp) __attribute__((returns_twice));
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn));
 
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top);
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top);
 
 #endif /* _SETJMP_H_ */
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH 6/8 fixup! riscv: Implement setjmp/longjmp/initjmp for RV32I

In reply to Ahmad Fatoum
---
 arch/riscv/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/setjmp.h +1 -1
index 7516f6825841..468fc4b10aaf 100644
@@ -22,6 +22,6 @@ typedef struct __jmp_buf_internal_tag
 int setjmp(jmp_buf jmp) __attribute__((returns_twice));
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn));
 
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top);
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top);
 
 #endif /* _SETJMP_H_ */
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH 7/8 fixup! sandbox: asm: implement setjmp/longjmp/initjmp

In reply to Ahmad Fatoum
---
 arch/sandbox/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sandbox/include/asm/setjmp.h +1 -1
index f085a9079dd7..a300758c3d6c 100644
@@ -12,6 +12,6 @@ typedef struct jmp_buf_data jmp_buf[1];
 int setjmp(jmp_buf jmp) __attribute__((returns_twice));
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn));
 
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top);
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top);
 
 #endif
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 8/8 fixup! x86: implement setjmp/longjmp/initjmp

In reply to Ahmad Fatoum
---
 arch/x86/include/asm/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/setjmp.h +1 -1
index 88c198cfaeb9..5af5e624895c 100644
@@ -39,6 +39,6 @@ typedef struct jmp_buf_data jmp_buf[1];
 int setjmp(jmp_buf jmp) __attribute__((returns_twice)) __sjlj_attr;
 void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn)) __sjlj_attr;
 
-int initjmp(jmp_buf jmp, void __noreturn (*func)(void), void *stack_top) __sjlj_attr;
+int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top) __sjlj_attr;
 
 #endif
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#9 lore raw
In reply to Ahmad Fatoum
Quoted 8 lines · Ahmad Fatoum

__noreturn is defined in <linux/compiler.h>, which isn't included in every <asm/setjmp>, so arm32 that uses setjmp outside of bthreads fails to build. In order to keep changes to a minimum, just replace __noreturn with __attribute__((noreturn))

Tested on:
arm32, aarch64, mipsel, mips, riscv32, riscv64

Quoted 9 lines

Ahmad Fatoum (8):
fixup! ARM: asm: setjmp: implement coroutine dependency initjmp() fixup! kvx: Implement setjmp/longjmp/initjmp
fixup! mips: Implement setjmp/longjmp/initjmp for 32BIT fixup! openrisc: Implement setjmp/longjmp/initjmp fixup! powerpc: Implement initjmp/setjmp/longjmp fixup! riscv: Implement setjmp/longjmp/initjmp for RV32I fixup! sandbox: asm: implement setjmp/longjmp/initjmp fixup! x86: implement setjmp/longjmp/initjmp

Applied, thanks

Sascha

Quoted 20 lines
 arch/arm/include/asm/setjmp.h      | 2 +-
 arch/kvx/include/asm/setjmp.h      | 2 +-
 arch/mips/include/asm/setjmp.h     | 2 +-
 arch/openrisc/include/asm/setjmp.h | 2 +-
 arch/powerpc/include/asm/setjmp.h  | 2 +-
 arch/riscv/include/asm/setjmp.h    | 2 +-
 arch/sandbox/include/asm/setjmp.h  | 2 +-
 arch/x86/include/asm/setjmp.h      | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
Signature · 7 lines
2.30.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox