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

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

?? jit.c

?? Linux下usb驅動程序開發 Linux下usb驅動程序開發
?? C
字號:
/* * jit.c -- the just-in-time module * * Copyright (C) 2001,2003 Alessandro Rubini and Jonathan Corbet * Copyright (C) 2001,2003 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: jit.c,v 1.16 2004/09/26 07:02:43 gregkh Exp $ */#include <linux/config.h>#include <linux/module.h>#include <linux/moduleparam.h>#include <linux/init.h>#include <linux/time.h>#include <linux/timer.h>#include <linux/kernel.h>#include <linux/proc_fs.h>#include <linux/types.h>#include <linux/spinlock.h>#include <linux/interrupt.h>#include <asm/hardirq.h>/* * This module is a silly one: it only embeds short code fragments * that show how time delays can be handled in the kernel. */int delay = HZ; /* the default delay, expressed in jiffies */module_param(delay, int, 0);MODULE_AUTHOR("Alessandro Rubini");MODULE_LICENSE("Dual BSD/GPL");/* use these as data pointers, to implement four files in one function */enum jit_files {	JIT_BUSY,	JIT_SCHED,	JIT_QUEUE,	JIT_SCHEDTO};/* * This function prints one line of data, after sleeping one second. * It can sleep in different ways, according to the data pointer */int jit_fn(char *buf, char **start, off_t offset,	      int len, int *eof, void *data){	unsigned long j0, j1; /* jiffies */	wait_queue_head_t wait;	init_waitqueue_head (&wait);	j0 = jiffies;	j1 = j0 + delay;	switch((long)data) {		case JIT_BUSY:			while (time_before(jiffies, j1))				cpu_relax();			break;		case JIT_SCHED:			while (time_before(jiffies, j1)) {				schedule();			}			break;		case JIT_QUEUE:			wait_event_interruptible_timeout(wait, 0, delay);			break;		case JIT_SCHEDTO:			set_current_state(TASK_INTERRUPTIBLE);			schedule_timeout (delay);			break;	}	j1 = jiffies; /* actual value after we delayed */	len = sprintf(buf, "%9li %9li\n", j0, j1);	*start = buf;	return len;}/* * This file, on the other hand, returns the current time forever */int jit_currentime(char *buf, char **start, off_t offset,                   int len, int *eof, void *data){	struct timeval tv1;	struct timespec tv2;	unsigned long j1;	u64 j2;	/* get them four */	j1 = jiffies;	j2 = get_jiffies_64();	do_gettimeofday(&tv1);	tv2 = current_kernel_time();	/* print */	len=0;	len += sprintf(buf,"0x%08lx 0x%016Lx %10i.%06i\n"		       "%40i.%09i\n",		       j1, j2,		       (int) tv1.tv_sec, (int) tv1.tv_usec,		       (int) tv2.tv_sec, (int) tv2.tv_nsec);	*start = buf;	return len;}/* * The timer example follows */int tdelay = 10;module_param(tdelay, int, 0);/* This data structure used as "data" for the timer and tasklet functions */struct jit_data {	struct timer_list timer;	struct tasklet_struct tlet;	int hi; /* tasklet or tasklet_hi */	wait_queue_head_t wait;	unsigned long prevjiffies;	unsigned char *buf;	int loops;};#define JIT_ASYNC_LOOPS 5void jit_timer_fn(unsigned long arg){	struct jit_data *data = (struct jit_data *)arg;	unsigned long j = jiffies;	data->buf += sprintf(data->buf, "%9li  %3li     %i    %6i   %i   %s\n",			     j, j - data->prevjiffies, in_interrupt() ? 1 : 0,			     current->pid, smp_processor_id(), current->comm);	if (--data->loops) {		data->timer.expires += tdelay;		data->prevjiffies = j;		add_timer(&data->timer);	} else {		wake_up_interruptible(&data->wait);	}}/* the /proc function: allocate everything to allow concurrency */int jit_timer(char *buf, char **start, off_t offset,	      int len, int *eof, void *unused_data){	struct jit_data *data;	char *buf2 = buf;	unsigned long j = jiffies;	data = kmalloc(sizeof(*data), GFP_KERNEL);	if (!data)		return -ENOMEM;	init_timer(&data->timer);	init_waitqueue_head (&data->wait);	/* write the first lines in the buffer */	buf2 += sprintf(buf2, "   time   delta  inirq    pid   cpu command\n");	buf2 += sprintf(buf2, "%9li  %3li     %i    %6i   %i   %s\n",			j, 0L, in_interrupt() ? 1 : 0,			current->pid, smp_processor_id(), current->comm);	/* fill the data for our timer function */	data->prevjiffies = j;	data->buf = buf2;	data->loops = JIT_ASYNC_LOOPS;		/* register the timer */	data->timer.data = (unsigned long)data;	data->timer.function = jit_timer_fn;	data->timer.expires = j + tdelay; /* parameter */	add_timer(&data->timer);	/* wait for the buffer to fill */	wait_event_interruptible(data->wait, !data->loops);	if (signal_pending(current))		return -ERESTARTSYS;	buf2 = data->buf;	kfree(data);	*eof = 1;	return buf2 - buf;}void jit_tasklet_fn(unsigned long arg){	struct jit_data *data = (struct jit_data *)arg;	unsigned long j = jiffies;	data->buf += sprintf(data->buf, "%9li  %3li     %i    %6i   %i   %s\n",			     j, j - data->prevjiffies, in_interrupt() ? 1 : 0,			     current->pid, smp_processor_id(), current->comm);	if (--data->loops) {		data->prevjiffies = j;		if (data->hi)			tasklet_hi_schedule(&data->tlet);		else			tasklet_schedule(&data->tlet);	} else {		wake_up_interruptible(&data->wait);	}}/* the /proc function: allocate everything to allow concurrency */int jit_tasklet(char *buf, char **start, off_t offset,	      int len, int *eof, void *arg){	struct jit_data *data;	char *buf2 = buf;	unsigned long j = jiffies;	long hi = (long)arg;	data = kmalloc(sizeof(*data), GFP_KERNEL);	if (!data)		return -ENOMEM;	init_waitqueue_head (&data->wait);	/* write the first lines in the buffer */	buf2 += sprintf(buf2, "   time   delta  inirq    pid   cpu command\n");	buf2 += sprintf(buf2, "%9li  %3li     %i    %6i   %i   %s\n",			j, 0L, in_interrupt() ? 1 : 0,			current->pid, smp_processor_id(), current->comm);	/* fill the data for our tasklet function */	data->prevjiffies = j;	data->buf = buf2;	data->loops = JIT_ASYNC_LOOPS;		/* register the tasklet */	tasklet_init(&data->tlet, jit_tasklet_fn, (unsigned long)data);	data->hi = hi;	if (hi)		tasklet_hi_schedule(&data->tlet);	else		tasklet_schedule(&data->tlet);	/* wait for the buffer to fill */	wait_event_interruptible(data->wait, !data->loops);	if (signal_pending(current))		return -ERESTARTSYS;	buf2 = data->buf;	kfree(data);	*eof = 1;	return buf2 - buf;}int __init jit_init(void){	create_proc_read_entry("currentime", 0, NULL, jit_currentime, NULL);	create_proc_read_entry("jitbusy", 0, NULL, jit_fn, (void *)JIT_BUSY);	create_proc_read_entry("jitsched",0, NULL, jit_fn, (void *)JIT_SCHED);	create_proc_read_entry("jitqueue",0, NULL, jit_fn, (void *)JIT_QUEUE);	create_proc_read_entry("jitschedto", 0, NULL, jit_fn, (void *)JIT_SCHEDTO);	create_proc_read_entry("jitimer", 0, NULL, jit_timer, NULL);	create_proc_read_entry("jitasklet", 0, NULL, jit_tasklet, NULL);	create_proc_read_entry("jitasklethi", 0, NULL, jit_tasklet, (void *)1);	return 0; /* success */}void __exit jit_cleanup(void){	remove_proc_entry("currentime", NULL);	remove_proc_entry("jitbusy", NULL);	remove_proc_entry("jitsched", NULL);	remove_proc_entry("jitqueue", NULL);	remove_proc_entry("jitschedto", NULL);	remove_proc_entry("jitimer", NULL);	remove_proc_entry("jitasklet", NULL);	remove_proc_entry("jitasklethi", NULL);}module_init(jit_init);module_exit(jit_cleanup);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91黄色激情网站| 日韩欧美一区二区在线视频| 欧美疯狂做受xxxx富婆| 亚洲激情网站免费观看| 粉嫩在线一区二区三区视频| 国产综合色视频| 精品亚洲成a人| 国产亚洲精品久| 成人中文字幕合集| 亚洲国产高清在线观看视频| 蜜桃一区二区三区在线观看| 日韩午夜精品电影| 成人黄色在线视频| 久久久久国产精品麻豆ai换脸 | 国产精品99久久久久久似苏梦涵| 久久一区二区视频| 99久久国产综合精品麻豆| 亚洲夂夂婷婷色拍ww47| 欧美精品一区二| 欧美唯美清纯偷拍| 成人性生交大片| 亚洲一区日韩精品中文字幕| 日韩欧美综合在线| 欧美私模裸体表演在线观看| 国产在线精品一区二区不卡了| 亚洲免费视频成人| 国产精品少妇自拍| 久久精品日产第一区二区三区高清版 | 国产精品免费aⅴ片在线观看| 欧美日韩另类一区| 在线观看av一区| 99精品国产一区二区三区不卡| 激情五月播播久久久精品| 午夜视频一区在线观看| 亚洲伊人色欲综合网| 亚洲欧美日本韩国| 亚洲电影在线免费观看| 亚洲一区二区三区影院| 久久黄色级2电影| 国产剧情一区在线| 9191国产精品| 亚洲人成亚洲人成在线观看图片| 青青草原综合久久大伊人精品优势| 99久久国产综合色|国产精品| 欧美日韩高清一区二区三区| 中文字幕一区二区不卡| 国产精品综合网| 精品福利一区二区三区免费视频| 亚洲激情网站免费观看| 97se亚洲国产综合在线| 26uuuu精品一区二区| 国内精品自线一区二区三区视频| 欧美日韩高清一区| 丝袜诱惑制服诱惑色一区在线观看| 在线免费观看视频一区| 亚洲欧美日韩在线播放| 91蝌蚪porny| 亚洲黄色尤物视频| 91精品久久久久久久久99蜜臂| 日韩欧美一区二区视频| 日韩精品一区二| 国产人成一区二区三区影院| 91精品国产综合久久久蜜臀粉嫩| 精品成人在线观看| 午夜视频久久久久久| 欧洲一区二区三区免费视频| 欧美变态口味重另类| 午夜免费久久看| 在线一区二区观看| 亚洲视频1区2区| 国产麻豆精品在线观看| 欧美日韩一区国产| 日韩专区一卡二卡| 4438亚洲最大| 欧美a级理论片| 久久丝袜美腿综合| 国产精品无遮挡| 欧美不卡一区二区三区四区| 日韩电影免费一区| 日韩一区二区三区在线| 狠狠狠色丁香婷婷综合激情| 91精品国产综合久久精品性色| 日本不卡123| 国产视频一区在线播放| 成人黄色免费短视频| 国产精品久久久久影院老司| 99在线热播精品免费| 天堂一区二区在线免费观看| 欧美日本在线视频| 国产一区二区三区av电影| 国产精品女主播av| 欧美精品丝袜久久久中文字幕| 99精品欧美一区二区蜜桃免费| 亚洲欧美日本在线| 欧美午夜影院一区| 中文字幕在线一区二区三区| 亚洲福利一二三区| 午夜精品123| 欧美成人a在线| 亚洲午夜免费电影| 欧美日韩久久一区二区| 精品无码三级在线观看视频| 337p粉嫩大胆色噜噜噜噜亚洲| 国产成人综合亚洲91猫咪| 亚洲成a人v欧美综合天堂下载| 日韩美女天天操| 欧美顶级少妇做爰| 91片黄在线观看| 美脚の诱脚舐め脚责91| 久久免费美女视频| 欧美精品v国产精品v日韩精品 | 日韩电影免费一区| 亚洲午夜免费视频| 日韩毛片视频在线看| 精品成人佐山爱一区二区| 欧美三级在线播放| 欧美午夜免费电影| 欧美色图第一页| 日韩欧美一区电影| 伊人夜夜躁av伊人久久| 7777女厕盗摄久久久| 91精品在线观看入口| 欧美日韩亚洲综合一区| 欧美视频一区二区三区在线观看| 国产酒店精品激情| proumb性欧美在线观看| 成人中文字幕电影| 91国产精品成人| 欧美男生操女生| 久久久午夜精品| 国产精品对白交换视频| 洋洋成人永久网站入口| 视频一区二区欧美| 国产成人精品三级麻豆| 不卡av在线免费观看| 欧美精品一二三| 欧美高清一级片在线观看| 亚洲人成在线观看一区二区| 日韩国产精品久久久| 国产激情视频一区二区在线观看 | 日韩av电影天堂| 不卡视频免费播放| 亚洲精品在线观看网站| 亚洲美女电影在线| 成人激情免费视频| 精品国精品国产尤物美女| 亚洲成人资源在线| 91麻豆精品在线观看| 久久精品一区蜜桃臀影院| 午夜精品久久久久久久99水蜜桃 | 91九色02白丝porn| 国产精品女主播在线观看| 国产精品一区2区| 欧美成人精品福利| 天堂午夜影视日韩欧美一区二区| jizz一区二区| 亚洲老妇xxxxxx| 欧美中文一区二区三区| 国产精品福利在线播放| 99久久99久久精品免费观看| 亚洲精品在线观看网站| 国产电影精品久久禁18| 国产日韩欧美电影| 91网站黄www| 亚洲综合av网| 777欧美精品| 国产美女视频91| 国产精品国产三级国产| www.在线成人| 亚洲综合视频在线| 欧美一级午夜免费电影| 国产不卡视频在线观看| 亚洲精品一二三| 日韩欧美电影一区| 成人一区二区三区视频在线观看| 国产精品乱码久久久久久| 91天堂素人约啪| 日韩中文字幕1| 国产精品福利av| 日韩欧美一级二级三级 | 成人动漫av在线| 天堂va蜜桃一区二区三区漫画版| 91.成人天堂一区| 91小视频在线| 国产成人aaa| 日本午夜精品一区二区三区电影| 国产精品高清亚洲| 26uuu国产一区二区三区| 欧美性受xxxx黑人xyx| 国产成人在线免费| 国产在线精品一区二区夜色 | 欧美人与z0zoxxxx视频| 波波电影院一区二区三区| 国产在线精品免费| 日本成人在线一区| 三级欧美韩日大片在线看| 亚洲日本va在线观看| 国产精品第一页第二页第三页| 欧美xxxxx牲另类人与| 久久综合色婷婷|