From da7616610c8d2ec16a8ada44216e836e5fcbd08b Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 10 Apr 2009 14:19:03 +0100 Subject: Move arch headers from include/asm-mn10300/ to arch/mn10300/include/asm/. Signed-off-by: David Howells --- arch/mn10300/include/asm/bug.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 arch/mn10300/include/asm/bug.h (limited to 'arch/mn10300/include/asm/bug.h') diff --git a/arch/mn10300/include/asm/bug.h b/arch/mn10300/include/asm/bug.h new file mode 100644 index 000000000000..4fcf3384e259 --- /dev/null +++ b/arch/mn10300/include/asm/bug.h @@ -0,0 +1,35 @@ +/* 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 + +/* + * Tell the user there is some problem. + */ +#define _debug_bug_trap() \ +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 (0) + +#define BUG() _debug_bug_trap() + +#define HAVE_ARCH_BUG +#include + +#endif /* _ASM_BUG_H */ -- cgit v1.2.3-59-g8ed1b From 616df135110ccae617ef9f10e0814fa48462cc37 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 15 Apr 2009 19:34:51 +0100 Subject: MN10300: Stop gcc from generating uninitialised variable warnings after BUG() 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 Signed-off-by: Linus Torvalds --- arch/mn10300/include/asm/bug.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'arch/mn10300/include/asm/bug.h') diff --git a/arch/mn10300/include/asm/bug.h b/arch/mn10300/include/asm/bug.h index 4fcf3384e259..aa6a38886391 100644 --- a/arch/mn10300/include/asm/bug.h +++ b/arch/mn10300/include/asm/bug.h @@ -11,10 +11,12 @@ #ifndef _ASM_BUG_H #define _ASM_BUG_H +#ifdef CONFIG_BUG + /* * Tell the user there is some problem. */ -#define _debug_bug_trap() \ +#define BUG() \ do { \ asm volatile( \ " syscall 15 \n" \ @@ -25,11 +27,11 @@ do { \ : \ : "i"(__FILE__), "i"(__LINE__) \ ); \ -} while (0) - -#define BUG() _debug_bug_trap() +} while (1) #define HAVE_ARCH_BUG +#endif /* CONFIG_BUG */ + #include #endif /* _ASM_BUG_H */ -- cgit v1.2.3-59-g8ed1b