Commit a2de3f79 authored by Steven Rostedt's avatar Steven Rostedt Committed by Mike Frysinger

Blackfin: irqs: do not trace arch_local_{*,irq_*} functions

Do not trace arch_local_save_flags(), arch_local_irq_*() and friends.
Although they are marked inline, gcc may still make a function out of
them and add it to the pool of functions that are traced by the function
tracer. This can cause undesirable results (kernel panic, triple faults,
etc).

Add the notrace notation to prevent them from ever being traced.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent b0d3dc12
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
extern unsigned long bfin_irq_flags; extern unsigned long bfin_irq_flags;
#endif #endif
static inline void bfin_sti(unsigned long flags) static inline notrace void bfin_sti(unsigned long flags)
{ {
asm volatile("sti %0;" : : "d" (flags)); asm volatile("sti %0;" : : "d" (flags));
} }
static inline unsigned long bfin_cli(void) static inline notrace unsigned long bfin_cli(void)
{ {
unsigned long flags; unsigned long flags;
asm volatile("cli %0;" : "=d" (flags)); asm volatile("cli %0;" : "=d" (flags));
...@@ -40,22 +40,22 @@ static inline unsigned long bfin_cli(void) ...@@ -40,22 +40,22 @@ static inline unsigned long bfin_cli(void)
/* /*
* Hard, untraced CPU interrupt flag manipulation and access. * Hard, untraced CPU interrupt flag manipulation and access.
*/ */
static inline void __hard_local_irq_disable(void) static inline notrace void __hard_local_irq_disable(void)
{ {
bfin_cli(); bfin_cli();
} }
static inline void __hard_local_irq_enable(void) static inline notrace void __hard_local_irq_enable(void)
{ {
bfin_sti(bfin_irq_flags); bfin_sti(bfin_irq_flags);
} }
static inline unsigned long hard_local_save_flags(void) static inline notrace unsigned long hard_local_save_flags(void)
{ {
return bfin_read_IMASK(); return bfin_read_IMASK();
} }
static inline unsigned long __hard_local_irq_save(void) static inline notrace unsigned long __hard_local_irq_save(void)
{ {
unsigned long flags; unsigned long flags;
flags = bfin_cli(); flags = bfin_cli();
...@@ -65,18 +65,18 @@ static inline unsigned long __hard_local_irq_save(void) ...@@ -65,18 +65,18 @@ static inline unsigned long __hard_local_irq_save(void)
return flags; return flags;
} }
static inline int hard_irqs_disabled_flags(unsigned long flags) static inline notrace int hard_irqs_disabled_flags(unsigned long flags)
{ {
return (flags & ~0x3f) == 0; return (flags & ~0x3f) == 0;
} }
static inline int hard_irqs_disabled(void) static inline notrace int hard_irqs_disabled(void)
{ {
unsigned long flags = hard_local_save_flags(); unsigned long flags = hard_local_save_flags();
return hard_irqs_disabled_flags(flags); return hard_irqs_disabled_flags(flags);
} }
static inline void __hard_local_irq_restore(unsigned long flags) static inline notrace void __hard_local_irq_restore(unsigned long flags)
{ {
if (!hard_irqs_disabled_flags(flags)) if (!hard_irqs_disabled_flags(flags))
__hard_local_irq_enable(); __hard_local_irq_enable();
...@@ -113,31 +113,31 @@ void ipipe_check_context(struct ipipe_domain *ipd); ...@@ -113,31 +113,31 @@ void ipipe_check_context(struct ipipe_domain *ipd);
/* /*
* Interrupt pipe interface to linux/irqflags.h. * Interrupt pipe interface to linux/irqflags.h.
*/ */
static inline void arch_local_irq_disable(void) static inline notrace void arch_local_irq_disable(void)
{ {
__check_irqop_context(); __check_irqop_context();
__ipipe_stall_root(); __ipipe_stall_root();
barrier(); barrier();
} }
static inline void arch_local_irq_enable(void) static inline notrace void arch_local_irq_enable(void)
{ {
barrier(); barrier();
__check_irqop_context(); __check_irqop_context();
__ipipe_unstall_root(); __ipipe_unstall_root();
} }
static inline unsigned long arch_local_save_flags(void) static inline notrace unsigned long arch_local_save_flags(void)
{ {
return __ipipe_test_root() ? bfin_no_irqs : bfin_irq_flags; return __ipipe_test_root() ? bfin_no_irqs : bfin_irq_flags;
} }
static inline int arch_irqs_disabled_flags(unsigned long flags) static inline notrace int arch_irqs_disabled_flags(unsigned long flags)
{ {
return flags == bfin_no_irqs; return flags == bfin_no_irqs;
} }
static inline unsigned long arch_local_irq_save(void) static inline notrace unsigned long arch_local_irq_save(void)
{ {
unsigned long flags; unsigned long flags;
...@@ -148,13 +148,13 @@ static inline unsigned long arch_local_irq_save(void) ...@@ -148,13 +148,13 @@ static inline unsigned long arch_local_irq_save(void)
return flags; return flags;
} }
static inline void arch_local_irq_restore(unsigned long flags) static inline notrace void arch_local_irq_restore(unsigned long flags)
{ {
__check_irqop_context(); __check_irqop_context();
__ipipe_restore_root(flags == bfin_no_irqs); __ipipe_restore_root(flags == bfin_no_irqs);
} }
static inline unsigned long arch_mangle_irq_bits(int virt, unsigned long real) static inline notrace unsigned long arch_mangle_irq_bits(int virt, unsigned long real)
{ {
/* /*
* Merge virtual and real interrupt mask bits into a single * Merge virtual and real interrupt mask bits into a single
...@@ -163,7 +163,7 @@ static inline unsigned long arch_mangle_irq_bits(int virt, unsigned long real) ...@@ -163,7 +163,7 @@ static inline unsigned long arch_mangle_irq_bits(int virt, unsigned long real)
return (real & ~(1 << 31)) | ((virt != 0) << 31); return (real & ~(1 << 31)) | ((virt != 0) << 31);
} }
static inline int arch_demangle_irq_bits(unsigned long *x) static inline notrace int arch_demangle_irq_bits(unsigned long *x)
{ {
int virt = (*x & (1 << 31)) != 0; int virt = (*x & (1 << 31)) != 0;
*x &= ~(1L << 31); *x &= ~(1L << 31);
...@@ -174,7 +174,7 @@ static inline int arch_demangle_irq_bits(unsigned long *x) ...@@ -174,7 +174,7 @@ static inline int arch_demangle_irq_bits(unsigned long *x)
* Interface to various arch routines that may be traced. * Interface to various arch routines that may be traced.
*/ */
#ifdef CONFIG_IPIPE_TRACE_IRQSOFF #ifdef CONFIG_IPIPE_TRACE_IRQSOFF
static inline void hard_local_irq_disable(void) static inline notrace void hard_local_irq_disable(void)
{ {
if (!hard_irqs_disabled()) { if (!hard_irqs_disabled()) {
__hard_local_irq_disable(); __hard_local_irq_disable();
...@@ -182,7 +182,7 @@ static inline void hard_local_irq_disable(void) ...@@ -182,7 +182,7 @@ static inline void hard_local_irq_disable(void)
} }
} }
static inline void hard_local_irq_enable(void) static inline notrace void hard_local_irq_enable(void)
{ {
if (hard_irqs_disabled()) { if (hard_irqs_disabled()) {
ipipe_trace_end(0x80000000); ipipe_trace_end(0x80000000);
...@@ -190,7 +190,7 @@ static inline void hard_local_irq_enable(void) ...@@ -190,7 +190,7 @@ static inline void hard_local_irq_enable(void)
} }
} }
static inline unsigned long hard_local_irq_save(void) static inline notrace unsigned long hard_local_irq_save(void)
{ {
unsigned long flags = hard_local_save_flags(); unsigned long flags = hard_local_save_flags();
if (!hard_irqs_disabled_flags(flags)) { if (!hard_irqs_disabled_flags(flags)) {
...@@ -200,7 +200,7 @@ static inline unsigned long hard_local_irq_save(void) ...@@ -200,7 +200,7 @@ static inline unsigned long hard_local_irq_save(void)
return flags; return flags;
} }
static inline void hard_local_irq_restore(unsigned long flags) static inline notrace void hard_local_irq_restore(unsigned long flags)
{ {
if (!hard_irqs_disabled_flags(flags)) { if (!hard_irqs_disabled_flags(flags)) {
ipipe_trace_end(0x80000001); ipipe_trace_end(0x80000001);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment