Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] __builtin_trap() and gcc version.

__builtin_trap() has the archictecture defined backend in gcc since gcc 3.3.
To make sure the kernel builds with gcc 3.2 as well, use the old style BUG()
statement if compiled with older gcc versions.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
f4a10b21 7c3dec06

+10 -1
+10 -1
include/asm-s390/bug.h
··· 5 5 6 6 #ifdef CONFIG_BUG 7 7 8 + static inline __attribute__((noreturn)) void __do_illegal_op(void) 9 + { 10 + #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) 11 + __builtin_trap(); 12 + #else 13 + asm volatile(".long 0"); 14 + #endif 15 + } 16 + 8 17 #define BUG() do { \ 9 18 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 10 - __builtin_trap(); \ 19 + __do_illegal_op(); \ 11 20 } while (0) 12 21 13 22 #define HAVE_ARCH_BUG