本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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); */
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}