• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IRQ_RETVAL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: yam_interrupt

static irqreturn_t yam_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
	struct net_device *dev;
	struct yam_port *yp;
	unsigned char iir;
	int counter = 100;
	int i;
	int handled = 0;

	for (i = 0; i < NR_PORTS; i++) {
		dev = yam_devs[i];
		yp = dev->priv;

		if (!netif_running(dev))
			continue;

		while ((iir = IIR_MASK & inb(IIR(dev->base_addr))) != IIR_NOPEND) {
			unsigned char msr = inb(MSR(dev->base_addr));
			unsigned char lsr = inb(LSR(dev->base_addr));
			unsigned char rxb;

			handled = 1;

			if (lsr & LSR_OE)
				++yp->stats.rx_fifo_errors;

			yp->dcd = (msr & RX_DCD) ? 1 : 0;

			if (--counter <= 0) {
				printk(KERN_ERR "%s: too many irq iir=%d\n",
						dev->name, iir);
				goto out;
			}
			if (msr & TX_RDY) {
				++yp->nb_mdint;
				yam_tx_byte(dev, yp);
			}
			if (lsr & LSR_RXC) {
				++yp->nb_rxint;
				rxb = inb(RBR(dev->base_addr));
				if (msr & RX_FLAG)
					yam_rx_flag(dev, yp);
				else
					yam_rx_byte(dev, yp, rxb);
			}
		}
	}
out:
	return IRQ_RETVAL(handled);
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:50,代码来源:yam.c


示例2: rtl8169_interrupt

/* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */
static irqreturn_t
rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{
    struct net_device *dev = (struct net_device *) dev_instance;
    struct rtl8169_private *tp = dev->priv;
    int boguscnt = max_interrupt_work;
    void *ioaddr = tp->mmio_addr;
    int status = 0;
    int handled = 0;

    do {
        status = RTL_R16(IntrStatus);

        /* hotplug/major error/no more work/shared irq */
        if ((status == 0xFFFF) || !status)
            break;

        handled = 1;
        /*
        		if (status & RxUnderrun)
        			link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit;
        */
        RTL_W16(IntrStatus,
                (status & RxFIFOOver) ? (status | RxOverflow) : status);

        if (!(status & rtl8169_intr_mask))
            break;

        // Rx interrupt
        if (status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver)) {
            rtl8169_rx_interrupt(dev, tp, ioaddr);
        }
        // Tx interrupt
        if (status & (TxOK | TxErr)) {
            spin_lock(&tp->lock);
            rtl8169_tx_interrupt(dev, tp, ioaddr);
            spin_unlock(&tp->lock);
        }

        boguscnt--;
    } while (boguscnt > 0);

    if (boguscnt <= 0) {
        printk(KERN_WARNING "%s: Too much work at interrupt!\n",
               dev->name);
        /* Clear all interrupt sources. */
        RTL_W16(IntrStatus, 0xffff);
    }
    return IRQ_RETVAL(handled);
}
开发者ID:wxlong,项目名称:Test,代码行数:51,代码来源:r8169.c


示例3: pci1742_interrupt_handler

irqreturn_t pci1742_interrupt_handler(int irq, void *dev_id)
#endif
{
    private_data *privdata = (private_data *) dev_id;
    INT16U tmp;


    /* 	printk("isr!\n"); */
    /* 	mdelay(1000); */

    tmp = advInp(privdata, 0x07) & 0x08;
    if (tmp) { /* interrupt from A/D or FIFO */
        /* 		KdPrint("isr!\n"); */

        if (privdata->fifo_enable) {
            pci1742_fifo_isr(privdata);
        } else {
            pci1742_nofifo_isr(privdata);
        }

        /* clear interrupt */
        advOutp(privdata, 0x08, 0x00);
        /* advOutp(privdata, 0x09, 0x00); */
    } else { /* interrupt from PCI9054 */
        tmp = advInp(privdata, 0x6a) & 0x20;
        if (tmp != 0x20) {
            return IRQ_RETVAL(0);
        }

        pci1742_dma_isr(privdata);

        /* clear DMA interrupt */
        /* advOutpDMA(privdata, 0xa8, advInpDMA(privdata, 0xa8) | 0x08); */
    }

    return IRQ_RETVAL(1);
}
开发者ID:rct225,项目名称:scanside,代码行数:37,代码来源:advisr.c


