当前位置: 首页>>代码示例>>C++>>正文


C++ raise_softirq函数代码示例

本文整理汇总了C++中raise_softirq函数的典型用法代码示例。如果您正苦于以下问题:C++ raise_softirq函数的具体用法?C++ raise_softirq怎么用?C++ raise_softirq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了raise_softirq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mwait_idle_with_hints

void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
{
    unsigned int cpu = smp_processor_id();
    s_time_t expires = per_cpu(timer_deadline, cpu);

    if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
    {
        mb();
        clflush((void *)&mwait_wakeup(cpu));
        mb();
    }

    __monitor((void *)&mwait_wakeup(cpu), 0, 0);
    smp_mb();

    /*
     * Timer deadline passing is the event on which we will be woken via
     * cpuidle_mwait_wakeup. So check it now that the location is armed.
     */
    if ( (expires > NOW() || expires == 0) && !softirq_pending(cpu) )
    {
        cpumask_set_cpu(cpu, &cpuidle_mwait_flags);
        __mwait(eax, ecx);
        cpumask_clear_cpu(cpu, &cpuidle_mwait_flags);
    }

    if ( expires <= NOW() && expires > 0 )
        raise_softirq(TIMER_SOFTIRQ);
}
开发者ID:robhoes,项目名称:xen,代码行数:29,代码来源:cpu_idle.c

示例2: do_tasklet

/* VCPU context work */
void do_tasklet(void)
{
    unsigned int cpu = smp_processor_id();
    unsigned long *work_to_do = &per_cpu(tasklet_work_to_do, cpu);
    struct list_head *list = &per_cpu(tasklet_list, cpu);

    /*
     * We want to be sure any caller has checked that a tasklet is both
     * enqueued and scheduled, before calling this. And, if the caller has
     * actually checked, it's not an issue that we are outside of the
     * critical region, in fact:
     * - TASKLET_enqueued is cleared only here,
     * - TASKLET_scheduled is only cleared when schedule() find it set,
     *   without TASKLET_enqueued being set as well.
     */
    ASSERT(tasklet_work_to_do(cpu));

    spin_lock_irq(&tasklet_lock);

    do_tasklet_work(cpu, list);

    if ( list_empty(list) )
    {
        clear_bit(_TASKLET_enqueued, work_to_do);        
        raise_softirq(SCHEDULE_SOFTIRQ);
    }

    spin_unlock_irq(&tasklet_lock);
}
开发者ID:fdario,项目名称:xen,代码行数:30,代码来源:tasklet.c

示例3: smp_apic_timer_interrupt

fastcall void smp_apic_timer_interrupt(struct cpu_user_regs * regs)
{
    struct cpu_user_regs *old_regs = set_irq_regs(regs);
    ack_APIC_irq();
    perfc_incr(apic_timer);
    raise_softirq(TIMER_SOFTIRQ);
    set_irq_regs(old_regs);
}
开发者ID:sudkannan,项目名称:xen-hv,代码行数:8,代码来源:apic.c

示例4: rcu_bh_qs

/*
 * Record an rcu_bh quiescent state.
 */
void rcu_bh_qs(void)
{
	unsigned long flags;

	local_irq_save(flags);
	if (rcu_qsctr_help(&rcu_bh_ctrlblk))
		raise_softirq(RCU_SOFTIRQ);
	local_irq_restore(flags);
}
开发者ID:agroce,项目名称:cbmcmutate,代码行数:12,代码来源:COVER_mutant100173_tiny.c

示例5: rcu_bh_qs

/*
 * Record an rcu_bh quiescent state.
 */
void rcu_bh_qs(void)
{
	unsigned long flags;

	local_irq_save(flags);
	if (rcu_qsctr_help(&rcu_bh_ctrlblk))
		raise_softirq(RCU_SOFTIRQ);
  mutant_covered = 1;
 /* MUTANT (del_stmt) */ /* 	local_irq_restore(flags); */ 
}
开发者ID:agroce,项目名称:cbmcmutate,代码行数:13,代码来源:COVER_mutant100113_tiny.c

