lkml.org 
[lkml]   [2008]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ftrace: handle archs that do not support irqs_disabled_flags
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


\
 
 \ /
  Last update: 2008-10-28 08:33    [W:0.069 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site