Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753330AbYKXTEz (ORCPT ); Mon, 24 Nov 2008 14:04:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751871AbYKXTEr (ORCPT ); Mon, 24 Nov 2008 14:04:47 -0500 Received: from ftp.linux-mips.org ([213.58.128.207]:36507 "EHLO ftp.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbYKXTEq (ORCPT ); Mon, 24 Nov 2008 14:04:46 -0500 Date: Mon, 24 Nov 2008 19:04:40 +0000 (GMT) From: "Maciej W. Rozycki" To: Ralf Baechle cc: Geert Uytterhoeven , David Daney , gcc@gcc.gnu.org, Alan Cox , linux-mips , linux-kernel@vger.kernel.org, Adam Nemet Subject: Re: [PATCH] MIPS: Make BUG() __noreturn. In-Reply-To: <20081121221619.GB28154@linux-mips.org> Message-ID: References: <49260E4C.8080500@caviumnetworks.com> <20081121100035.3f5a640b@lxorguk.ukuu.org.uk> <4926E499.4070706@caviumnetworks.com> <20081121221619.GB28154@linux-mips.org> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1123 Lines: 29 On Fri, 21 Nov 2008, Ralf Baechle wrote: > MIPS ISA newer than MIPS I also have conditional break codes allowing > something like this: > > #define BUG_ON(condition) \ > do { \ > __asm__ __volatile__("tne $0, %0, %1" \ > : : "r" (condition), "i" (BRK_BUG)); \ > } while (0) > > that is test of condition and the trap as a single instruction. Note there > are break and trap instructions on MIPS and they are basically doing the > same job ... GCC is actually smart enough to combine sequences like: if (something) __builtin_trap(); into appropriate conditional trap instructions on MIPS. As noted by David trap codes other than the default cannot be emitted this way though. Maciej -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/