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

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

?? jit.c

?? 《LDD3》
?? 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一区二区三区免费野_久草精品视频
7878成人国产在线观看| 亚洲激情欧美激情| 亚洲欧美另类综合偷拍| 蜜臀va亚洲va欧美va天堂| 国产99久久久国产精品潘金网站| 欧美怡红院视频| 久久久久国色av免费看影院| 亚洲一区二区视频在线| 91影视在线播放| 精品久久久久久久久久久久久久久久久 | 精品少妇一区二区三区日产乱码| 亚洲欧美日韩一区二区| 福利电影一区二区| 日韩欧美你懂的| 亚洲h在线观看| 欧洲精品中文字幕| 日韩毛片一二三区| 国产精品99久久久久久似苏梦涵 | 三级亚洲高清视频| 欧美伊人久久大香线蕉综合69| 国产欧美一区二区在线观看| 激情伊人五月天久久综合| 欧美色视频在线观看| 一区二区三区在线视频免费观看 | 日韩成人免费电影| 欧美性感一区二区三区| 亚洲免费视频中文字幕| 91在线国内视频| 自拍偷拍欧美激情| 色综合久久中文字幕| 国产丝袜欧美中文另类| 国产不卡视频一区| 日本一区二区免费在线观看视频 | 日韩精品高清不卡| 欧美一区二区在线播放| 人人爽香蕉精品| 欧美成人一区二区三区| 精品一区二区三区香蕉蜜桃| 精品国产凹凸成av人导航| 国产又黄又大久久| 国产欧美一区二区精品秋霞影院| 高清不卡一区二区在线| 自拍偷拍欧美激情| 欧美三级一区二区| 蜜桃av一区二区三区电影| 久久这里只精品最新地址| 国产成人aaa| 亚洲天堂免费看| 欧美日韩专区在线| 九色porny丨国产精品| 亚洲人吸女人奶水| 欧美人狂配大交3d怪物一区| 久久97超碰国产精品超碰| 国产欧美精品一区二区色综合朱莉| 岛国精品在线播放| 一区2区3区在线看| 日韩视频一区二区在线观看| 国产精品资源在线看| 亚洲女与黑人做爰| 欧美一级高清大全免费观看| 国产精品一级在线| 亚洲综合久久av| 精品免费日韩av| 9色porny自拍视频一区二区| 亚洲一本大道在线| 精品少妇一区二区三区视频免付费| 成人国产亚洲欧美成人综合网| 亚洲成av人**亚洲成av**| 国产三级欧美三级日产三级99| 欧美午夜不卡视频| 激情亚洲综合在线| 亚洲成精国产精品女| 欧美国产日韩亚洲一区| 91精品国产一区二区三区香蕉| 成人午夜精品在线| 男男gaygay亚洲| 亚洲六月丁香色婷婷综合久久| 日韩欧美激情四射| 日本丰满少妇一区二区三区| 日本不卡视频在线观看| 亚洲免费观看高清完整版在线| 欧美一级在线视频| 欧美无砖专区一中文字| 波多野结衣精品在线| 国产综合色在线视频区| 亚洲v精品v日韩v欧美v专区 | 成人午夜av影视| 日本成人在线电影网| 亚洲欧美日本韩国| 国产日本一区二区| 欧美成人a视频| 51精品视频一区二区三区| 99久久99久久精品免费看蜜桃| 国产美女视频一区| 久久精品国产亚洲a| 亚洲国产sm捆绑调教视频| 亚洲人成在线播放网站岛国| 欧美高清在线精品一区| 久久久久久免费毛片精品| 日韩一区二区在线免费观看| 欧美日韩激情一区| 在线欧美日韩国产| 色综合天天综合网国产成人综合天| 国产一区二区三区黄视频 | 日本韩国欧美在线| 波多野结衣一区二区三区| 懂色av一区二区三区蜜臀| 久久69国产一区二区蜜臀| 国产成人在线视频网站| 久久精品国产99国产| 日本免费新一区视频| 日本aⅴ精品一区二区三区| 日韩va欧美va亚洲va久久| 亚洲bt欧美bt精品777| 亚洲成人av免费| 免费观看在线色综合| 久久99国产精品麻豆| 国产精品18久久久久| 韩国中文字幕2020精品| 国产精品一区二区黑丝| 大桥未久av一区二区三区中文| 国产高清不卡二三区| 成人午夜av在线| 日本韩国欧美三级| 欧美精品久久久久久久久老牛影院| 欧美日韩一区 二区 三区 久久精品| 欧美亚洲综合色| 欧美性色欧美a在线播放| 欧美一区二区三区四区五区 | 寂寞少妇一区二区三区| 国产在线不卡视频| 成熟亚洲日本毛茸茸凸凹| 97久久超碰国产精品| 欧美亚洲综合另类| 欧美成人在线直播| 国产精品福利一区| 午夜免费欧美电影| 久久精品国产一区二区三| 成人综合日日夜夜| 91黄色小视频| 日韩欧美高清一区| 国产精品不卡在线| 日韩精品电影一区亚洲| 国产又粗又猛又爽又黄91精品| 99久久精品免费看| 欧美一卡在线观看| 国产精品萝li| 日韩av午夜在线观看| 国产福利一区二区三区| 欧美在线视频不卡| 久久噜噜亚洲综合| 亚洲第一福利一区| 福利电影一区二区三区| 7777精品伊人久久久大香线蕉经典版下载 | 国产精品国产三级国产aⅴ入口| 亚洲h精品动漫在线观看| 国产河南妇女毛片精品久久久| 欧美日韩在线不卡| 中文字幕乱码一区二区免费| 亚洲a一区二区| 91亚洲国产成人精品一区二三 | 欧美日韩电影在线| 日本一区二区在线不卡| 天天影视色香欲综合网老头| 成人av综合一区| 精品欧美黑人一区二区三区| 亚洲国产综合91精品麻豆| 国产成人在线色| 日韩精品专区在线影院重磅| ...av二区三区久久精品| 国产成人免费视频网站 | 国产精品久久久久精k8| 秋霞av亚洲一区二区三| 色婷婷国产精品| 国产精品欧美一级免费| 韩国成人在线视频| 日韩欧美在线不卡| 亚洲午夜久久久久久久久电影网 | 国产二区国产一区在线观看| 日韩亚洲欧美在线| 婷婷成人激情在线网| 91精彩视频在线观看| 国产精品久久久久久妇女6080 | 日韩精品电影在线| 欧美日韩一区二区三区不卡| 亚洲三级免费电影| av在线不卡免费看| 国产精品久久久久久久久搜平片 | 欧美日韩国产精选| 亚洲综合一区在线| 色婷婷国产精品综合在线观看| 中国av一区二区三区| 国产精品一区在线| 精品国产人成亚洲区| 国产中文一区二区三区| 精品国产乱码久久久久久图片| 美国十次综合导航| 久久久久久毛片| 极品美女销魂一区二区三区免费 | 91精品国产麻豆国产自产在线|