From 33ded95b1ca5ebd27a762cabaee63f50eb46dcd6 Mon Sep 17 00:00:00 2001 From: Barry Song Date: Thu, 12 Aug 2010 07:56:40 +0000 Subject: Blackfin: initial preempt support while returning from interrupt Signed-off-by: Barry Song Signed-off-by: Mike Frysinger --- arch/blackfin/mach-common/interrupt.S | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/blackfin/mach-common/interrupt.S') diff --git a/arch/blackfin/mach-common/interrupt.S b/arch/blackfin/mach-common/interrupt.S index cee62cf4acd4..2df37db3b49b 100644 --- a/arch/blackfin/mach-common/interrupt.S +++ b/arch/blackfin/mach-common/interrupt.S @@ -116,7 +116,24 @@ __common_int_entry: cc = r0 == 0; if cc jump .Lcommon_restore_context; #else /* CONFIG_IPIPE */ + +#ifdef CONFIG_PREEMPT + r7 = sp; + r4.l = lo(ALIGN_PAGE_MASK); + r4.h = hi(ALIGN_PAGE_MASK); + r7 = r7 & r4; + p5 = r7; + r7 = [p5 + TI_PREEMPT]; /* get preempt count */ + r7 += 1; /* increment it */ + [p5 + TI_PREEMPT] = r7; +#endif pseudo_long_call _do_irq, p2; + +#ifdef CONFIG_PREEMPT + r7 += -1; + [p5 + TI_PREEMPT] = r7; /* restore preempt count */ +#endif + SP += 12; #endif /* CONFIG_IPIPE */ pseudo_long_call _return_from_int, p2; -- cgit v1.2.3-59-g8ed1b