int xnintr_mount(void) { int i; for (i = 0; i < RTHAL_NR_IRQS; ++i) xnlock_init(&xnirqs[i].lock); return 0; }
int __init xnintr_mount(void) { int i; for (i = 0; i < XNARCH_NR_IRQS; ++i) xnlock_init(&xnirqs[i].lock); return 0; }
void xnsched_init(struct xnsched *sched, int cpu) { char htimer_name[XNOBJECT_NAME_LEN]; char root_name[XNOBJECT_NAME_LEN]; union xnsched_policy_param param; struct xnthread_init_attr attr; struct xnsched_class *p; sched->cpu = cpu; for_each_xnsched_class(p) { if (p->sched_init) p->sched_init(sched); } #ifdef CONFIG_SMP sprintf(htimer_name, "[host-timer/%u]", cpu); sprintf(root_name, "ROOT/%u", cpu); #else strcpy(htimer_name, "[host-timer]"); strcpy(root_name, "ROOT"); #endif sched->status = 0; sched->inesting = 0; sched->curr = &sched->rootcb; #ifdef CONFIG_XENO_OPT_PRIOCPL xnlock_init(&sched->rpilock); #endif /* * No direct handler here since the host timer processing is * postponed to xnintr_irq_handler(), as part of the interrupt * exit code. */ xntimer_init(&sched->htimer, &nktbase, NULL); xntimer_set_priority(&sched->htimer, XNTIMER_LOPRIO); xntimer_set_name(&sched->htimer, htimer_name); xntimer_set_sched(&sched->htimer, sched); sched->zombie = NULL; xnarch_cpus_clear(sched->resched); attr.flags = XNROOT | XNSTARTED | XNFPU; attr.name = root_name; attr.stacksize = 0; attr.tbase = &nktbase; attr.ops = NULL; param.idle.prio = XNSCHED_IDLE_PRIO; xnthread_init(&sched->rootcb, &attr, sched, &xnsched_class_idle, ¶m); sched->rootcb.affinity = xnarch_cpumask_of_cpu(cpu); xnstat_exectime_set_current(sched, &sched->rootcb.stat.account); #ifdef CONFIG_XENO_HW_FPU sched->fpuholder = &sched->rootcb; #endif /* CONFIG_XENO_HW_FPU */ xnarch_init_root_tcb(xnthread_archtcb(&sched->rootcb), &sched->rootcb, xnthread_name(&sched->rootcb)); #ifdef CONFIG_XENO_OPT_WATCHDOG xntimer_init(&sched->wdtimer, &nktbase, xnsched_watchdog_handler); xntimer_set_name(&sched->wdtimer, "[watchdog]"); xntimer_set_priority(&sched->wdtimer, XNTIMER_LOPRIO); xntimer_set_sched(&sched->wdtimer, sched); #endif /* CONFIG_XENO_OPT_WATCHDOG */ xntimerq_init(&sched->timerqueue); }