aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/ipipe.c
diff options
context:
space:
mode:
authorYi Li <yi.li@analog.com>2009-06-11 01:51:57 -0400
committerMike Frysinger <vapier@gentoo.org>2009-06-13 07:20:11 -0400
commit6640cfa82b77fa63f6d3fc284dbd3ab957842936 (patch)
treeb5664cef66af6286fcfdbad279293fb7858f089c /arch/blackfin/kernel/ipipe.c
parent4f84b6e0bb9a7d92c791ba3607674c98f69418cb (diff)
Blackfin: update aedos-ipipe code to upstream 1.10-00
Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel/ipipe.c')
-rw-r--r--arch/blackfin/kernel/ipipe.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c
index 5fc424803a17..d8cde1fc5cb9 100644
--- a/arch/blackfin/kernel/ipipe.c
+++ b/arch/blackfin/kernel/ipipe.c
@@ -99,7 +99,7 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
99 * interrupt. 99 * interrupt.
100 */ 100 */
101 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR); 101 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR);
102 this_domain = ipipe_current_domain; 102 this_domain = __ipipe_current_domain;
103 103
104 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control))) 104 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control)))
105 head = &this_domain->p_link; 105 head = &this_domain->p_link;
@@ -212,7 +212,9 @@ void __ipipe_unstall_root_raw(void)
212 212
213int __ipipe_syscall_root(struct pt_regs *regs) 213int __ipipe_syscall_root(struct pt_regs *regs)
214{ 214{
215 struct ipipe_percpu_domain_data *p;
215 unsigned long flags; 216 unsigned long flags;
217 int ret;
216 218
217 /* 219 /*
218 * We need to run the IRQ tail hook whenever we don't 220 * We need to run the IRQ tail hook whenever we don't
@@ -231,29 +233,31 @@ int __ipipe_syscall_root(struct pt_regs *regs)
231 /* 233 /*
232 * This routine either returns: 234 * This routine either returns:
233 * 0 -- if the syscall is to be passed to Linux; 235 * 0 -- if the syscall is to be passed to Linux;
234 * 1 -- if the syscall should not be passed to Linux, and no 236 * >0 -- if the syscall should not be passed to Linux, and no
235 * tail work should be performed; 237 * tail work should be performed;
236 * -1 -- if the syscall should not be passed to Linux but the 238 * <0 -- if the syscall should not be passed to Linux but the
237 * tail work has to be performed (for handling signals etc). 239 * tail work has to be performed (for handling signals etc).
238 */ 240 */
239 241
240 if (__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL) && 242 if (!__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL))
241 __ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs) > 0) { 243 return 0;
242 if (ipipe_root_domain_p && !in_atomic()) { 244
243 /* 245 ret = __ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs);
244 * Sync pending VIRQs before _TIF_NEED_RESCHED 246
245 * is tested. 247 local_irq_save_hw(flags);
246 */ 248
247 local_irq_save_hw(flags); 249 if (!__ipipe_root_domain_p) {
248 if ((ipipe_root_cpudom_var(irqpend_himask) & IPIPE_IRQMASK_VIRT) != 0) 250 local_irq_restore_hw(flags);
249 __ipipe_sync_pipeline(IPIPE_IRQMASK_VIRT);
250 local_irq_restore_hw(flags);
251 return -1;
252 }
253 return 1; 251 return 1;
254 } 252 }
255 253
256 return 0; 254 p = ipipe_root_cpudom_ptr();
255 if ((p->irqpend_himask & IPIPE_IRQMASK_VIRT) != 0)
256 __ipipe_sync_pipeline(IPIPE_IRQMASK_VIRT);
257
258 local_irq_restore_hw(flags);
259
260 return -ret;
257} 261}
258 262
259unsigned long ipipe_critical_enter(void (*syncfn) (void)) 263unsigned long ipipe_critical_enter(void (*syncfn) (void))
@@ -329,9 +333,7 @@ asmlinkage void __ipipe_sync_root(void)
329 333
330void ___ipipe_sync_pipeline(unsigned long syncmask) 334void ___ipipe_sync_pipeline(unsigned long syncmask)
331{ 335{
332 struct ipipe_domain *ipd = ipipe_current_domain; 336 if (__ipipe_root_domain_p) {
333
334 if (ipd == ipipe_root_domain) {
335 if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status))) 337 if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status)))
336 return; 338 return;
337 } 339 }