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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? speedstep-smi.c

?? linux內(nèi)核源碼
?? C
字號(hào):
/* * Intel SpeedStep SMI driver. * * (C) 2003  Hiroshi Miura <miura@da-cha.org> * *  Licensed under the terms of the GNU GPL License version 2. * *//********************************************************************* *                        SPEEDSTEP - DEFINITIONS                    * *********************************************************************/#include <linux/kernel.h>#include <linux/module.h>#include <linux/moduleparam.h>#include <linux/init.h>#include <linux/cpufreq.h>#include <linux/slab.h>#include <linux/delay.h>#include <asm/ist.h>#include <asm/io.h>#include "speedstep-lib.h"/* speedstep system management interface port/command. * * These parameters are got from IST-SMI BIOS call. * If user gives it, these are used. * */static int smi_port = 0;static int smi_cmd = 0;static unsigned int smi_sig = 0;/* info about the processor */static unsigned int speedstep_processor = 0;/* * There are only two frequency states for each processor. Values * are in kHz for the time being. */static struct cpufreq_frequency_table speedstep_freqs[] = {	{SPEEDSTEP_HIGH,	0},	{SPEEDSTEP_LOW,		0},	{0,			CPUFREQ_TABLE_END},};#define GET_SPEEDSTEP_OWNER 0#define GET_SPEEDSTEP_STATE 1#define SET_SPEEDSTEP_STATE 2#define GET_SPEEDSTEP_FREQS 4/* how often shall the SMI call be tried if it failed, e.g. because * of DMA activity going on? */#define SMI_TRIES 5#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-smi", msg)/** * speedstep_smi_ownership */static int speedstep_smi_ownership (void){	u32 command, result, magic;	u32 function = GET_SPEEDSTEP_OWNER;	unsigned char magic_data[] = "Copyright (c) 1999 Intel Corporation";	command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);	magic = virt_to_phys(magic_data);	dprintk("trying to obtain ownership with command %x at port %x\n", command, smi_port);	__asm__ __volatile__(		"out %%al, (%%dx)\n"		: "=D" (result)		: "a" (command), "b" (function), "c" (0), "d" (smi_port),			"D" (0), "S" (magic)		: "memory"	);	dprintk("result is %x\n", result);	return result;}/** * speedstep_smi_get_freqs - get SpeedStep preferred & current freq. * @low: the low frequency value is placed here * @high: the high frequency value is placed here * * Only available on later SpeedStep-enabled systems, returns false results or * even hangs [cf. bugme.osdl.org # 1422] on earlier systems. Empirical testing * shows that the latter occurs if !(ist_info.event & 0xFFFF). */static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high){	u32 command, result = 0, edi, high_mhz, low_mhz;	u32 state=0;	u32 function = GET_SPEEDSTEP_FREQS;	if (!(ist_info.event & 0xFFFF)) {		dprintk("bug #1422 -- can't read freqs from BIOS\n");		return -ENODEV;	}	command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);	dprintk("trying to determine frequencies with command %x at port %x\n", command, smi_port);	__asm__ __volatile__("movl $0, %%edi\n"		"out %%al, (%%dx)\n"		: "=a" (result), "=b" (high_mhz), "=c" (low_mhz), "=d" (state), "=D" (edi)		: "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0)	);	dprintk("result %x, low_freq %u, high_freq %u\n", result, low_mhz, high_mhz);	/* abort if results are obviously incorrect... */	if ((high_mhz + low_mhz) < 600)		return -EINVAL;	*high = high_mhz * 1000;	*low  = low_mhz  * 1000;	return result;}/** * speedstep_get_state - set the SpeedStep state * @state: processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH) * */static int speedstep_get_state (void){	u32 function=GET_SPEEDSTEP_STATE;	u32 result, state, edi, command;	command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);	dprintk("trying to determine current setting with command %x at port %x\n", command, smi_port);	__asm__ __volatile__("movl $0, %%edi\n"		"out %%al, (%%dx)\n"		: "=a" (result), "=b" (state), "=D" (edi)		: "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0)	);	dprintk("state is %x, result is %x\n", state, result);	return (state & 1);}/** * speedstep_set_state - set the SpeedStep state * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH) * */static void speedstep_set_state (unsigned int state){	unsigned int result = 0, command, new_state;	unsigned long flags;	unsigned int function=SET_SPEEDSTEP_STATE;	unsigned int retry = 0;	if (state > 0x1)		return;	/* Disable IRQs */	local_irq_save(flags);	command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);	dprintk("trying to set frequency to state %u with command %x at port %x\n", state, command, smi_port);	do {		if (retry) {			dprintk("retry %u, previous result %u, waiting...\n", retry, result);			mdelay(retry * 50);		}		retry++;		__asm__ __volatile__(			"movl $0, %%edi\n"			"out %%al, (%%dx)\n"			: "=b" (new_state), "=D" (result)			: "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0)			);	} while ((new_state != state) && (retry <= SMI_TRIES));	/* enable IRQs */	local_irq_restore(flags);	if (new_state == state) {		dprintk("change to %u MHz succeeded after %u tries with result %u\n", (speedstep_freqs[new_state].frequency / 1000), retry, result);	} else {		printk(KERN_ERR "cpufreq: change failed with new_state %u and result %u\n", new_state, result);	}	return;}/** * speedstep_target - set a new CPUFreq policy * @policy: new policy * @target_freq: new freq * @relation: * * Sets a new CPUFreq policy/freq. */static int speedstep_target (struct cpufreq_policy *policy,			unsigned int target_freq, unsigned int relation){	unsigned int newstate = 0;	struct cpufreq_freqs freqs;	if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))		return -EINVAL;	freqs.old = speedstep_freqs[speedstep_get_state()].frequency;	freqs.new = speedstep_freqs[newstate].frequency;	freqs.cpu = 0; /* speedstep.c is UP only driver */	if (freqs.old == freqs.new)		return 0;	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);	speedstep_set_state(newstate);	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);	return 0;}/** * speedstep_verify - verifies a new CPUFreq policy * @policy: new policy * * Limit must be within speedstep_low_freq and speedstep_high_freq, with * at least one border included. */static int speedstep_verify (struct cpufreq_policy *policy){	return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]);}static int speedstep_cpu_init(struct cpufreq_policy *policy){	int result;	unsigned int speed,state;	/* capability check */	if (policy->cpu != 0)		return -ENODEV;	result = speedstep_smi_ownership();	if (result) {		dprintk("fails in aquiring ownership of a SMI interface.\n");		return -EINVAL;	}	/* detect low and high frequency */	result = speedstep_smi_get_freqs(&speedstep_freqs[SPEEDSTEP_LOW].frequency,				&speedstep_freqs[SPEEDSTEP_HIGH].frequency);	if (result) {		/* fall back to speedstep_lib.c dection mechanism: try both states out */		dprintk("could not detect low and high frequencies by SMI call.\n");		result = speedstep_get_freqs(speedstep_processor,				&speedstep_freqs[SPEEDSTEP_LOW].frequency,				&speedstep_freqs[SPEEDSTEP_HIGH].frequency,				NULL,				&speedstep_set_state);		if (result) {			dprintk("could not detect two different speeds -- aborting.\n");			return result;		} else			dprintk("workaround worked.\n");	}	/* get current speed setting */	state = speedstep_get_state();	speed = speedstep_freqs[state].frequency;	dprintk("currently at %s speed setting - %i MHz\n",		(speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high",		(speed / 1000));	/* cpuinfo and default policy values */	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;	policy->cur = speed;	result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);	if (result)		return (result);	cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);	return 0;}static int speedstep_cpu_exit(struct cpufreq_policy *policy){	cpufreq_frequency_table_put_attr(policy->cpu);	return 0;}static unsigned int speedstep_get(unsigned int cpu){	if (cpu)		return -ENODEV;	return speedstep_get_processor_frequency(speedstep_processor);}static int speedstep_resume(struct cpufreq_policy *policy){	int result = speedstep_smi_ownership();	if (result)		dprintk("fails in re-aquiring ownership of a SMI interface.\n");	return result;}static struct freq_attr* speedstep_attr[] = {	&cpufreq_freq_attr_scaling_available_freqs,	NULL,};static struct cpufreq_driver speedstep_driver = {	.name		= "speedstep-smi",	.verify		= speedstep_verify,	.target		= speedstep_target,	.init		= speedstep_cpu_init,	.exit		= speedstep_cpu_exit,	.get		= speedstep_get,	.resume		= speedstep_resume,	.owner		= THIS_MODULE,	.attr		= speedstep_attr,};/** * speedstep_init - initializes the SpeedStep CPUFreq driver * *   Initializes the SpeedStep support. Returns -ENODEV on unsupported * BIOS, -EINVAL on problems during initiatization, and zero on * success. */static int __init speedstep_init(void){	speedstep_processor = speedstep_detect_processor();	switch (speedstep_processor) {	case SPEEDSTEP_PROCESSOR_PIII_T:	case SPEEDSTEP_PROCESSOR_PIII_C:	case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:		break;	default:		speedstep_processor = 0;	}	if (!speedstep_processor) {		dprintk ("No supported Intel CPU detected.\n");		return -ENODEV;	}	dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n",		ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level);	/* Error if no IST-SMI BIOS or no PARM		 sig= 'ISGE' aka 'Intel Speedstep Gate E' */	if ((ist_info.signature !=  0x47534943) && (	    (smi_port == 0) || (smi_cmd == 0)))		return -ENODEV;	if (smi_sig == 1)		smi_sig = 0x47534943;	else		smi_sig = ist_info.signature;	/* setup smi_port from MODLULE_PARM or BIOS */	if ((smi_port > 0xff) || (smi_port < 0))		return -EINVAL;	else if (smi_port == 0)		smi_port = ist_info.command & 0xff;	if ((smi_cmd > 0xff) || (smi_cmd < 0))		return -EINVAL;	else if (smi_cmd == 0)		smi_cmd = (ist_info.command >> 16) & 0xff;	return cpufreq_register_driver(&speedstep_driver);}/** * speedstep_exit - unregisters SpeedStep support * *   Unregisters SpeedStep support. */static void __exit speedstep_exit(void){	cpufreq_unregister_driver(&speedstep_driver);}module_param(smi_port,  int, 0444);module_param(smi_cmd,   int, 0444);module_param(smi_sig,  uint, 0444);MODULE_PARM_DESC(smi_port, "Override the BIOS-given IST port with this value -- Intel's default setting is 0xb2");MODULE_PARM_DESC(smi_cmd, "Override the BIOS-given IST command with this value -- Intel's default setting is 0x82");MODULE_PARM_DESC(smi_sig, "Set to 1 to fake the IST signature when using the SMI interface.");MODULE_AUTHOR ("Hiroshi Miura");MODULE_DESCRIPTION ("Speedstep driver for IST applet SMI interface.");MODULE_LICENSE ("GPL");module_init(speedstep_init);module_exit(speedstep_exit);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91污在线观看| 99热国产精品| 国产日韩欧美精品在线| www.爱久久.com| 一个色妞综合视频在线观看| 制服丝袜中文字幕一区| 国产伦精品一区二区三区免费迷| 国产精品毛片高清在线完整版| 日本乱人伦一区| 亚洲成人精品一区| 国产精品嫩草99a| 欧美猛男gaygay网站| 国产成人自拍网| 日韩在线观看一区二区| 国产欧美日韩三级| 欧美一区二区三区在| 成人福利电影精品一区二区在线观看| 亚洲免费在线看| 欧美videos中文字幕| 99久久综合狠狠综合久久| 日韩不卡一二三区| 国产精品久久久爽爽爽麻豆色哟哟| 在线观看网站黄不卡| 国产精品99久久久久久久女警 | 免费成人在线观看视频| 国产精品久久久久久久久免费桃花| 欧美丝袜丝交足nylons| 成人h精品动漫一区二区三区| 日韩激情中文字幕| 亚洲欧美日韩国产手机在线 | 91视频观看视频| 精品午夜久久福利影院| 亚洲影视资源网| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美成人r级一区二区三区| 色综合视频在线观看| 韩国精品主播一区二区在线观看| 亚洲成人综合在线| 亚洲男人电影天堂| 国产精品白丝在线| 中文字幕乱码日本亚洲一区二区| 91精品国产高清一区二区三区蜜臀 | 久久亚洲捆绑美女| 欧美视频完全免费看| 国产精品 欧美精品| 另类小说图片综合网| 日韩二区在线观看| 午夜精品久久久久| 中文字幕亚洲一区二区av在线| 久久先锋影音av| 日韩精品资源二区在线| 欧美美女直播网站| 色久优优欧美色久优优| 国产成人免费av在线| 蜜臀久久久99精品久久久久久| 丝袜国产日韩另类美女| 五月天网站亚洲| 午夜精品福利一区二区蜜股av| 亚洲精品国产品国语在线app| 国产精品久久久久久久午夜片| 久久久国际精品| 精品国产乱码久久久久久浪潮| 99久久综合色| 日韩经典一区二区| 国产精品视频看| 国产欧美日韩不卡免费| 欧美—级在线免费片| 欧美国产乱子伦 | 一级中文字幕一区二区| 亚洲激情自拍视频| 一区二区三区中文字幕电影| 亚洲一区二区在线免费看| 亚洲妇女屁股眼交7| 日韩专区一卡二卡| 日韩国产成人精品| 国内成人免费视频| 成人综合激情网| 99国产精品国产精品毛片| 一本大道av伊人久久综合| 色综合天天综合| 欧美日韩一区二区三区在线看| 5858s免费视频成人| 精品少妇一区二区三区在线播放| 久久久国产一区二区三区四区小说 | 亚洲成人激情综合网| 天天综合日日夜夜精品| 久久aⅴ国产欧美74aaa| 国产91富婆露脸刺激对白| 色综合久久天天综合网| 欧美色区777第一页| 欧美大尺度电影在线| 国产日韩欧美不卡| 亚洲精品免费看| 秋霞影院一区二区| 国产高清久久久久| 日本韩国一区二区三区视频| 欧美天堂一区二区三区| 精品国产自在久精品国产| 国产精品成人网| 日本三级韩国三级欧美三级| 国产suv精品一区二区6| 欧美亚洲一区二区在线| 精品电影一区二区| 亚洲人成人一区二区在线观看| 亚洲国产精品综合小说图片区| 九色porny丨国产精品| av在线一区二区三区| 91福利在线观看| 日韩一区二区三区四区| 中文字幕一区二区不卡| 免费av网站大全久久| 99re这里都是精品| 精品美女被调教视频大全网站| 亚洲婷婷国产精品电影人久久| 欧美aⅴ一区二区三区视频| 不卡视频一二三| 日韩一区二区免费视频| 久久九九国产精品| 日韩成人免费在线| 91蝌蚪porny成人天涯| 精品日韩一区二区三区免费视频| 亚洲精品国产一区二区精华液| 亚洲成人激情社区| youjizz国产精品| 精品盗摄一区二区三区| 亚洲一二三四在线观看| 成人avav影音| 久久精品人人做人人爽人人| 亚洲国产三级在线| 99re成人精品视频| 久久久久久久久免费| 水野朝阳av一区二区三区| 色视频欧美一区二区三区| 欧美国产日韩一二三区| 久久国产三级精品| 不卡av电影在线播放| 久久亚洲春色中文字幕久久久| 亚洲成av人综合在线观看| 99久久综合99久久综合网站| 国产午夜精品一区二区三区嫩草 | 欧美怡红院视频| 欧美国产精品v| 国产一区 二区 三区一级| 欧美一区2区视频在线观看| 亚洲午夜久久久久久久久久久| 99视频国产精品| 国产精品网站在线| 国产69精品久久久久777| 精品久久久久久久久久久院品网 | 国产精品资源在线观看| 日韩欧美综合一区| 亚洲成在人线免费| 欧美三级在线视频| 天天操天天色综合| 欧美日本一区二区| 日本伊人色综合网| 欧美一区二区在线不卡| 三级久久三级久久| 欧美日韩精品综合在线| 五月天一区二区| 7777精品伊人久久久大香线蕉的 | 91在线视频官网| 国产精品入口麻豆九色| 麻豆精品一区二区综合av| 欧美日韩精品免费观看视频| 性久久久久久久久| 欧美高清视频一二三区| 男男视频亚洲欧美| 精品成人佐山爱一区二区| 成人av先锋影音| 亚洲成人动漫一区| 久久精品一区二区三区四区| 99久久久久久| 免费成人在线影院| 亚洲欧洲成人精品av97| 欧美狂野另类xxxxoooo| 国产精品88888| 亚洲高清在线精品| 久久久精品免费免费| 欧美三级资源在线| 国产成人亚洲综合a∨婷婷| 亚洲午夜电影网| 国产偷国产偷精品高清尤物| 色婷婷综合久久| 经典三级视频一区| 亚洲精品日韩专区silk| 精品久久一区二区| 在线观看一区不卡| 国产一区日韩二区欧美三区| 亚洲欧美一区二区三区极速播放| 91精品国产色综合久久ai换脸 | 国产高清成人在线| 午夜精品福利一区二区三区av| 国产午夜一区二区三区| 欧美影片第一页| 国产**成人网毛片九色| 日本大胆欧美人术艺术动态| 1区2区3区欧美| 久久婷婷综合激情| 欧美日韩精品欧美日韩精品 |