Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348AbYJ1HaU (ORCPT ); Tue, 28 Oct 2008 03:30:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752501AbYJ1HaE (ORCPT ); Tue, 28 Oct 2008 03:30:04 -0400 Received: from rex.securecomputing.com ([203.24.151.4]:49153 "EHLO cyberguard.com.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752371AbYJ1HaA (ORCPT ); Tue, 28 Oct 2008 03:30:00 -0400 Message-ID: <4906BE61.1090000@snapgear.com> Date: Tue, 28 Oct 2008 17:25:21 +1000 From: Greg Ungerer User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Geert Uytterhoeven CC: Steven Rostedt , Frederic Weisbecker , Ingo Molnar , Alexey Dobriyan , Stephen Rothwell , Richard Henderson , Greg Ungerer , Linux/m68k , linux-next@vger.kernel.org, LKML , Andrew Morton Subject: Re: [PATCH] ftrace: handle archs that do not support irqs_disabled_flags References: <20081023213637.eff9b414.sfr@canb.auug.org.au> <20081023121145.GB27984@x200.localdomain> <49008D12.5090204@gmail.com> <4900B414.7090002@gmail.com> <20081023163433.GA3160@x200.localdomain> <20081023163850.GB16591@elte.hu> <4901D8CD.7000405@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1958 Lines: 67 Hi Geert, Geert Uytterhoeven wrote: > On Fri, 24 Oct 2008, Steven Rostedt wrote: >> Some architectures do not support a way to read the irq flags that >> is set from "local_irq_save(flags)" to determine if interrupts were >> disabled or enabled. Ftrace uses this information to display to the user >> if the trace occurred with interrupts enabled or disabled. > > Both alpha > > #define irqs_disabled() (getipl() == IPL_MAX) > > and m68k > > static inline int irqs_disabled(void) > { > unsigned long flags; > local_save_flags(flags); > return flags & ~ALLOWINT; > } > > do have irqs_disabled(), but they don't have irqs_disabled_flags(). > > M68knommu has both, but they don't check the same thing: > > #define irqs_disabled() \ > ({ \ > unsigned long flags; \ > local_save_flags(flags); \ > ((flags & 0x0700) == 0x0700); \ > }) > > static inline int irqs_disabled_flags(unsigned long flags) > { > if (flags & 0x0700) > return 0; > else > return 1; > } > > Is there a semantic difference between them (except that the latter takes the > flags as a parameter)? No... > Or can we just extract the core logic of irqs_disabled() into > irqs_disabled_flags()? Yep, could certainly do that. I'll put a patch together. Regards Greg ------------------------------------------------------------------------ Greg Ungerer -- Chief Software Dude EMAIL: gerg@snapgear.com Secure Computing Corporation PHONE: +61 7 3435 2888 825 Stanley St, FAX: +61 7 3891 3630 Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com -- 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/