Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360677
b: refs/heads/master
c: fa771d0
h: refs/heads/master
i:
  360675: adac3aa
v: v3
  • Loading branch information
James Hogan committed Mar 2, 2013
1 parent abfc5a1 commit 6205d40
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97c3ec63089fdcd2abf66619b913900909841dc0
refs/heads/master: fa771d029af8f8a23089c97b6ab6a5745e98ad7e
11 changes: 5 additions & 6 deletions trunk/arch/metag/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@ static inline void arch_local_irq_disable(void)
asm volatile("MOV TXMASKI,%0\n" : : "r" (flags) : "memory");
}

static inline void arch_local_irq_enable(void)
{
#ifdef CONFIG_SMP
preempt_disable();
arch_local_irq_restore(get_trigger_mask());
preempt_enable_no_resched();
/* Avoid circular include dependencies through <linux/preempt.h> */
void arch_local_irq_enable(void);
#else
static inline void arch_local_irq_enable(void)
{
arch_local_irq_restore(get_trigger_mask());
#endif
}
#endif

#endif /* (__ASSEMBLY__) */

Expand Down
16 changes: 15 additions & 1 deletion trunk/arch/metag/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/types.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/preempt.h>
#include <linux/ptrace.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
Expand Down Expand Up @@ -776,17 +777,30 @@ int traps_restore_context(void)
#endif

#ifdef CONFIG_SMP
unsigned int get_trigger_mask(void)
static inline unsigned int _get_trigger_mask(void)
{
unsigned long cpu = smp_processor_id();
return per_cpu(trigger_mask, cpu);
}

unsigned int get_trigger_mask(void)
{
return _get_trigger_mask();
}

static void set_trigger_mask(unsigned int mask)
{
unsigned long cpu = smp_processor_id();
per_cpu(trigger_mask, cpu) = mask;
}

void arch_local_irq_enable(void)
{
preempt_disable();
arch_local_irq_restore(_get_trigger_mask());
preempt_enable_no_resched();
}
EXPORT_SYMBOL(arch_local_irq_enable);
#else
static void set_trigger_mask(unsigned int mask)
{
Expand Down

0 comments on commit 6205d40

Please sign in to comment.