亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tid_intr.c

?? 嵌入式Linux LED驅動 適合于各種LED顯示和使用
?? C
字號:
/*********************************************************************** * * (C) Copyright 2000 * Jean-Jacques Germond, Fr閐閞ic Soulier, Christian Batt; Alcatel * C/O jjg@sxb.bsf.alcatel.fr * * All rights reserved. * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU *Library* General Public License * as published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This code is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * *Library* General Public License for more details. * * You should have received a copy of the GNU *Library* General Public * License along with this program (see file COPYING.LIB); if not, * write to the Free Software Foundation, Inc., 675 Mass Ave, * Cambridge, MA 02139, USA. * ***********************************************************************//* This file implements the portable foreground code for the * Trivial interrupt driver */   /* See AR pg:21  */#  define __NO_VERSION__#include "tid_def.h"#include <linux/interrupt.h>void tid_bh_entry(void);    /* Forward declaration */#define TID_SIMU_IRQNBR   -1234    /* An interrupt # never used by linux *//************************************************ *  Static variable shared between the top *  and bottom halves of the interrupt handlers ************************************************//* The queue of waiting unix processes for the tid device */struct wait_queue* tid_queue;/* The # of intr. not yet procerssed by by bottom half */static volatile int tid_pending_count;static volatile int tid_bh_busy;   /* Tells that the bh is busy or scheduled *//* The structure to describe the bh routine */static struct tq_struct tid_bh_descr = {  NULL,                             /* link to next active bh */  0,                                /* Sync */  (void(*)(void*)) tid_bh_entry,    /* Entry point */  NULL,                             /* Argument to bh routine */};/************************************************** * The wait routines for unix processes. * (tricky: see AR pg 209) **************************************************/    static inttid_proc_must_still_wait(Tid_Dev* dev, int initFilePos, int initialUnique)     /* Test the wakeup condition at the process level */{  int nbNewChars;  /* Test if we got a signal */  if (tid_caughtSignal()) {    return -ERESTARTSYS;  }  if (initialUnique != dev->uniqueId) {    /* The file was erased by an other process, while we were waiting */    return -EIO;  }  nbNewChars = dev->nbChars - initFilePos;  if (nbNewChars < 0) {    /* Should never be here. Better safe than sorry */    return -EFAULT;  }  return nbNewChars;}    inttid_wait(loff_t initFilePos)     /* Wait for some (more) chars available in the device      * This runs at the process level, NOT at the interrupt level      */{  struct wait_queue wait = {current, NULL};    /* Must be in the stack */  int wakeupCode;  Tid_Dev* dev = &tid_dev_struct;  /* The device descriptor structure */  long initialUnique = dev->uniqueId;  /* Adding to the tid_queue is not atomic, but we are not preemptible   * since we are in the kernel space.   * Similarly, the tid_queue is NOT emtied under interrupts.   * Therefore we wont be preempted by any other UNIX process willing   * to wait on the tid device as well and do not need to protect this   * call to add_wait_queue.   */  add_wait_queue(&tid_queue, &wait);  do {    current->state = TASK_INTERRUPTIBLE;    schedule();    wakeupCode = tid_proc_must_still_wait(dev, initFilePos, initialUnique);    dev->nbWakeUp++;                /* Used to idendify the wakeup */    dev->lastWakeup = wakeupCode;   /* Log the last wakeup code */  } while (wakeupCode == 0);  /* Remove this process from the wait queue (see above about non atomicity) */  remove_wait_queue(&tid_queue, &wait);  return wakeupCode;}/************************************** * The bottom half interrupt handler **************************************/    voidtid_bh_entry(void){  unsigned long flags;  int      cur_count;  Tid_Dev* dev = &tid_dev_struct;  /* The device descriptor structure */  int      nextNbChars;  dev->nbBhActiv++;               /* The # of times the bh was activated */  /* Loop to process all pending interrupts at the bh level   * This simulates the porcessing of a fifo queue of pending events   * between the bh and th levels.   */  while (1) {    save_flags(flags);    cli();    cur_count         = tid_pending_count;   /* The local count */    tid_pending_count = 0;                   /* The inter halves count */    if (cur_count == 0) {      /* All pending interrupts are now processed at our bh level */      tid_bh_busy = 0;      /* Enable bh wake-up from the top-half */      restore_flags(flags);      wake_up_interruptible(&tid_queue);      return;    }    /* Process the pending events.     * This simulates a longish processing at the bh level.     */    restore_flags(flags);    nextNbChars = dev->nbChars + cur_count;    if (nextNbChars > dev->maxChars) {      nextNbChars = dev->maxChars;    }    dev->nbChars = nextNbChars;  }}/************************************************ *  The Top half interrupt handler ************************************************/    voidtid_it_handler(void* dev_id){  Tid_Dev *dev = (Tid_Dev *)dev_id;  dev->nbIntrEver++;                 /* # of interrupts since init */  /* Ignore the interrupt if we have too many virtual chars into */  if (dev->nbChars < dev->maxChars) {    /* Bump the # of chars pending to be processed by the bh */    tid_pending_count++;    /* Schedule the bh if not busy or already scheduled */    if (tid_bh_busy == 0) {      tid_bh_busy = 1;      if (tid_useSimulatedTimer()) {	/* Here in simulated interrupt mode */	queue_task(&tid_bh_descr, &tq_timer);	mark_bh(TQUEUE_BH);      } else {	queue_task(&tid_bh_descr, &tq_immediate);	mark_bh(IMMEDIATE_BH);      }    }  }  /* Clear off the interrupting bit as appropriate */  tid_ackTimerInterrupt(dev_id);}inttid_connect_timer(Tid_Dev* dev, unsigned long period){  /* Followng inits are useless (globals are reset at boot time) but   * it is a matter of programming style.   */ tid_pending_count = 0;   /* # of intr. not yet procerssed by by bottom half */ tid_bh_busy = 0;         /* Tells that the bh is busy or scheduled */ tid_queue   = NULL;      /* The queue of waiting processes */ tid_init_timer (dev, period); return 0;}voidtid_disconnect_timer(Tid_Dev* dev){  tid_cancel_timer (dev);      /* reset timer */}    voidtid_simu_timer_interrupt(int nbIntr)     /* This is called in timer simulated mode */{  unsigned long flags;  while (nbIntr > 0) {    nbIntr--;    save_flags(flags);    cli();    tid_it_handler(NULL);    restore_flags(flags);  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频免费观看| 日韩综合在线视频| 国产最新精品免费| 3751色影院一区二区三区| 亚洲美女免费在线| 亚洲观看高清完整版在线观看| 高清不卡一区二区在线| 欧美日韩二区三区| **性色生活片久久毛片| 美女网站色91| 日韩一区二区免费电影| 亚洲妇女屁股眼交7| 欧美日本不卡视频| 日本亚洲天堂网| 欧美成人高清电影在线| 久久福利视频一区二区| 91精品蜜臀在线一区尤物| 亚洲男人的天堂在线观看| 97久久精品人人爽人人爽蜜臀 | 日韩精品资源二区在线| 免费高清在线一区| 久久综合给合久久狠狠狠97色69| 激情综合网激情| 精品国产一区二区精华 | fc2成人免费人成在线观看播放 | 成人免费毛片嘿嘿连载视频| 亚洲欧洲精品天堂一级| 欧美色网站导航| 麻豆视频一区二区| 亚洲视频一区二区在线| 欧美肥妇bbw| 成人国产亚洲欧美成人综合网 | 1024亚洲合集| 欧美日本一区二区三区四区| 国产精品影视在线| 亚洲国产欧美另类丝袜| 国产日韩欧美不卡| 在线电影国产精品| 色婷婷久久久亚洲一区二区三区 | 一区二区三区加勒比av| 国产欧美精品区一区二区三区| 日韩一卡二卡三卡四卡| 欧美综合欧美视频| 91久久免费观看| 91福利视频久久久久| 日本丰满少妇一区二区三区| 99re热这里只有精品免费视频| 成人精品国产福利| 色综合久久99| 欧美日韩精品免费| 91精品国产黑色紧身裤美女| 欧美一区午夜视频在线观看| 日韩欧美一区二区在线视频| 日韩欧美你懂的| 欧美成人a∨高清免费观看| 精品国内二区三区| 国产精品久久久久久久浪潮网站| 中文字幕精品在线不卡| 亚洲色图20p| 亚洲高清免费视频| 日韩av一区二| 黑人精品欧美一区二区蜜桃| 国产大陆a不卡| 色偷偷88欧美精品久久久| 欧美视频一区二区三区四区| 日韩精品在线一区| 亚洲精品国产视频| 日本不卡不码高清免费观看| 国内外成人在线视频| 一本大道久久a久久精二百| 欧美亚洲愉拍一区二区| 久久亚洲精精品中文字幕早川悠里 | 国产精品久久久久久久久免费樱桃 | 亚洲欧洲国产日本综合| 久久精品免费看| 激情图片小说一区| 欧美挠脚心视频网站| 国产欧美一区二区精品仙草咪| 亚洲成人免费看| 91麻豆免费观看| 久久久高清一区二区三区| 五月天久久比比资源色| 色哟哟欧美精品| 中文字幕一区二区三区乱码在线| 奇米色777欧美一区二区| 精品视频在线看| 亚洲欧洲三级电影| caoporn国产精品| 国产欧美日韩精品在线| 久久99九九99精品| 日韩欧美在线不卡| 麻豆精品一二三| 久久这里只精品最新地址| 蜜桃视频在线一区| 久久亚洲综合色一区二区三区| 青青草视频一区| 欧美一区二区成人| 男女激情视频一区| 久久久久久久久蜜桃| 国产91露脸合集magnet| 中文字幕欧美一| 色天天综合色天天久久| 亚洲成a人v欧美综合天堂下载 | 7777精品伊人久久久大香线蕉超级流畅| 一区二区在线观看不卡| 色婷婷综合久久久久中文一区二区 | 久久精品国产亚洲高清剧情介绍| 欧美tickling网站挠脚心| 九九久久精品视频| 国产精品久久免费看| 99riav一区二区三区| 午夜精品久久久久影视| 欧美一级黄色大片| 不卡的看片网站| 五月婷婷激情综合| 久久综合999| 在线视频一区二区免费| 欧美曰成人黄网| 国产精品自在在线| 亚洲国产精品自拍| 国产精品久久综合| 日韩欧美第一区| 精品久久久久久久久久久院品网| 91丨porny丨最新| 国产乱子伦一区二区三区国色天香| 亚洲精品日韩一| 中文字幕制服丝袜一区二区三区| 3d动漫精品啪啪1区2区免费 | 毛片av一区二区三区| 亚洲综合在线第一页| 国产精品天干天干在观线| 日韩精品一区二区三区蜜臀| 91成人在线免费观看| av一区二区不卡| 国产乱一区二区| 喷白浆一区二区| 日韩经典中文字幕一区| 一级日本不卡的影视| 最新国产精品久久精品| 国产精品毛片久久久久久久| 精品少妇一区二区三区在线视频| 欧美日韩电影一区| 欧美三级欧美一级| 欧美日韩成人在线| 7777精品伊人久久久大香线蕉的 | 男人的j进女人的j一区| 亚洲国产精品久久人人爱| 亚洲一区二区三区自拍| 午夜不卡在线视频| 久久国产精品99精品国产| 美腿丝袜亚洲综合| 精品午夜久久福利影院| 捆绑调教一区二区三区| 国模娜娜一区二区三区| 国产成人亚洲综合a∨婷婷图片| 国产成人精品网址| 91在线一区二区三区| 欧美在线观看18| 日韩欧美色综合| 中文字幕亚洲区| 香蕉久久一区二区不卡无毒影院| 美日韩一区二区| 国产精品一级在线| 在线视频中文字幕一区二区| 欧美丰满嫩嫩电影| 久久综合视频网| 亚洲你懂的在线视频| 经典三级视频一区| 91丨国产丨九色丨pron| 欧美一区二视频| 中文字幕第一区二区| 日韩精品一卡二卡三卡四卡无卡| 国产原创一区二区| 欧美日韩一级黄| 中文字幕在线不卡| 激情文学综合网| 欧美精品乱码久久久久久| 亚洲激情图片一区| 久久99国产精品久久| 欧洲一区在线电影| 一区二区三区在线观看欧美 | 午夜精品福利一区二区三区av | 色婷婷久久综合| 亚洲日本va午夜在线电影| 国产一区二区三区在线观看免费| 7777精品久久久大香线蕉| 亚洲一区二区成人在线观看| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩三级精品电影久久久| 日本欧美久久久久免费播放网| 色婷婷香蕉在线一区二区| 一区二区三区欧美| 色婷婷综合激情| 成人欧美一区二区三区黑人麻豆| 国产成人一级电影| 1024精品合集| 91黄色免费看| 日韩高清不卡一区二区三区| 日韩午夜在线影院| 国产乱子伦一区二区三区国色天香 |