示例6: rcu_timer_func

static enum hrtimer_restart rcu_timer_func(struct hrtimer *t)
{
	ktime_t next;

	raise_softirq(RCU_SOFTIRQ);

	next = ktime_add_ns(ktime_get(), RCU_PERIOD_NS);
	hrtimer_set_expires_range_ns(&rcu_timer, next, RCU_PERIOD_DELTA_NS);
	return HRTIMER_RESTART;
}
开发者ID:ARMP,项目名称:samsung_kernel_cooper,代码行数:10,代码来源:jrcu.c

示例7: my_handler

//上半部
//中断处理函数,硬件自动执行,想执行的快
irqreturn_t my_handler(int irq, void *dev_id)
{
	//响应中断
	//触发软中断,软中断在合适的时机执行
	//void raise_softirq(unsigned int nr)
	raise_softirq(MYTEST_SOFTIRQ);

	printk("key1  %d is pressed\n", irq);
	return 0;
}
开发者ID:kcoewoys,项目名称:work,代码行数:12,代码来源:irq.c

示例8: rcu_sched_qs

/*
 * Record an rcu quiescent state.  And an rcu_bh quiescent state while we
 * are at it, given that any rcu quiescent state is also an rcu_bh
 * quiescent state.  Use "+" instead of "||" to defeat short circuiting.
 */
void rcu_sched_qs(void)
{
	unsigned long flags;

	local_irq_save(flags);
  mutant_covered = 1;
 /* MUTANT (rep_op) */	if (rcu_qsctr_help(&rcu_sched_ctrlblk) -
	    rcu_qsctr_help(&rcu_bh_ctrlblk))
		raise_softirq(RCU_SOFTIRQ);
	local_irq_restore(flags);
}
开发者ID:agroce,项目名称:cbmcmutate,代码行数:16,代码来源:COVER_mutant100106_tiny.c

示例9: timer_interrupt

/* Handle the firing timer */
static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
{
    if ( irq == (timer_irq[TIMER_HYP_PPI].irq) &&
         READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING )
    {
        /* Signal the generic timer code to do its work */
        raise_softirq(TIMER_SOFTIRQ);
        /* Disable the timer to avoid more interrupts */
        WRITE_SYSREG32(0, CNTHP_CTL_EL2);
    }

    if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI].irq) &&
         READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING )
    {
        /* Signal the generic timer code to do its work */
        raise_softirq(TIMER_SOFTIRQ);
        /* Disable the timer to avoid more interrupts */
        WRITE_SYSREG32(0, CNTP_CTL_EL0);
    }
}
开发者ID:HPSI,项目名称:xen-v4v,代码行数:21,代码来源:time.c

示例10: rcu_bh_qs

/*
 * Record an rcu_bh quiescent state.
 */
void rcu_bh_qs(void)
{
	unsigned long flags;

	local_irq_save(flags);
	if (rcu_qsctr_help(&rcu_bh_ctrlblk)) {
		if (!__covered10) {__covered10 = 1; total_covered += 1;}
		raise_softirq(RCU_SOFTIRQ);
	}
	local_irq_restore(flags);
}
开发者ID:agroce,项目名称:cbmcmutate,代码行数:14,代码来源:BRANCHCOV_mutant100059_mytiny.c

示例11: rcu_bh_qs

/*
 * Record an rcu_bh quiescent state.
 */
void rcu_bh_qs(void)
{
	unsigned long flags;

 mutant_covered = 1;
 /* MUTANT (del_stmt) */ /* 	local_irq_save(flags); */ 
	if (rcu_qsctr_help(&rcu_bh_ctrlblk)) {
		if (!__covered10) {__covered10 = 1; total_covered += 1;}
		raise_softirq(RCU_SOFTIRQ);
	}
	local_irq_restore(flags);
}
开发者ID:agroce,项目名称:cbmcmutate,代码行数:15,代码来源:BRANCHCOV_mutant100116_mytiny.c

