24 #include <linux/kernel.h>
25 #include <linux/sched.h>
26 #include <linux/module.h>
29 #include <linux/bitops.h>
30 #include <linux/errno.h>
41 static void __ipipe_no_irqtail(
void);
57 static void __ipipe_ack_irq(
unsigned irq,
struct irq_desc *
desc)
59 desc->ipipe_ack(irq, desc);
73 for (irq = 0; irq <
NR_IRQS; ++irq)
74 ipipe_virtualize_irq(ipipe_root_domain,
79 IPIPE_HANDLE_MASK | IPIPE_PASS_MASK);
89 struct ipipe_percpu_domain_data *
p = ipipe_root_cpudom_ptr();
90 struct ipipe_domain *this_domain, *next_domain;
92 struct ipipe_irqdesc *idesc;
102 this_domain = __ipipe_current_domain;
103 idesc = &this_domain->irqs[irq];
106 head = &this_domain->p_link;
108 head = __ipipe_pipeline.
next;
109 next_domain =
list_entry(head,
struct ipipe_domain, p_link);
110 idesc = &next_domain->irqs[irq];
112 if (!m_ack && idesc->acknowledge !=
NULL)
114 if (
test_bit(IPIPE_SYNCDEFER_FLAG, &p->status))
117 __ipipe_dispatch_wired(next_domain, irq);
125 while (
pos != &__ipipe_pipeline) {
127 idesc = &next_domain->irqs[irq];
128 if (
test_bit(IPIPE_HANDLE_FLAG, &idesc->control)) {
129 __ipipe_set_irq_pending(next_domain, irq);
130 if (!m_ack && idesc->acknowledge !=
NULL) {
135 if (!
test_bit(IPIPE_PASS_FLAG, &idesc->control))
137 pos = next_domain->p_link.next;
148 if (
test_bit(IPIPE_SYNCDEFER_FLAG, &
p->status))
156 if (
test_bit(IPIPE_AHEAD_FLAG, &this_domain->flags) &&
157 !__ipipe_ipending_p(ipipe_head_cpudom_ptr()))
160 __ipipe_walk_pipeline(
head);
169 int prio = __ipipe_get_irq_priority(irq);
172 if (ipd != &ipipe_root &&
180 int prio = __ipipe_get_irq_priority(irq);
182 if (ipd != &ipipe_root &&
190 struct ipipe_percpu_domain_data *
p;
214 !__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL))
217 ret = __ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs);
225 if (
current->ipipe_flags & PF_EVTRET) {
226 current->ipipe_flags &= ~PF_EVTRET;
227 __ipipe_dispatch_event(IPIPE_EVENT_RETURN, regs);
230 if (!__ipipe_root_domain_p)
233 p = ipipe_root_cpudom_ptr();
234 if (__ipipe_ipending_p(p))
235 __ipipe_sync_pipeline();
243 static void __ipipe_no_irqtail(
void)
250 info->sys_cpu_freq = ipipe_cpu_freq();
251 info->sys_hrtimer_irq = IPIPE_TIMER_IRQ;
267 #ifdef CONFIG_IPIPE_DEBUG
268 if (irq >= IPIPE_NR_IRQS ||
269 (ipipe_virtual_irq_p(irq)
270 && !
test_bit(irq - IPIPE_VIRQ_BASE, &__ipipe_virtual_irq_map)))
284 struct ipipe_percpu_domain_data *
p;
294 clear_thread_flag(TIF_IRQ_SYNC);
296 p = ipipe_root_cpudom_ptr();
297 if (__ipipe_ipending_p(p))
298 __ipipe_sync_pipeline();
305 if (__ipipe_root_domain_p &&
309 __ipipe_sync_stage();
342 p = &__ipipe_root_status;
354 p = &__ipipe_root_status;
364 const unsigned long *
p;
369 p = &__ipipe_root_status;
382 p = &__ipipe_root_status;
393 p = &__ipipe_root_status;