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

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

?? jiq.c

?? linux device driver源碼
?? C
字號:
/* * jiq.c -- the just-in-queue module * * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet * Copyright (C) 2001 O'Reilly & Associates * * The source code in this file can be freely used, adapted, * and redistributed in source or binary form, so long as an * acknowledgment appears in derived source files.  The citation * should list that the code comes from the book "Linux Device * Drivers" by Alessandro Rubini and Jonathan Corbet, published * by O'Reilly & Associates.   No warranty is attached; * we cannot take responsibility for errors or fitness for use. * * $Id: jiq.c,v 1.15 2001/07/18 22:28:16 rubini Exp $ */ /* BUGS: the module is not reentrant: only one file can be read at a time *       the module usage count is not used: you could remove the module *           while reading it, thus asking for troubles. */#ifndef __KERNEL__#  define __KERNEL__#endif#ifndef MODULE#  define MODULE#endif#include <linux/config.h>#include <linux/module.h>#include <linux/sched.h>#include <linux/kernel.h>#include <linux/fs.h>     /* everything... */#include <linux/proc_fs.h>#include <linux/errno.h>  /* error codes */#include <linux/tqueue.h>#include <linux/interrupt.h> /* intr_count */#include "sysdep.h"/* * This module is a silly one: it only embeds short code fragments * that show how enqueued tasks `feel' theit environment */#define LIMIT (PAGE_SIZE-128) /* don't print any more after this size *//* * Print information about the current environment. This is called from * within the task queues. If the limit is reched, awake the reading * process. */DECLARE_WAIT_QUEUE_HEAD (jiq_wait);struct tq_struct jiq_task; /* global: initialized to zero *//* * Keep track of info we need between task queue runs. */struct clientdata {    int len;    char *buf;    unsigned long jiffies;    task_queue *queue;} jiq_data;#define SCHEDULER_QUEUE ((task_queue *) 1)#ifdef HAVE_TASKLETSvoid jiq_print_tasklet (unsigned long);DECLARE_TASKLET (jiq_tasklet, jiq_print_tasklet, (unsigned long) &jiq_data);#endif /* HAVE_TASKLETS *//* * Do the printing; return non-zero if the task should be rescheduled. */int jiq_print(void *ptr){  struct clientdata *data = (struct clientdata *)ptr;  int len = data->len;  char *buf = data->buf;  unsigned long j = jiffies;  if (len > LIMIT) {       wake_up_interruptible(&jiq_wait);      return 0;  }  if (len == 0)      len = sprintf(buf,"    time  delta interrupt  pid cpu command\n");  else      len =0;  /* intr_count is only exported since 1.3.5, but 1.99.4 is needed anyways */  len += sprintf(buf+len,"%9li %3li        %i   %5i %3i %s\n",                 j, j - data->jiffies,                 in_interrupt (), current->pid, smp_processor_id (), current->comm);  data->len += len;  data->buf += len;  data->jiffies = j;  return 1;}/* * Call jiq_print from a task queue */void jiq_print_tq(void *ptr){    if (jiq_print (ptr)) {        struct clientdata *data = (struct clientdata *)ptr;        if (data->queue == SCHEDULER_QUEUE)	    schedule_task(&jiq_task);        else if (data->queue)            queue_task(&jiq_task, data->queue);        if (data->queue == &tq_immediate)            mark_bh(IMMEDIATE_BH); /* this one needs to be marked */    }}/* * Use the scheduler queue  -- /proc/jiqsched */int jiq_read_sched(char *buf, char **start, off_t offset,                   int len, int *eof, void *data){    jiq_data.len = 0;               /* nothing printed, yet */    jiq_data.buf = buf;             /* print in this place */    jiq_data.jiffies = jiffies;     /* initial time */    /* jiq_print will queue_task() again in jiq_data.queue */    jiq_data.queue = SCHEDULER_QUEUE;    schedule_task(&jiq_task);             /* ready to run */    interruptible_sleep_on(&jiq_wait);    /* sleep till completion */    *eof = 1;    return jiq_data.len;}#ifdef USE_PROC_REGISTERstatic int jiq_old_read_sched(char *buf, char **start, off_t offset, int len,                int unused){    int eof;    return jiq_read_sched(buf, start, offset, len, &eof, NULL);}struct proc_dir_entry jiq_proc_sched = {        0,                 /* low_ino: the inode -- dynamic */        8, "jiqsched",     /* len of name and name */        S_IFREG | S_IRUGO, /* mode */        1, 0, 0,           /* nlinks, owner, group */        0, NULL,           /* size - unused; operations -- use default */        &jiq_old_read_sched,   /* function used to read data */        /* nothing more */    };#endifint jiq_read_timer(char *buf, char **start, off_t offset,                   int len, int *eof, void *data){    jiq_data.len = 0;            /* nothing printed, yet */    jiq_data.buf = buf;          /* print in this place */    jiq_data.jiffies = jiffies;  /* initial time */    jiq_data.queue = &tq_timer;  /* re-register yourself here */    queue_task(&jiq_task, &tq_timer);     /* ready to run */    interruptible_sleep_on(&jiq_wait);    /* sleep till completion */    *eof = 1;    return jiq_data.len;}#ifdef USE_PROC_REGISTERstatic int jiq_old_read_timer(char *buf, char **start, off_t offset, int len,                int unused){    int eof;    return jiq_read_timer(buf, start, offset, len, &eof, NULL);}struct proc_dir_entry jiq_proc_timer = {        0,                 /* low_ino: the inode -- dynamic */        8, "jiqtimer",     /* len of name and name */        S_IFREG | S_IRUGO, /* mode */        1, 0, 0,           /* nlinks, owner, group */        0, NULL,           /* size - unused; operations -- use default */        &jiq_old_read_timer,   /* function used to read data */        /* nothing more */    };#endifint jiq_read_immed(char *buf, char **start, off_t offset,                   int len, int *eof, void *data){    jiq_data.len = 0;                /* nothing printed, yet */    jiq_data.buf = buf;              /* print in this place */    jiq_data.jiffies = jiffies;      /* initial time */    jiq_data.queue = &tq_immediate;  /* re-register yourself here */    queue_task(&jiq_task, &tq_immediate); /* ready to run */    mark_bh(IMMEDIATE_BH);    interruptible_sleep_on(&jiq_wait);    /* sleep till completion */    *eof = 1;    return jiq_data.len;}#ifdef USE_PROC_REGISTERstatic int jiq_old_read_immed(char *buf, char **start, off_t offset, int len,                int unused){    int eof;    return jiq_read_immed(buf, start, offset, len, &eof, NULL);}struct proc_dir_entry jiq_proc_immed = {        0,                 /* low_ino: the inode -- dynamic */        8, "jiqimmed",     /* len of name and name */        S_IFREG | S_IRUGO, /* mode */        1, 0, 0,           /* nlinks, owner, group */        0, NULL,           /* size - unused; operations -- use default */        &jiq_old_read_immed,   /* function used to read data */        /* nothing more */    };#endif#ifdef HAVE_TASKLETS/* * Call jiq_print from a tasklet */void jiq_print_tasklet(unsigned long ptr){    if (jiq_print ((void *) ptr))        tasklet_schedule (&jiq_tasklet);}int jiq_read_tasklet(char *buf, char **start, off_t offset, int len,                int *eof, void *data){    jiq_data.len = 0;                /* nothing printed, yet */    jiq_data.buf = buf;              /* print in this place */    jiq_data.jiffies = jiffies;      /* initial time */    tasklet_schedule(&jiq_tasklet);    interruptible_sleep_on(&jiq_wait);    /* sleep till completion */    *eof = 1;    return jiq_data.len;}/* No PROC_REGISTER junk since tasklets postdate all that */#endif /* HAVE_TASKLETS *//* * This one, instead, tests out the timers. */struct timer_list jiq_timer;void jiq_timedout(unsigned long ptr){    jiq_print((void *)ptr);            /* print a line */    wake_up_interruptible(&jiq_wait);  /* awake the process */}int jiq_read_run_timer(char *buf, char **start, off_t offset,                   int len, int *eof, void *data){    jiq_data.len = 0;           /* prepare the argument for jiq_print() */    jiq_data.buf = buf;    jiq_data.jiffies = jiffies;    jiq_data.queue = NULL;      /* don't requeue */    init_timer(&jiq_timer);              /* init the timer structure */    jiq_timer.function = jiq_timedout;    jiq_timer.data = (unsigned long)&jiq_data;    jiq_timer.expires = jiffies + HZ; /* one second */    jiq_print(&jiq_data);   /* print and go to sleep */    add_timer(&jiq_timer);    interruptible_sleep_on(&jiq_wait);    del_timer_sync(&jiq_timer);  /* in case a signal woke us up */        *eof = 1;    return jiq_data.len;}#ifdef USE_PROC_REGISTERstatic int jiq_old_read_run_timer(char *buf, char **start, off_t offset, int len,                int unused){    int eof;    return jiq_read_run_timer(buf, start, offset, len, &eof, NULL);}struct proc_dir_entry jiq_proc_run_timer = {        0,                 /* low_ino: the inode -- dynamic */        7, "jitimer",      /* len of name and name */        S_IFREG | S_IRUGO, /* mode */        1, 0, 0,           /* nlinks, owner, group */        0, NULL,           /* size - unused; operations -- use default */        &jiq_old_read_run_timer, /* function used to read data */        /* nothing more */    };#endif/* * the init/clean material */int jiq_init(void){    /* these lines are in jiq_init() */    jiq_task.routine = jiq_print_tq;    jiq_task.data = (void *)&jiq_data;#ifdef USE_PROC_REGISTER    proc_register_dynamic(&proc_root, &jiq_proc_sched);    proc_register_dynamic(&proc_root, &jiq_proc_timer);    proc_register_dynamic(&proc_root, &jiq_proc_immed);    proc_register_dynamic(&proc_root, &jiq_proc_run_timer);#else    create_proc_read_entry("jiqsched", 0, NULL, jiq_read_sched, NULL);    create_proc_read_entry("jiqtimer", 0, NULL, jiq_read_timer, NULL);    create_proc_read_entry("jiqimmed", 0, NULL, jiq_read_immed, NULL);    create_proc_read_entry("jitimer", 0, NULL, jiq_read_run_timer, NULL);#ifdef HAVE_TASKLETS    create_proc_read_entry("jiqtasklet", 0, NULL, jiq_read_tasklet, NULL);#endif#endif#ifndef JIT_DEBUG    EXPORT_NO_SYMBOLS;#endif    return 0; /* succeed */}void jiq_cleanup(void){#ifdef USE_PROC_REGISTER    proc_unregister(&proc_root, jiq_proc_sched.low_ino);    proc_unregister(&proc_root, jiq_proc_timer.low_ino);    proc_unregister(&proc_root, jiq_proc_immed.low_ino);    proc_unregister(&proc_root, jiq_proc_run_timer.low_ino);#else    remove_proc_entry("jiqsched", 0);    remove_proc_entry("jiqtimer", 0);    remove_proc_entry("jiqimmed", 0);    remove_proc_entry("jitimer", 0);#ifdef HAVE_TASKLETS    remove_proc_entry("jiqtasklet", 0);#endif#endif}module_init(jiq_init);module_exit(jiq_cleanup);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产色综合久久不卡电影| 日韩一区二区在线观看视频播放| 日本成人在线网站| 中文欧美字幕免费| 日韩欧美黄色影院| 色婷婷亚洲精品| 国产成人av一区| 奇米色777欧美一区二区| 亚洲精品老司机| 日本一区二区综合亚洲| 欧美一区二区在线视频| 色视频成人在线观看免| 国产91丝袜在线播放九色| 五月天婷婷综合| 亚洲人成网站色在线观看| 国产亚洲欧美一级| 91精品国产91久久综合桃花| 91丨porny丨蝌蚪视频| 国产成人在线观看免费网站| 男人操女人的视频在线观看欧美| 亚洲一线二线三线视频| 国产精品福利电影一区二区三区四区| 日韩精品影音先锋| 91精品国产品国语在线不卡| 欧美视频日韩视频| 欧美在线一区二区三区| 95精品视频在线| av综合在线播放| 播五月开心婷婷综合| 成人涩涩免费视频| 国产乱子伦视频一区二区三区| 美女视频一区在线观看| 香蕉乱码成人久久天堂爱免费| 一区二区三区视频在线看| 中文字幕一区二区三区在线播放 | 欧美精品丝袜久久久中文字幕| 色综合一区二区三区| 粉嫩aⅴ一区二区三区四区| 国产成人av资源| 99热在这里有精品免费| 播五月开心婷婷综合| av一区二区三区在线| 99在线精品免费| 99精品黄色片免费大全| 91女人视频在线观看| 一本一道综合狠狠老| 91黄色免费看| 6080日韩午夜伦伦午夜伦| 欧美精品乱码久久久久久按摩| 欧美日韩一区二区三区四区| 日本精品视频一区二区| 欧美天堂一区二区三区| 欧美一区二区三区男人的天堂| 日韩视频在线一区二区| 精品国产一区二区三区不卡| 日韩一区欧美一区| 亚洲国产人成综合网站| 日韩福利视频网| 经典一区二区三区| 成人黄色免费短视频| 欧美制服丝袜第一页| 欧美一区二区三区在线观看视频| 精品久久久三级丝袜| 国产精品拍天天在线| 一区二区在线观看视频| 午夜免费欧美电影| 国产一区不卡视频| 91丨porny丨最新| 宅男在线国产精品| 国产日韩精品一区二区浪潮av | 亚洲国产一区二区a毛片| 日韩av网站免费在线| 国产盗摄视频一区二区三区| av在线综合网| 91精品国产麻豆| 国产精品免费观看视频| 亚洲成人福利片| 国产999精品久久久久久| 欧美bbbbb| 日本欧美一区二区三区| 久久99精品一区二区三区三区| 国产91高潮流白浆在线麻豆| 欧美性生交片4| 欧美精品一区二区三区久久久| 中文字幕一区二区三| 免费观看成人av| 91在线观看美女| 欧美一个色资源| 18成人在线观看| 久久精品99国产国产精| 91色九色蝌蚪| 久久精品在线观看| 日韩高清不卡一区| 91视频91自| 久久精品在这里| 日韩精品电影在线| 91丨porny丨国产入口| 精品久久久久一区二区国产| 一区二区激情小说| 成人午夜私人影院| 精品国产一区二区三区忘忧草| 亚洲欧美激情视频在线观看一区二区三区 | 国产精品1区二区.| 91九色02白丝porn| 国产精品女同一区二区三区| 蜜桃视频一区二区三区在线观看 | 成人黄色av网站在线| 日韩一区二区三区三四区视频在线观看| 国产精品久久久久久亚洲毛片 | 欧美少妇xxx| 成人欧美一区二区三区黑人麻豆| 韩国av一区二区| 777亚洲妇女| 亚洲综合999| 99视频热这里只有精品免费| 亚洲国产精品激情在线观看| 久久国产视频网| 3751色影院一区二区三区| 一区二区三区成人| 色综合夜色一区| 亚洲嫩草精品久久| www.一区二区| 国产精品伦理一区二区| 国产精品一区二区久久不卡| 精品国产a毛片| 久久丁香综合五月国产三级网站| 欧美一区二区三区日韩| 亚洲不卡av一区二区三区| 欧美在线视频日韩| 亚洲免费看黄网站| 在线视频你懂得一区| 亚洲精品欧美在线| 在线视频欧美精品| 亚洲一区二区三区三| 欧美日韩精品一区视频| 亚洲成在人线在线播放| 欧美日韩精品一二三区| 日韩高清不卡一区二区| 欧美一区二区三区小说| 久久99久久精品| 国产亚洲欧洲997久久综合 | 一区二区成人在线观看| 在线观看国产一区二区| 亚洲成人福利片| 在线综合视频播放| 麻豆成人av在线| 久久久久久久综合| 99v久久综合狠狠综合久久| 亚洲欧美在线视频| 欧美午夜一区二区三区免费大片| 亚洲h在线观看| 欧美一个色资源| 国产成人一区在线| 亚洲日本免费电影| 欧美久久高跟鞋激| 国产一区在线不卡| 国产精品电影院| 欧美自拍偷拍午夜视频| 日本成人超碰在线观看| 精品国产污污免费网站入口 | 韩国av一区二区三区在线观看| 久久精品视频免费观看| av资源站一区| 亚洲va韩国va欧美va精品| 精品奇米国产一区二区三区| 国产aⅴ精品一区二区三区色成熟| 成人免费一区二区三区在线观看| 欧洲人成人精品| 毛片一区二区三区| 国产精品福利av| 91精品国产福利在线观看| 懂色av一区二区在线播放| 亚洲一区自拍偷拍| 久久久午夜电影| 欧美在线观看18| 国产中文字幕精品| 一区二区三区中文字幕精品精品 | 成人免费福利片| 亚洲va韩国va欧美va精品| 久久免费偷拍视频| 欧洲精品中文字幕| 国产精品一区二区免费不卡| 亚洲一二三四区不卡| 久久麻豆一区二区| 欧美色国产精品| 福利91精品一区二区三区| 亚洲一区二区精品视频| 国产日韩欧美不卡在线| 欧美肥妇毛茸茸| 99r国产精品| 国产精品自产自拍| 日韩和欧美一区二区| 亚洲欧美视频一区| 久久久久久久精| 欧美日韩小视频| 91免费小视频| 国产精品白丝jk黑袜喷水| 日韩精品亚洲一区二区三区免费| 国产精品免费丝袜| 精品日韩在线观看|