示例12: do_poll

static long do_poll(struct sched_poll *sched_poll)
{
    struct vcpu   *v = current;
    struct domain *d = v->domain;
    evtchn_port_t  port;
    long           rc = 0;
    unsigned int   i;

    /* Fairly arbitrary limit. */
    if ( sched_poll->nr_ports > 128 )
        return -EINVAL;

    if ( !guest_handle_okay(sched_poll->ports, sched_poll->nr_ports) )
        return -EFAULT;

    set_bit(_VPF_blocked, &v->pause_flags);
    v->is_polling = 1;
    d->is_polling = 1;

    /* Check for events /after/ setting flags: avoids wakeup waiting race. */
    smp_wmb();

    for ( i = 0; i < sched_poll->nr_ports; i++ )
    {
        rc = -EFAULT;
        if ( __copy_from_guest_offset(&port, sched_poll->ports, i, 1) )
            goto out;

        rc = -EINVAL;
        if ( port >= MAX_EVTCHNS(d) )
            goto out;

        rc = 0;
        if ( test_bit(port, shared_info_addr(d, evtchn_pending)) )
            goto out;
    }

    if ( sched_poll->timeout != 0 )
        set_timer(&v->poll_timer, sched_poll->timeout);

    TRACE_2D(TRC_SCHED_BLOCK, d->domain_id, v->vcpu_id);
    raise_softirq(SCHEDULE_SOFTIRQ);

    return 0;

 out:
    v->is_polling = 0;
    clear_bit(_VPF_blocked, &v->pause_flags);
    return rc;
}
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:50,代码来源:schedule.c

示例13: tasklet_softirq_action

/* Softirq context work */
static void tasklet_softirq_action(void)
{
    unsigned int cpu = smp_processor_id();
    struct list_head *list = &per_cpu(softirq_tasklet_list, cpu);

    spin_lock_irq(&tasklet_lock);

    do_tasklet_work(cpu, list);

    if ( !list_empty(list) && !cpu_is_offline(cpu) )
        raise_softirq(TASKLET_SOFTIRQ);

    spin_unlock_irq(&tasklet_lock);
}
开发者ID:fdario,项目名称:xen,代码行数:15,代码来源:tasklet.c

示例14: force_quiescent_state

static void force_quiescent_state(struct rcu_data *rdp,
                                  struct rcu_ctrlblk *rcp)
{
    cpumask_t cpumask;
    raise_softirq(SCHEDULE_SOFTIRQ);
    if (unlikely(rdp->qlen - rdp->last_rs_qlen > rsinterval)) {
        rdp->last_rs_qlen = rdp->qlen;
        /*
         * Don't send IPI to itself. With irqs disabled,
         * rdp->cpu is the current cpu.
         */
        cpumask = rcp->cpumask;
        cpu_clear(rdp->cpu, cpumask);
        cpumask_raise_softirq(cpumask, SCHEDULE_SOFTIRQ);
    }
}
开发者ID:a2k2,项目名称:xen-unstable,代码行数:16,代码来源:rcupdate.c

示例15: tasklet_schedule

void tasklet_schedule(struct tasklet *t)
{
    unsigned long flags;

    spin_lock_irqsave(&tasklet_lock, flags);

    if ( !t->is_dead )
    {
        if ( !t->is_scheduled && !t->is_running )
        {
            BUG_ON(!list_empty(&t->list));
            list_add_tail(&t->list, &tasklet_list);
        }
        t->is_scheduled = 1;
        raise_softirq(TASKLET_SOFTIRQ);
    }

    spin_unlock_irqrestore(&tasklet_lock, flags);
}
开发者ID:avasani,项目名称:modified-xen,代码行数:19,代码来源:softirq.c


注:本文中的raise_softirq函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。