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>
This commit is contained in:
Yi Li 2009-06-11 01:51:57 -04:00 committed by Mike Frysinger
parent 4f84b6e0bb
commit 6640cfa82b
2 changed files with 37 additions and 33 deletions

View File

@ -35,10 +35,10 @@
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/traps.h> #include <asm/traps.h>
#define IPIPE_ARCH_STRING "1.9-01" #define IPIPE_ARCH_STRING "1.10-00"
#define IPIPE_MAJOR_NUMBER 1 #define IPIPE_MAJOR_NUMBER 1
#define IPIPE_MINOR_NUMBER 9 #define IPIPE_MINOR_NUMBER 10
#define IPIPE_PATCH_NUMBER 1 #define IPIPE_PATCH_NUMBER 0
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#error "I-pipe/blackfin: SMP not implemented" #error "I-pipe/blackfin: SMP not implemented"
@ -54,10 +54,11 @@ do { \
#define task_hijacked(p) \ #define task_hijacked(p) \
({ \ ({ \
int __x__ = ipipe_current_domain != ipipe_root_domain; \ int __x__ = __ipipe_root_domain_p; \
/* We would need to clear the SYNC flag for the root domain */ \ __clear_bit(IPIPE_SYNC_FLAG, &ipipe_root_cpudom_var(status)); \
/* over the current processor in SMP mode. */ \ if (__x__) \
local_irq_enable_hw(); __x__; \ local_irq_enable_hw(); \
!__x__; \
}) })
struct ipipe_domain; struct ipipe_domain;
@ -179,23 +180,24 @@ static inline unsigned long __ipipe_ffnz(unsigned long ul)
#define __ipipe_run_isr(ipd, irq) \ #define __ipipe_run_isr(ipd, irq) \
do { \ do { \
if (ipd == ipipe_root_domain) { \ if (!__ipipe_pipeline_head_p(ipd)) \
local_irq_enable_hw(); \ local_irq_enable_hw(); \
if (ipipe_virtual_irq_p(irq)) \ if (ipd == ipipe_root_domain) { \
if (unlikely(ipipe_virtual_irq_p(irq))) { \
irq_enter(); \
ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \ ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
else \ irq_exit(); \
} else \
ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \ ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \
local_irq_disable_hw(); \
} else { \ } else { \
__clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \ __clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
local_irq_enable_nohead(ipd); \
ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \ ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
/* Attempt to exit the outer interrupt level before \ /* Attempt to exit the outer interrupt level before \
* starting the deferred IRQ processing. */ \ * starting the deferred IRQ processing. */ \
local_irq_disable_nohead(ipd); \
__ipipe_run_irqtail(); \ __ipipe_run_irqtail(); \
__set_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \ __set_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
} \ } \
local_irq_disable_hw(); \
} while (0) } while (0)
#define __ipipe_syscall_watched_p(p, sc) \ #define __ipipe_syscall_watched_p(p, sc) \

View File

@ -99,7 +99,7 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
* interrupt. * interrupt.
*/ */
m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR); m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR);
this_domain = ipipe_current_domain; this_domain = __ipipe_current_domain;
if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control))) if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control)))
head = &this_domain->p_link; head = &this_domain->p_link;
@ -212,7 +212,9 @@ void __ipipe_unstall_root_raw(void)
int __ipipe_syscall_root(struct pt_regs *regs) int __ipipe_syscall_root(struct pt_regs *regs)
{ {
struct ipipe_percpu_domain_data *p;
unsigned long flags; unsigned long flags;
int ret;
/* /*
* We need to run the IRQ tail hook whenever we don't * We need to run the IRQ tail hook whenever we don't
@ -231,29 +233,31 @@ int __ipipe_syscall_root(struct pt_regs *regs)
/* /*
* This routine either returns: * This routine either returns:
* 0 -- if the syscall is to be passed to Linux; * 0 -- if the syscall is to be passed to Linux;
* 1 -- if the syscall should not be passed to Linux, and no * >0 -- if the syscall should not be passed to Linux, and no
* tail work should be performed; * tail work should be performed;
* -1 -- if the syscall should not be passed to Linux but the * <0 -- if the syscall should not be passed to Linux but the
* tail work has to be performed (for handling signals etc). * tail work has to be performed (for handling signals etc).
*/ */
if (__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL) && if (!__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL))
__ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs) > 0) { return 0;
if (ipipe_root_domain_p && !in_atomic()) {
/* ret = __ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs);
* Sync pending VIRQs before _TIF_NEED_RESCHED
* is tested. local_irq_save_hw(flags);
*/
local_irq_save_hw(flags); if (!__ipipe_root_domain_p) {
if ((ipipe_root_cpudom_var(irqpend_himask) & IPIPE_IRQMASK_VIRT) != 0) local_irq_restore_hw(flags);
__ipipe_sync_pipeline(IPIPE_IRQMASK_VIRT);
local_irq_restore_hw(flags);
return -1;
}
return 1; return 1;
} }
return 0; p = ipipe_root_cpudom_ptr();
if ((p->irqpend_himask & IPIPE_IRQMASK_VIRT) != 0)
__ipipe_sync_pipeline(IPIPE_IRQMASK_VIRT);
local_irq_restore_hw(flags);
return -ret;
} }
unsigned long ipipe_critical_enter(void (*syncfn) (void)) unsigned long ipipe_critical_enter(void (*syncfn) (void))
@ -329,9 +333,7 @@ asmlinkage void __ipipe_sync_root(void)
void ___ipipe_sync_pipeline(unsigned long syncmask) void ___ipipe_sync_pipeline(unsigned long syncmask)
{ {
struct ipipe_domain *ipd = ipipe_current_domain; if (__ipipe_root_domain_p) {
if (ipd == ipipe_root_domain) {
if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status))) if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status)))
return; return;
} }