本文整理汇总了C++中raise_softirq函数的典型用法代码示例。如果您正苦于以下问题:C++ raise_softirq函数的具体用法?C++ raise_softirq怎么用?C++ raise_softirq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了raise_softirq函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: do_block
/* Block the currently-executing domain until a pertinent event occurs. */
static long do_block(void)
{
struct vcpu *v = current;
local_event_delivery_enable();
set_bit(_VPF_blocked, &v->pause_flags);
/* Check for events /after/ blocking: avoids wakeup waiting race. */
if ( local_events_need_delivery() )
{
clear_bit(_VPF_blocked, &v->pause_flags);
}
else
{
TRACE_2D(TRC_SCHED_BLOCK, v->domain->domain_id, v->vcpu_id);
raise_softirq(SCHEDULE_SOFTIRQ);
}
return 0;
}
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:21,代码来源:schedule.c
示例17: rcu_do_batch
/*
* Invoke the completed RCU callbacks. They are expected to be in
* a per-cpu list.
*/
static void rcu_do_batch(struct rcu_data *rdp)
{
struct rcu_head *next, *list;
int count = 0;
list = rdp->donelist;
while (list) {
next = rdp->donelist = list->next;
list->func(list);
list = next;
rdp->qlen--;
if (++count >= rdp->blimit)
break;
}
if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark)
rdp->blimit = blimit;
if (!rdp->donelist)
rdp->donetail = &rdp->donelist;
else
raise_softirq(RCU_SOFTIRQ);
}
开发者ID:a2k2,项目名称:xen-unstable,代码行数:25,代码来源:rcupdate.c
示例18: tlbflush_clock_inc_and_return
u32
tlbflush_clock_inc_and_return(void)
{
u32 t, t1, t2;
t = tlbflush_clock;
do {
t1 = t2 = t;
/* Clock wrapped: someone else is leading a global TLB shootdown. */
if (unlikely(t1 == 0))
return t2;
t2 = (t + 1) & WRAP_MASK;
t = ia64_cmpxchg(acq, &tlbflush_clock, t1, t2, sizeof(tlbflush_clock));
} while (unlikely(t != t1));
/* Clock wrapped: we will lead a global TLB shootdown. */
if (unlikely(t2 == 0))
raise_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ);
return t2;
}
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:21,代码来源:flushtlb.c
示例19: tasklet_action
static void tasklet_action(void)
{
struct tasklet *t;
spin_lock_irq(&tasklet_lock);
if ( list_empty(&tasklet_list) )
{
spin_unlock_irq(&tasklet_lock);
return;
}
t = list_entry(tasklet_list.next, struct tasklet, list);
list_del_init(&t->list);
BUG_ON(t->is_dead || t->is_running || !t->is_scheduled);
t->is_scheduled = 0;
t->is_running = 1;
spin_unlock_irq(&tasklet_lock);
t->func(t->data);
spin_lock_irq(&tasklet_lock);
t->is_running = 0;
if ( t->is_scheduled )
{
BUG_ON(t->is_dead || !list_empty(&t->list));
list_add_tail(&t->list, &tasklet_list);
}
/*
* If there is more work to do then reschedule. We don't grab more work
* immediately as we want to allow other softirq work to happen first.
*/
if ( !list_empty(&tasklet_list) )
raise_softirq(TASKLET_SOFTIRQ);
spin_unlock_irq(&tasklet_lock);
}
开发者ID:avasani,项目名称:modified-xen,代码行数:40,代码来源:softirq.c
示例20: hrtimer_enqueue_reprogram
/*
* When High resolution timers are active, try to reprogram. Note, that in case
* the state has HRTIMER_STATE_CALLBACK set, no reprogramming and no expiry
* check happens. The timer gets enqueued into the rbtree. The reprogramming
* and expiry check is done in the hrtimer_interrupt or in the softirq.
*/
static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
struct hrtimer_clock_base *base)
{
if (base->cpu_base->hres_active && hrtimer_reprogram(timer, base)) {
/* Timer is expired, act upon the callback mode */
switch(timer->cb_mode) {
case HRTIMER_CB_IRQSAFE_NO_RESTART:
/*
* We can call the callback from here. No restart
* happens, so no danger of recursion
*/
BUG_ON(timer->function(timer) != HRTIMER_NORESTART);
return 1;
case HRTIMER_CB_IRQSAFE_NO_SOFTIRQ:
/*
* This is solely for the sched tick emulation with
* dynamic tick support to ensure that we do not
* restart the tick right on the edge and end up with
* the tick timer in the softirq ! The calling site
* takes care of this.
*/
return 1;
case HRTIMER_CB_IRQSAFE:
case HRTIMER_CB_SOFTIRQ:
/*
* Move everything else into the softirq pending list !
*/
list_add_tail(&timer->cb_entry,
&base->cpu_base->cb_pending);
timer->state = HRTIMER_STATE_PENDING;
raise_softirq(HRTIMER_SOFTIRQ);
return 1;
default:
BUG();
}
}
return 0;
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:45,代码来源:hrtimer.c
注:本文中的raise_softirq函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论