示例4: nv_do_interrupt

static irqreturn_t nv_do_interrupt(struct ata_host_set *host_set, u8 irq_stat)
{
	int i, handled = 0;

	for (i = 0; i < host_set->n_ports; i++) {
		struct ata_port *ap = host_set->ports[i];

		if (ap && !(ap->flags & ATA_FLAG_DISABLED))
			handled += nv_host_intr(ap, irq_stat);

		irq_stat >>= NV_INT_PORT_SHIFT;
	}

	return IRQ_RETVAL(handled);
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:15,代码来源:sata_nv.c


示例5: buttons_interrupt

/*按键中断处理函数*/
static irqreturn_t buttons_interrupt(int irq, void *dev_id)
{
	int i;
	for(i=0; i<6; i++){
		if(irq == button_irqs[i]){
			//printk("==>interrput number:%d\n",irq);
			key_value = i;
			ev_press =1;
			wake_up_interruptible(&button_waitq);
		}
	}

	return IRQ_RETVAL(IRQ_HANDLED);

}
开发者ID:xf739645524,项目名称:ok6410-drivers,代码行数:16,代码来源:plat_btn_driver.c


示例6: buttons_interrupt

static irqreturn_t buttons_interrupt(int irq, void *dev_id)
{
	struct button_irq_desc *button_irq = (struct button_irq_desc *)dev_id;
	int down;

	down = !s3c2410_gpio_getpin(button_irq->pin);
	if (down != (key_values[button_irq->number] & 1)) {
		/* printk(KERN_ALERT "key_values[button_irq->number] & 1 = %d\n", key_values[button_irq->number] & 1); */
		key_values[button_irq->number] = '0' + down;
		ev_press = 1;
		wake_up_interruptible(&button_waitq);
	}	

	return IRQ_RETVAL(IRQ_HANDLED);
}
开发者ID:jiankangshiye,项目名称:onedriveroneweek,代码行数:15,代码来源:keys.c


示例7: pb1200_cascade_handler

irqreturn_t pb1200_cascade_handler( int irq, void *dev_id)
{
	unsigned short bisr = bcsr->int_status;
	int extirq_nr = 0;

	/* Clear all the edge interrupts. This has no effect on level */
	bcsr->int_status = bisr;
	for( ; bisr; bisr &= (bisr-1) )
	{
		extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr);
		/* Ack and dispatch IRQ */
		do_IRQ(extirq_nr);
	}

	return IRQ_RETVAL(1);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:16,代码来源:irqmap.c


示例8: imxmci_irq

static irqreturn_t imxmci_irq(int irq, void *devid)
{
	struct imxmci_host *host = devid;
	uint32_t stat = MMC_STATUS;
	int handled = 1;

	MMC_INT_MASK = host->imask | INT_MASK_SDIO | INT_MASK_AUTO_CARD_DETECT;

	atomic_set(&host->stuck_timeout, 0);
	host->status_reg = stat;
	set_bit(IMXMCI_PEND_IRQ_b, &host->pending_events);
	set_bit(IMXMCI_PEND_STARTED_b, &host->pending_events);
	tasklet_schedule(&host->tasklet);

	return IRQ_RETVAL(handled);;
}
开发者ID:ivucica,项目名称:linux,代码行数:16,代码来源:imxmmc.c


示例9: dvfs_irq

static irqreturn_t dvfs_irq(int irq, void *dev_id)
{

	u32 pmcr0 = __raw_readl(MXC_CCM_PMCR0);

	/* Config dvfs_start bit */
	pmcr0 = pmcr0 | MXC_CCM_PMCR0_DVFS_START;
	/*Mask interrupt */
	pmcr0 = pmcr0 | MXC_CCM_PMCR0_FSVAIM;
	__raw_writel(pmcr0, MXC_CCM_PMCR0);

	stored_pmcr0 = pmcr0;
	schedule_delayed_work(&dvfs_work, 0);

	return IRQ_RETVAL(1);
}
开发者ID:twobob,项目名称:KK_kernel,代码行数:16,代码来源:dvfs.c


示例10: altera_uart_interrupt

static irqreturn_t altera_uart_interrupt(int irq, void *data)
{
	struct uart_port *port = data;
	struct altera_uart *pp = container_of(port, struct altera_uart, port);
	unsigned int isr;

	isr = altera_uart_readl(port, ALTERA_UART_STATUS_REG) & pp->imr;

	spin_lock(&port->lock);
	if (isr & ALTERA_UART_STATUS_RRDY_MSK)
		altera_uart_rx_chars(pp);
	if (isr & ALTERA_UART_STATUS_TRDY_MSK)
		altera_uart_tx_chars(pp);
	spin_unlock(&port->lock);

	return IRQ_RETVAL(isr);
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:17,代码来源:altera_uart.c


示例11: sca_intr

static irqreturn_t sca_intr(int irq, void *dev_id)
{
	card_t *card = dev_id;
	u32 isr0 = sca_inl(ISR0, card);
	int i, handled = 0;

	for (i = 0; i < 2; i++) {
		port_t *port = get_port(card, i);
		if (port && (isr0 & (i ? 0x08002200 : 0x00080022))) {
			handled = 1;
			disable_intr(port);
			napi_schedule(&port->napi);
		}
	}

	return IRQ_RETVAL(handled);
}
开发者ID:STS-Dev-Team,项目名称:kernel_mapphone_kexec,代码行数:17,代码来源:hd64572.c


示例12: isp_isr

static irqreturn_t isp_isr(int irq, void *dev_id)
{
	struct isp_t *dev;
	unsigned long flags;

	dev = (struct isp_t *) dev_id;

	spin_lock_irqsave(&dev->lock, flags);
	dev->isp_status.status = reg_read(isp_base, ISP_STATUS_OFFSET);
	spin_unlock_irqrestore(&dev->lock, flags);

	reg_write(isp_base, ISP_STATUS_OFFSET, dev->isp_status.status);

	complete(&dev->irq_sem);

	return IRQ_RETVAL(1);
}
开发者ID:TheNikiz,项目名称:android_kernel_samsung_hawaii,代码行数:17,代码来源:isp.c


示例13: buttons_interrupt

static irqreturn_t buttons_interrupt(int irq, void *dev_id)
{
    //获取当前按键资源的索引
    int key = (int)dev_id;

    if(key_status[key] == KEY_UP)
    {
        //设置当前按键的状态为不确定
        key_status[key] = KEY_UNCERTAIN;

        //设置当前按键按下去抖定时器的延时并启动定时器
        key_timers[key].expires = jiffies + KEY_TIMER_DELAY1;
        add_timer(&key_timers[key]);
    }

    return IRQ_RETVAL(IRQ_HANDLED);
}
开发者ID:cutecheng,项目名称:rounder,代码行数:17,代码来源:button.c


示例14: tiny6410_keys_irq

static irqreturn_t tiny6410_keys_irq(int irq, void *dev_id)
{
    unsigned int tmp;
    irq_dev = (struct key_desc *)dev_id;

    if ((irq_dev->irq == IRQ_EINT(19)) || (irq_dev->irq == IRQ_EINT(20))) {
        tmp = readl(S3C64XX_GPLDAT);
        irq_dev->pin_val = tmp & (1<<irq_dev->pin);
    }else {
        tmp = readl(S3C64XX_GPNDAT);
        irq_dev->pin_val = tmp & (1<<irq_dev->pin);
    }
    
    /* Start the timer after 10ms */
    mod_timer(&keys_timers, jiffies+HZ/100);
    return IRQ_RETVAL(IRQ_HANDLED);
}
开发者ID:uwyyk,项目名称:LINUX_DRIVERS,代码行数:17,代码来源:tiny6410_input_key.c


示例15: sah_Intr_Top_Half

/*!
*******************************************************************************
* This function is the Top Half of the interrupt handler.  It updates the
* status of any finished descriptor chains and then tries to add any pending
* requests into the hardware.  It then queues the bottom half to complete
* operations on the finished chains.
*
* @brief     SAHARA Interrupt Handler Top Half
*
* @param    irq     Part of the kernel prototype.
* @param    dev_id  Part of the kernel prototype.
*
* @return   An IRQ_RETVAL() -- non-zero to that function means 'handled'
*/
static irqreturn_t sah_Intr_Top_Half(int irq, void *dev_id)
{
#if defined(DIAG_DRV_INTERRUPT) && defined(DIAG_DURING_INTERRUPT)
	LOG_KDIAG("Top half of Sahara's interrupt handler called.");
#endif

	interrupt_count++;
	reset_flag = sah_Handle_Interrupt(sah_HW_Read_Status());

	/* Schedule the Bottom Half of the Interrupt. */
	tasklet_schedule(&BH_task);

	/* To get rid of the unused parameter warnings. */
	irq = 0;
	dev_id = NULL;
	return IRQ_RETVAL(1);
}
开发者ID:AvalueAES,项目名称:rev-sa01,代码行数:31,代码来源:sah_interrupt_handler.c


示例16: bsm_intr

static irqreturn_t bsm_intr( int irq, void *dev_id )
{	
	int handled=0;
	T32smSysCtl_SM_CTRL reg;
	
	//Clear the SM2SoC interrupt
	reg.u32=MV_SM_READ_REG32( SM_SM_SYS_CTRL_REG_BASE + RA_smSysCtl_SM_CTRL);
#ifdef CONFIG_MV88DE3010_BERLIN_B0
	reg.uSM_CTRL_SM2SOC_SW_INTR=0;//enable interrupt
#else
	reg.uSM_CTRL_CTRL_INT=0;
#endif
	MV_SM_WRITE_REG32( SM_SM_SYS_CTRL_REG_BASE + RA_smSysCtl_SM_CTRL,reg.u32);
	
	SMDriverprintf(("sm int\n"));
	bsm_msg_dispatch();
	return IRQ_RETVAL(handled);
}
开发者ID:deepikateriar,项目名称:Onlive-Source-Backup,代码行数:18,代码来源:sm_main.c


示例17: gusintr

irqreturn_t gusintr(int irq, void *dev_id, struct pt_regs *dummy)
{
	unsigned char src;
	extern int gus_timer_enabled;
	int handled = 0;

#ifdef CONFIG_SOUND_GUSMAX
	if (have_gus_max) {
		struct address_info *hw_config = dev_id;
		adintr(irq, (void *)hw_config->slots[1], NULL);
	}
#endif
#ifdef CONFIG_SOUND_GUS16
	if (db16) {
		struct address_info *hw_config = dev_id;
		adintr(irq, (void *)hw_config->slots[3], NULL);
	}
#endif

	while (1)
	{
		if (!(src = inb(u_IrqStatus)))
			break;
		handled = 1;
		if (src & DMA_TC_IRQ)
		{
			guswave_dma_irq();
		}
		if (src & (MIDI_TX_IRQ | MIDI_RX_IRQ))
		{
			gus_midi_interrupt(0);
		}
		if (src & (GF1_TIMER1_IRQ | GF1_TIMER2_IRQ))
		{
			if (gus_timer_enabled)
				sound_timer_interrupt();
			gus_write8(0x45, 0);	/* Ack IRQ */
			gus_timer_command(4, 0x80);		/* Reset IRQ flags */
		}
		if (src & (WAVETABLE_IRQ | ENVELOPE_IRQ))
			gus_voice_irq();
	}
	return IRQ_RETVAL(handled);
}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:44,代码来源:gus_card.c


示例18: buttons_interrupt

/*本按键驱动的中断服务程序*/
static irqreturn_t buttons_interrupt(int irq, void* dev_id) {
    struct button_irq_desc* button_irqs = (struct button_irq_desc*)dev_id;
    int down;
    // udelay(0);
    /*获取被按下的按键状态*/
    down = !s3c2410_gpio_getpin(button_irqs->pin);

    /*状态改变,按键被按下,从这句可以看出,当按键没有被按下的时候,寄存器的值为1(上拉),但按键被按下的时候,寄存器对应的值为0*/

    if (down != (key_values[button_irqs->number] & 1)) { // Changed
        /*如果key1 被按下,则key_value[0]就变为’1’,对应的ASCII 码为31*/
        key_values[button_irqs->number] = '0' + down;
        ev_press = 1; /*设置中断标志为1*/
        wake_up_interruptible(&button_waitq); /*唤醒等待队列*/

    }

    return IRQ_RETVAL(IRQ_HANDLED);
}
开发者ID:0x1abin,项目名称:linux_kernel_driver,代码行数:20,代码来源:inter.c


示例19: dio200_interrupt

/*
 * Interrupt service routine.
 */
static irqreturn_t dio200_interrupt(int irq, void *d)
{
	struct comedi_device *dev = d;
	struct dio200_private *devpriv = dev->private;
	struct comedi_subdevice *s;
	int handled;

	if (!dev->attached)
		return IRQ_NONE;

	if (devpriv->intr_sd >= 0) {
		s = &dev->subdevices[devpriv->intr_sd];
		handled = dio200_handle_read_intr(dev, s);
	} else {
		handled = 0;
	}

	return IRQ_RETVAL(handled);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:22,代码来源:amplc_dio200_common.c


示例20: seeq8005_interrupt

/* The typical workload of the driver:
   Handle the network interface interrupts. */
static irqreturn_t seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
	struct net_device *dev = dev_id;
	struct net_local *lp;
	int ioaddr, status, boguscount = 0;
	int handled = 0;

	ioaddr = dev->base_addr;
	lp = netdev_priv(dev);

	status = inw(SEEQ_STATUS);
	do {
		if (net_debug >2) {
			printk("%s: int, status=0x%04x\n",dev->name,status);
		}
		
		if (status & SEEQSTAT_WINDOW_INT) {
			handled = 1;
			outw( SEEQCMD_WINDOW_INT_ACK | (status & SEEQCMD_INT_MASK), SEEQ_CMD);
			if (net_debug) {
				printk("%s: window int!\n",dev->name);
			}
		}
		if (status & SEEQSTAT_TX_INT) {
			handled = 1;
			outw( SEEQCMD_TX_INT_ACK | (status & SEEQCMD_INT_MASK), SEEQ_CMD);
			lp->stats.tx_packets++;
			netif_wake_queue(dev);	/* Inform upper layers. */
		}
		if (status & SEEQSTAT_RX_INT) {
			handled = 1;
			/* Got a packet(s). */
			seeq8005_rx(dev);
		}
		status = inw(SEEQ_STATUS);
	} while ( (++boguscount < 10) && (status & SEEQSTAT_ANY_INT)) ;

	if(net_debug>2) {
		printk("%s: eoi\n",dev->name);
	}
	return IRQ_RETVAL(handled);
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:44,代码来源:seeq8005.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IRStmt_Dirty函数代码示例发布时间:2022-05-30
下一篇:
C++ IRQ_GPIO函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap