mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 20:07:09 +00:00
616df13511
Stop gcc from generating uninitialised variable warnings after BUG(). The problem is that MN10300's implementation of BUG() invokes system call 15 which doesn't return - but there's no way to tell the compiler that and also emit the bug table element with the correct file and line data. So instead, we make the do...while wrapper in _debug_bug_trap() an endless loop from which there's no escape. Also, while we're at it, (1) get rid of _debug_bug_trap() and just implement directly as BUG(), and (2) make the implementation of BUG() contingent on CONFIG_BUG=y. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
38 lines
863 B
C
38 lines
863 B
C
/* MN10300 Kernel bug reporting
|
|
*
|
|
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public Licence
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the Licence, or (at your option) any later version.
|
|
*/
|
|
#ifndef _ASM_BUG_H
|
|
#define _ASM_BUG_H
|
|
|
|
#ifdef CONFIG_BUG
|
|
|
|
/*
|
|
* Tell the user there is some problem.
|
|
*/
|
|
#define BUG() \
|
|
do { \
|
|
asm volatile( \
|
|
" syscall 15 \n" \
|
|
"0: \n" \
|
|
" .section __bug_table,\"a\" \n" \
|
|
" .long 0b,%0,%1 \n" \
|
|
" .previous \n" \
|
|
: \
|
|
: "i"(__FILE__), "i"(__LINE__) \
|
|
); \
|
|
} while (1)
|
|
|
|
#define HAVE_ARCH_BUG
|
|
#endif /* CONFIG_BUG */
|
|
|
|
#include <asm-generic/bug.h>
|
|
|
|
#endif /* _ASM_BUG_H */
|