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

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

?? p4-clockmod.c

?? linux2.6.16版本
?? C
字號:
/* *	Pentium 4/Xeon CPU on demand clock modulation/speed scaling *	(C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> *	(C) 2002 Zwane Mwaikambo <zwane@commfireservices.com> *	(C) 2002 Arjan van de Ven <arjanv@redhat.com> *	(C) 2002 Tora T. Engstad *	All Rights Reserved * *	This program is free software; you can redistribute it and/or *      modify it under the terms of the GNU General Public License *      as published by the Free Software Foundation; either version *      2 of the License, or (at your option) any later version. * *      The author(s) of this software shall not be held liable for damages *      of any nature resulting due to the use of this software. This *      software is provided AS-IS with no warranties. *	 *	Date		Errata			Description *	20020525	N44, O17	12.5% or 25% DC causes lockup * */#include <linux/config.h>#include <linux/kernel.h>#include <linux/module.h> #include <linux/init.h>#include <linux/smp.h>#include <linux/cpufreq.h>#include <linux/slab.h>#include <linux/cpumask.h>#include <linux/sched.h>	/* current / set_cpus_allowed() */#include <asm/processor.h> #include <asm/msr.h>#include <asm/timex.h>#include "speedstep-lib.h"#define PFX	"p4-clockmod: "#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "p4-clockmod", msg)/* * Duty Cycle (3bits), note DC_DISABLE is not specified in * intel docs i just use it to mean disable */enum {	DC_RESV, DC_DFLT, DC_25PT, DC_38PT, DC_50PT,	DC_64PT, DC_75PT, DC_88PT, DC_DISABLE};#define DC_ENTRIES	8static int has_N44_O17_errata[NR_CPUS];static int has_N60_errata[NR_CPUS];static unsigned int stock_freq;static struct cpufreq_driver p4clockmod_driver;static unsigned int cpufreq_p4_get(unsigned int cpu);static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate){	u32 l, h;	if (!cpu_online(cpu) || (newstate > DC_DISABLE) || (newstate == DC_RESV))		return -EINVAL;	rdmsr(MSR_IA32_THERM_STATUS, l, h);	if (l & 0x01)		dprintk("CPU#%d currently thermal throttled\n", cpu);	if (has_N44_O17_errata[cpu] && (newstate == DC_25PT || newstate == DC_DFLT))		newstate = DC_38PT;	rdmsr(MSR_IA32_THERM_CONTROL, l, h);	if (newstate == DC_DISABLE) {		dprintk("CPU#%d disabling modulation\n", cpu);		wrmsr(MSR_IA32_THERM_CONTROL, l & ~(1<<4), h);	} else {		dprintk("CPU#%d setting duty cycle to %d%%\n",			cpu, ((125 * newstate) / 10));		/* bits 63 - 5	: reserved 		 * bit  4	: enable/disable		 * bits 3-1	: duty cycle		 * bit  0	: reserved		 */		l = (l & ~14);		l = l | (1<<4) | ((newstate & 0x7)<<1);		wrmsr(MSR_IA32_THERM_CONTROL, l, h);	}	return 0;}static struct cpufreq_frequency_table p4clockmod_table[] = {	{DC_RESV, CPUFREQ_ENTRY_INVALID},	{DC_DFLT, 0},	{DC_25PT, 0},	{DC_38PT, 0},	{DC_50PT, 0},	{DC_64PT, 0},	{DC_75PT, 0},	{DC_88PT, 0},	{DC_DISABLE, 0},	{DC_RESV, CPUFREQ_TABLE_END},};static int cpufreq_p4_target(struct cpufreq_policy *policy,			     unsigned int target_freq,			     unsigned int relation){	unsigned int    newstate = DC_RESV;	struct cpufreq_freqs freqs;	cpumask_t cpus_allowed;	int i;	if (cpufreq_frequency_table_target(policy, &p4clockmod_table[0], target_freq, relation, &newstate))		return -EINVAL;	freqs.old = cpufreq_p4_get(policy->cpu);	freqs.new = stock_freq * p4clockmod_table[newstate].index / 8;	if (freqs.new == freqs.old)		return 0;	/* notifiers */	for_each_cpu_mask(i, policy->cpus) {		freqs.cpu = i;		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);	}	/* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software	 * Developer's Manual, Volume 3 	 */	cpus_allowed = current->cpus_allowed;	for_each_cpu_mask(i, policy->cpus) {		cpumask_t this_cpu = cpumask_of_cpu(i);		set_cpus_allowed(current, this_cpu);		BUG_ON(smp_processor_id() != i);		cpufreq_p4_setdc(i, p4clockmod_table[newstate].index);	}	set_cpus_allowed(current, cpus_allowed);	/* notifiers */	for_each_cpu_mask(i, policy->cpus) {		freqs.cpu = i;		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);	}	return 0;}static int cpufreq_p4_verify(struct cpufreq_policy *policy){	return cpufreq_frequency_table_verify(policy, &p4clockmod_table[0]);}static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c){	if ((c->x86 == 0x06) && (c->x86_model == 0x09)) {		/* Pentium M (Banias) */		printk(KERN_WARNING PFX "Warning: Pentium M detected. "		       "The speedstep_centrino module offers voltage scaling"		       " in addition of frequency scaling. You should use "		       "that instead of p4-clockmod, if possible.\n");		return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM);	}	if ((c->x86 == 0x06) && (c->x86_model == 0x0D)) {		/* Pentium M (Dothan) */		printk(KERN_WARNING PFX "Warning: Pentium M detected. "		       "The speedstep_centrino module offers voltage scaling"		       " in addition of frequency scaling. You should use "		       "that instead of p4-clockmod, if possible.\n");		/* on P-4s, the TSC runs with constant frequency independent whether		 * throttling is active or not. */		p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;		return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM);	}	if (c->x86 != 0xF) {		printk(KERN_WARNING PFX "Unknown p4-clockmod-capable CPU. Please send an e-mail to <linux@brodo.de>\n");		return 0;	}	/* on P-4s, the TSC runs with constant frequency independent whether	 * throttling is active or not. */	p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;	if (speedstep_detect_processor() == SPEEDSTEP_PROCESSOR_P4M) {		printk(KERN_WARNING PFX "Warning: Pentium 4-M detected. "		       "The speedstep-ich or acpi cpufreq modules offer "		       "voltage scaling in addition of frequency scaling. "		       "You should use either one instead of p4-clockmod, "		       "if possible.\n");		return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4M);	}	return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4D);} static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy){	struct cpuinfo_x86 *c = &cpu_data[policy->cpu];	int cpuid = 0;	unsigned int i;#ifdef CONFIG_SMP	policy->cpus = cpu_sibling_map[policy->cpu];#endif	/* Errata workaround */	cpuid = (c->x86 << 8) | (c->x86_model << 4) | c->x86_mask;	switch (cpuid) {	case 0x0f07:	case 0x0f0a:	case 0x0f11:	case 0x0f12:		has_N44_O17_errata[policy->cpu] = 1;		dprintk("has errata -- disabling low frequencies\n");		break;	case 0x0f29:		has_N60_errata[policy->cpu] = 1;		dprintk("has errata -- disabling frequencies lower than 2ghz\n");		break;	}		/* get max frequency */	stock_freq = cpufreq_p4_get_frequency(c);	if (!stock_freq)		return -EINVAL;	/* table init */	for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) {		if ((i<2) && (has_N44_O17_errata[policy->cpu]))			p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;		else if (has_N60_errata[policy->cpu] && p4clockmod_table[i].frequency < 2000000)			p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;		else			p4clockmod_table[i].frequency = (stock_freq * i)/8;	}	cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu);		/* cpuinfo and default policy values */	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;	policy->cpuinfo.transition_latency = 1000000; /* assumed */	policy->cur = stock_freq;	return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]);}static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy){	cpufreq_frequency_table_put_attr(policy->cpu);    	return 0;}static unsigned int cpufreq_p4_get(unsigned int cpu){	cpumask_t cpus_allowed;	u32 l, h;	cpus_allowed = current->cpus_allowed;	set_cpus_allowed(current, cpumask_of_cpu(cpu));	BUG_ON(smp_processor_id() != cpu);	rdmsr(MSR_IA32_THERM_CONTROL, l, h);	set_cpus_allowed(current, cpus_allowed);	if (l & 0x10) {		l = l >> 1;		l &= 0x7;	} else		l = DC_DISABLE;	if (l != DC_DISABLE)		return (stock_freq * l / 8);	return stock_freq;}static struct freq_attr* p4clockmod_attr[] = {	&cpufreq_freq_attr_scaling_available_freqs,	NULL,};static struct cpufreq_driver p4clockmod_driver = {	.verify 	= cpufreq_p4_verify,	.target		= cpufreq_p4_target,	.init		= cpufreq_p4_cpu_init,	.exit		= cpufreq_p4_cpu_exit,	.get		= cpufreq_p4_get,	.name		= "p4-clockmod",	.owner		= THIS_MODULE,	.attr		= p4clockmod_attr,};static int __init cpufreq_p4_init(void){		struct cpuinfo_x86 *c = cpu_data;	int ret;	/*	 * THERM_CONTROL is architectural for IA32 now, so 	 * we can rely on the capability checks	 */	if (c->x86_vendor != X86_VENDOR_INTEL)		return -ENODEV;	if (!test_bit(X86_FEATURE_ACPI, c->x86_capability) ||		!test_bit(X86_FEATURE_ACC, c->x86_capability))		return -ENODEV;	ret = cpufreq_register_driver(&p4clockmod_driver);	if (!ret)		printk(KERN_INFO PFX "P4/Xeon(TM) CPU On-Demand Clock Modulation available\n");	return (ret);}static void __exit cpufreq_p4_exit(void){	cpufreq_unregister_driver(&p4clockmod_driver);}MODULE_AUTHOR ("Zwane Mwaikambo <zwane@commfireservices.com>");MODULE_DESCRIPTION ("cpufreq driver for Pentium(TM) 4/Xeon(TM)");MODULE_LICENSE ("GPL");late_initcall(cpufreq_p4_init);module_exit(cpufreq_p4_exit);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产自产v一区二区三区c| 欧美一区二区三区四区视频| 4438x成人网最大色成网站| 久久色在线视频| 亚洲一本大道在线| 国产成人午夜片在线观看高清观看| 一本一本大道香蕉久在线精品| 亚洲女女做受ⅹxx高潮| 国精品**一区二区三区在线蜜桃| 91视频.com| 国产精品国产三级国产a| 国产一区二区三区香蕉| 欧美一区二区三区在线观看 | 成人av网在线| 精品国产sm最大网站免费看| 午夜一区二区三区视频| 色婷婷综合视频在线观看| 国产精品午夜久久| 国产1区2区3区精品美女| 欧美mv日韩mv国产网站app| 日本欧美一区二区| 欧美日韩国产a| 日韩高清在线观看| 欧美日韩国产电影| 日韩成人精品在线观看| 欧美精品丝袜久久久中文字幕| 一区二区不卡在线播放| 色婷婷精品久久二区二区蜜臂av| 中文字幕日韩av资源站| 91色九色蝌蚪| 一区二区三区国产精华| 91黄色免费观看| 一区二区三区久久久| 在线观看国产日韩| 亚洲成av人影院| 欧美一区二区三区视频在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅 | 舔着乳尖日韩一区| 911国产精品| 极品美女销魂一区二区三区免费| 欧美www视频| 国产激情一区二区三区桃花岛亚洲| 久久你懂得1024| 成人小视频在线观看| 亚洲人吸女人奶水| 欧美精品一卡二卡| 经典三级在线一区| 国产精品久久久99| 在线成人免费观看| 国产一区二区成人久久免费影院| 日本一区二区视频在线| 色综合婷婷久久| 日韩av中文字幕一区二区三区| 2021中文字幕一区亚洲| 成人av资源站| 日韩精品一级中文字幕精品视频免费观看| 91精品国产一区二区人妖| 久久精品国产精品亚洲红杏| 国产欧美一二三区| 在线观看国产91| 精品一区二区三区欧美| 日韩一区日韩二区| 欧美一区二区三区免费大片| 国产精品99久久久久久宅男| 亚洲另类在线一区| 欧美一级免费大片| gogogo免费视频观看亚洲一| 日韩国产成人精品| 亚洲欧美aⅴ...| 精品国产乱码久久久久久1区2区| 日本精品裸体写真集在线观看 | 精品国产乱码久久久久久1区2区| 99精品视频在线播放观看| 日本va欧美va瓶| 中文字幕亚洲在| 欧美成人a视频| 在线亚洲精品福利网址导航| 国内精品久久久久影院薰衣草| 亚洲欧美视频在线观看视频| 欧美大胆人体bbbb| 欧美午夜视频网站| av日韩在线网站| 国内精品免费在线观看| 午夜精品福利一区二区三区av | 亚洲电影中文字幕在线观看| 久久免费偷拍视频| 欧美日韩国产综合草草| 99免费精品在线观看| 精品一区二区在线播放| 亚洲成人一二三| 亚洲图片你懂的| 国产日韩高清在线| 精品成人在线观看| 欧美女孩性生活视频| 一本大道久久a久久综合| 国产99久久久国产精品潘金| 日本aⅴ免费视频一区二区三区| 亚洲精品中文在线观看| 中文字幕乱码久久午夜不卡| 久久―日本道色综合久久| 欧美精品在欧美一区二区少妇 | 91在线国内视频| 国产传媒一区在线| 国产精品一二一区| 看电视剧不卡顿的网站| 久久99精品久久久久久国产越南 | 日韩精品在线网站| 欧美浪妇xxxx高跟鞋交| 欧美在线观看你懂的| 日本高清免费不卡视频| 99久久久精品| 一本大道久久a久久综合| 91猫先生在线| 在线观看区一区二| 欧美三级视频在线| 欧美日韩在线不卡| 欧美精品粉嫩高潮一区二区| 欧美剧在线免费观看网站| 欧美精品乱人伦久久久久久| 欧美日韩一区二区在线视频| 欧美日韩国产综合视频在线观看| 欧美日韩国产成人在线免费| 日韩三级视频中文字幕| 欧美成人vps| 日本一区二区视频在线| 亚洲男人都懂的| 亚洲国产日韩综合久久精品| 天天亚洲美女在线视频| 韩国成人在线视频| 成人一道本在线| 色综合久久综合| 在线电影一区二区三区| 2024国产精品视频| 亚洲视频一区二区在线| 天天影视色香欲综合网老头| 激情综合色综合久久| 不卡大黄网站免费看| 在线观看成人免费视频| 精品久久久久一区| 国产精品无人区| 午夜欧美2019年伦理| 国产自产视频一区二区三区| jiyouzz国产精品久久| 欧美高清视频一二三区| 久久久久久久久久看片| 一区二区三区美女视频| 美女视频黄免费的久久 | 精品国产乱码久久久久久久| 久久久精品国产免大香伊| 综合久久久久综合| 青青草国产成人av片免费| 国产精品一区一区三区| 在线视频一区二区三| 欧美精品一区男女天堂| 亚洲欧美在线视频观看| 久久机这里只有精品| 91麻豆精东视频| 欧美精品一区二区三区四区| 亚洲一本大道在线| 成人免费视频视频在线观看免费| 9191久久久久久久久久久| 国产精品美女一区二区三区| 日本三级亚洲精品| 在线观看www91| 精品国产乱码久久久久久夜甘婷婷| 亚洲另类色综合网站| 国产精品羞羞答答xxdd| 日韩欧美成人一区| 亚洲一区免费观看| 99视频超级精品| 久久精品视频一区| 青娱乐精品视频在线| 日本久久电影网| 中文字幕欧美一| 国产成人99久久亚洲综合精品| 日韩亚洲欧美高清| 亚洲一区二区欧美激情| 丁香另类激情小说| 国产网红主播福利一区二区| 久久草av在线| 欧美精品 日韩| 午夜精品福利一区二区三区蜜桃| 91麻豆自制传媒国产之光| 国产精品你懂的在线欣赏| 激情小说亚洲一区| 制服.丝袜.亚洲.另类.中文 | 精品亚洲欧美一区| 在线成人小视频| 性做久久久久久| 91久久精品网| 亚洲激情一二三区| 91女神在线视频| 一区二区三区四区在线免费观看| 99久久99久久精品免费观看| 欧美激情一区二区三区不卡 | 激情综合色播五月| xf在线a精品一区二区视频网站| 欧美a级一区二区| 日韩精品一区二区三区在线播放| 青青青爽久久午夜综合久久午夜|