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

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

?? apm.c

?? linux-2.6.15.6
?? C
?? 第 1 頁 / 共 5 頁
字號:
#define NR_APM_EVENT_NAME ARRAY_SIZE(apm_event_name)typedef struct lookup_t {	int	key;	char *	msg;} lookup_t;/* *	The BIOS returns a set of standard error codes in AX when the *	carry flag is set. */ static const lookup_t error_table[] = {/* N/A	{ APM_SUCCESS,		"Operation succeeded" }, */	{ APM_DISABLED,		"Power management disabled" },	{ APM_CONNECTED,	"Real mode interface already connected" },	{ APM_NOT_CONNECTED,	"Interface not connected" },	{ APM_16_CONNECTED,	"16 bit interface already connected" },/* N/A	{ APM_16_UNSUPPORTED,	"16 bit interface not supported" }, */	{ APM_32_CONNECTED,	"32 bit interface already connected" },	{ APM_32_UNSUPPORTED,	"32 bit interface not supported" },	{ APM_BAD_DEVICE,	"Unrecognized device ID" },	{ APM_BAD_PARAM,	"Parameter out of range" },	{ APM_NOT_ENGAGED,	"Interface not engaged" },	{ APM_BAD_FUNCTION,     "Function not supported" },	{ APM_RESUME_DISABLED,	"Resume timer disabled" },	{ APM_BAD_STATE,	"Unable to enter requested state" },/* N/A	{ APM_NO_EVENTS,	"No events pending" }, */	{ APM_NO_ERROR,		"BIOS did not set a return code" },	{ APM_NOT_PRESENT,	"No APM present" }};#define ERROR_COUNT	ARRAY_SIZE(error_table)/** *	apm_error	-	display an APM error *	@str: information string *	@err: APM BIOS return code * *	Write a meaningful log entry to the kernel log in the event of *	an APM error. */ static void apm_error(char *str, int err){	int	i;	for (i = 0; i < ERROR_COUNT; i++)		if (error_table[i].key == err) break;	if (i < ERROR_COUNT)		printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg);	else		printk(KERN_NOTICE "apm: %s: unknown error code %#2.2x\n",			str, err);}/* * Lock APM functionality to physical CPU 0 */ #ifdef CONFIG_SMPstatic cpumask_t apm_save_cpus(void){	cpumask_t x = current->cpus_allowed;	/* Some bioses don't like being called from CPU != 0 */	set_cpus_allowed(current, cpumask_of_cpu(0));	BUG_ON(smp_processor_id() != 0);	return x;}static inline void apm_restore_cpus(cpumask_t mask){	set_cpus_allowed(current, mask);}#else/* *	No CPU lockdown needed on a uniprocessor */ #define apm_save_cpus()		(current->cpus_allowed)#define apm_restore_cpus(x)	(void)(x)#endif/* * These are the actual BIOS calls.  Depending on APM_ZERO_SEGS and * apm_info.allow_ints, we are being really paranoid here!  Not only * are interrupts disabled, but all the segment registers (except SS) * are saved and zeroed this means that if the BIOS tries to reference * any data without explicitly loading the segment registers, the kernel * will fault immediately rather than have some unforeseen circumstances * for the rest of the kernel.  And it will be very obvious!  :-) Doing * this depends on CS referring to the same physical memory as DS so that * DS can be zeroed before the call. Unfortunately, we can't do anything * about the stack segment/pointer.  Also, we tell the compiler that * everything could change. * * Also, we KNOW that for the non error case of apm_bios_call, there * is no useful data returned in the low order 8 bits of eax. */#define APM_DO_CLI	\	if (apm_info.allow_ints) \		local_irq_enable(); \	else \		local_irq_disable();#ifdef APM_ZERO_SEGS#	define APM_DECL_SEGS \		unsigned int saved_fs; unsigned int saved_gs;#	define APM_DO_SAVE_SEGS \		savesegment(fs, saved_fs); savesegment(gs, saved_gs)#	define APM_DO_RESTORE_SEGS \		loadsegment(fs, saved_fs); loadsegment(gs, saved_gs)#else#	define APM_DECL_SEGS#	define APM_DO_SAVE_SEGS#	define APM_DO_RESTORE_SEGS#endif/** *	apm_bios_call	-	Make an APM BIOS 32bit call *	@func: APM function to execute *	@ebx_in: EBX register for call entry *	@ecx_in: ECX register for call entry *	@eax: EAX register return *	@ebx: EBX register return *	@ecx: ECX register return *	@edx: EDX register return *	@esi: ESI register return * *	Make an APM call using the 32bit protected mode interface. The *	caller is responsible for knowing if APM BIOS is configured and *	enabled. This call can disable interrupts for a long period of *	time on some laptops.  The return value is in AH and the carry *	flag is loaded into AL.  If there is an error, then the error *	code is returned in AH (bits 8-15 of eax) and this function *	returns non-zero. */ static u8 apm_bios_call(u32 func, u32 ebx_in, u32 ecx_in,	u32 *eax, u32 *ebx, u32 *ecx, u32 *edx, u32 *esi){	APM_DECL_SEGS	unsigned long		flags;	cpumask_t		cpus;	int			cpu;	struct desc_struct	save_desc_40;	struct desc_struct	*gdt;	cpus = apm_save_cpus();		cpu = get_cpu();	gdt = get_cpu_gdt_table(cpu);	save_desc_40 = gdt[0x40 / 8];	gdt[0x40 / 8] = bad_bios_desc;	local_save_flags(flags);	APM_DO_CLI;	APM_DO_SAVE_SEGS;	apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi);	APM_DO_RESTORE_SEGS;	local_irq_restore(flags);	gdt[0x40 / 8] = save_desc_40;	put_cpu();	apm_restore_cpus(cpus);		return *eax & 0xff;}/** *	apm_bios_call_simple	-	make a simple APM BIOS 32bit call *	@func: APM function to invoke *	@ebx_in: EBX register value for BIOS call *	@ecx_in: ECX register value for BIOS call *	@eax: EAX register on return from the BIOS call * *	Make a BIOS call that does only returns one value, or just status. *	If there is an error, then the error code is returned in AH *	(bits 8-15 of eax) and this function returns non-zero. This is *	used for simpler BIOS operations. This call may hold interrupts *	off for a long time on some laptops. */static u8 apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax){	u8			error;	APM_DECL_SEGS	unsigned long		flags;	cpumask_t		cpus;	int			cpu;	struct desc_struct	save_desc_40;	struct desc_struct	*gdt;	cpus = apm_save_cpus();		cpu = get_cpu();	gdt = get_cpu_gdt_table(cpu);	save_desc_40 = gdt[0x40 / 8];	gdt[0x40 / 8] = bad_bios_desc;	local_save_flags(flags);	APM_DO_CLI;	APM_DO_SAVE_SEGS;	error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax);	APM_DO_RESTORE_SEGS;	local_irq_restore(flags);	gdt[0x40 / 8] = save_desc_40;	put_cpu();	apm_restore_cpus(cpus);	return error;}/** *	apm_driver_version	-	APM driver version *	@val:	loaded with the APM version on return * *	Retrieve the APM version supported by the BIOS. This is only *	supported for APM 1.1 or higher. An error indicates APM 1.0 is *	probably present. * *	On entry val should point to a value indicating the APM driver *	version with the high byte being the major and the low byte the *	minor number both in BCD * *	On return it will hold the BIOS revision supported in the *	same format. */static int apm_driver_version(u_short *val){	u32	eax;	if (apm_bios_call_simple(APM_FUNC_VERSION, 0, *val, &eax))		return (eax >> 8) & 0xff;	*val = eax;	return APM_SUCCESS;}/** *	apm_get_event	-	get an APM event from the BIOS *	@event: pointer to the event *	@info: point to the event information * *	The APM BIOS provides a polled information for event *	reporting. The BIOS expects to be polled at least every second *	when events are pending. When a message is found the caller should *	poll until no more messages are present.  However, this causes *	problems on some laptops where a suspend event notification is *	not cleared until it is acknowledged. * *	Additional information is returned in the info pointer, providing *	that APM 1.2 is in use. If no messges are pending the value 0x80 *	is returned (No power management events pending). */ static int apm_get_event(apm_event_t *event, apm_eventinfo_t *info){	u32	eax;	u32	ebx;	u32	ecx;	u32	dummy;	if (apm_bios_call(APM_FUNC_GET_EVENT, 0, 0, &eax, &ebx, &ecx,			&dummy, &dummy))		return (eax >> 8) & 0xff;	*event = ebx;	if (apm_info.connection_version < 0x0102)		*info = ~0; /* indicate info not valid */	else		*info = ecx;	return APM_SUCCESS;}/** *	set_power_state	-	set the power management state *	@what: which items to transition *	@state: state to transition to * *	Request an APM change of state for one or more system devices. The *	processor state must be transitioned last of all. what holds the *	class of device in the upper byte and the device number (0xFF for *	all) for the object to be transitioned. * *	The state holds the state to transition to, which may in fact *	be an acceptance of a BIOS requested state change. */ static int set_power_state(u_short what, u_short state){	u32	eax;	if (apm_bios_call_simple(APM_FUNC_SET_STATE, what, state, &eax))		return (eax >> 8) & 0xff;	return APM_SUCCESS;}/** *	set_system_power_state - set system wide power state *	@state: which state to enter * *	Transition the entire system into a new APM power state. */ static int set_system_power_state(u_short state){	return set_power_state(APM_DEVICE_ALL, state);}/** *	apm_do_idle	-	perform power saving * *	This function notifies the BIOS that the processor is (in the view *	of the OS) idle. It returns -1 in the event that the BIOS refuses *	to handle the idle request. On a success the function returns 1 *	if the BIOS did clock slowing or 0 otherwise. */ static int apm_do_idle(void){	u32	eax;	u8	ret = 0;	int	idled = 0;	int	polling;	polling = test_thread_flag(TIF_POLLING_NRFLAG);	if (polling) {		clear_thread_flag(TIF_POLLING_NRFLAG);		smp_mb__after_clear_bit();	}	if (!need_resched()) {		idled = 1;		ret = apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax);	}	if (polling)		set_thread_flag(TIF_POLLING_NRFLAG);	if (!idled)		return 0;	if (ret) {		static unsigned long t;		/* This always fails on some SMP boards running UP kernels.		 * Only report the failure the first 5 times.		 */		if (++t < 5)		{			printk(KERN_DEBUG "apm_do_idle failed (%d)\n",					(eax >> 8) & 0xff);			t = jiffies;		}		return -1;	}	clock_slowed = (apm_info.bios.flags & APM_IDLE_SLOWS_CLOCK) != 0;	return clock_slowed;}/** *	apm_do_busy	-	inform the BIOS the CPU is busy * *	Request that the BIOS brings the CPU back to full performance.  */ static void apm_do_busy(void){	u32	dummy;	if (clock_slowed || ALWAYS_CALL_BUSY) {		(void) apm_bios_call_simple(APM_FUNC_BUSY, 0, 0, &dummy);		clock_slowed = 0;	}}/* * If no process has really been interested in * the CPU for some time, we want to call BIOS * power management - we probably want * to conserve power. */#define IDLE_CALC_LIMIT   (HZ * 100)#define IDLE_LEAKY_MAX    16static void (*original_pm_idle)(void);extern void default_idle(void);/** * apm_cpu_idle		-	cpu idling for APM capable Linux * * This is the idling function the kernel executes when APM is available. It  * tries to do BIOS powermanagement based on the average system idle time. * Furthermore it calls the system default idle routine. */static void apm_cpu_idle(void){	static int use_apm_idle; /* = 0 */	static unsigned int last_jiffies; /* = 0 */	static unsigned int last_stime; /* = 0 */	int apm_idle_done = 0;	unsigned int jiffies_since_last_check = jiffies - last_jiffies;	unsigned int bucket;recalc:	if (jiffies_since_last_check > IDLE_CALC_LIMIT) {		use_apm_idle = 0;		last_jiffies = jiffies;		last_stime = current->stime;	} else if (jiffies_since_last_check > idle_period) {		unsigned int idle_percentage;		idle_percentage = current->stime - last_stime;		idle_percentage *= 100;		idle_percentage /= jiffies_since_last_check;		use_apm_idle = (idle_percentage > idle_threshold);		if (apm_info.forbid_idle)			use_apm_idle = 0;		last_jiffies = jiffies;		last_stime = current->stime;	}	bucket = IDLE_LEAKY_MAX;	while (!need_resched()) {		if (use_apm_idle) {			unsigned int t;			t = jiffies;			switch (apm_do_idle()) {			case 0: apm_idle_done = 1;				if (t != jiffies) {					if (bucket) {						bucket = IDLE_LEAKY_MAX;						continue;					}				} else if (bucket) {					bucket--;					continue;				}				break;			case 1: apm_idle_done = 1;				break;			default: /* BIOS refused */				break;			}		}		if (original_pm_idle)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人综合视频| 国产日韩欧美不卡在线| 亚洲一二三区视频在线观看| 色8久久人人97超碰香蕉987| 亚洲一区二区三区四区五区黄| 在线看一区二区| 三级一区在线视频先锋| 日韩精品在线一区二区| 国产精品18久久久久久vr| 久久精品一区二区三区四区| 成人国产电影网| 亚洲一区二区精品3399| 欧美绝品在线观看成人午夜影视| 免费在线观看一区| 国产精品乱码一区二三区小蝌蚪| 91久色porny | 日韩欧美国产午夜精品| 国模娜娜一区二区三区| 亚洲欧洲成人av每日更新| 欧美亚洲一区二区三区四区| 日本欧美一区二区| 国产精品另类一区| 欧美日本一区二区在线观看| 国产一区二区伦理片| 亚洲欧美国产三级| 正在播放一区二区| 成人免费毛片高清视频| 亚洲成a人片综合在线| 欧美精品一区二区蜜臀亚洲| www.亚洲精品| 免费亚洲电影在线| 亚洲人成网站影音先锋播放| 91精品国产手机| 99久久婷婷国产综合精品电影 | 久久精品国产色蜜蜜麻豆| 欧美激情综合网| 欧美午夜精品理论片a级按摩| 蜜桃91丨九色丨蝌蚪91桃色| 中文字幕亚洲不卡| 精品国产凹凸成av人导航| 日本精品裸体写真集在线观看| 激情久久五月天| 性欧美疯狂xxxxbbbb| 国产精品日韩精品欧美在线| 日韩视频免费观看高清完整版 | 亚洲欧美综合另类在线卡通| 91精品国产91久久久久久一区二区| 成人福利视频在线| 蜜桃在线一区二区三区| 一区二区三区免费看视频| 国产亚洲人成网站| 欧美一卡二卡三卡| 精品视频在线看| 91麻豆蜜桃一区二区三区| 国产乱子伦一区二区三区国色天香| 亚洲成人综合视频| 亚洲一区在线观看免费 | 亚洲三级在线看| 国产亲近乱来精品视频| 欧美一区二区播放| 7777精品伊人久久久大香线蕉经典版下载 | 91网站在线观看视频| 国产乱码精品一区二区三区忘忧草 | 日韩欧美精品在线视频| 欧美性猛交一区二区三区精品| www.性欧美| 国产91精品免费| 国产福利一区二区| 狠狠色综合日日| 久久疯狂做爰流白浆xx| 男男成人高潮片免费网站| 日本免费在线视频不卡一不卡二| 亚洲一区在线播放| 午夜精品久久久久久久| 亚洲人吸女人奶水| 亚洲人成网站在线| 亚洲精品v日韩精品| 依依成人综合视频| 亚洲一区在线观看免费| 天堂影院一区二区| 日韩极品在线观看| 老司机精品视频导航| 麻豆91在线播放免费| 紧缚奴在线一区二区三区| 韩国女主播一区二区三区| 国产精品99精品久久免费| 国产 日韩 欧美大片| 成人av集中营| 色猫猫国产区一区二在线视频| 欧美影院一区二区三区| 欧美日韩成人一区二区| 日韩三级av在线播放| 久久美女艺术照精彩视频福利播放| 国产性做久久久久久| 1024国产精品| 婷婷六月综合网| 久久99精品视频| 成人午夜激情片| 在线观看www91| 91精品国产一区二区| 欧美国产视频在线| 亚洲黄色录像片| 麻豆国产一区二区| 懂色av一区二区三区免费看| 日本乱码高清不卡字幕| 欧美精品久久99| 中文字幕欧美激情| 亚洲午夜免费视频| 国产一区在线视频| 91在线观看免费视频| 欧美一区二区三区成人| 国产亚洲自拍一区| 亚洲综合激情网| 精品一区二区免费看| 91麻豆自制传媒国产之光| 欧美一级午夜免费电影| 国产精品进线69影院| 天天综合色天天| 成人午夜又粗又硬又大| 欧美日韩一区二区三区在线看| 日韩女优视频免费观看| 国产精品久久综合| 久热成人在线视频| 91啦中文在线观看| 久久精品男人的天堂| 亚洲123区在线观看| 成人性视频网站| 欧美一区二区三区在线视频| 国产精品成人免费| 麻豆成人久久精品二区三区小说| 一本大道综合伊人精品热热| 91精品综合久久久久久| 中文字幕在线视频一区| 久久99久久久欧美国产| 色噜噜狠狠一区二区三区果冻| 久久亚洲春色中文字幕久久久| 一区二区三区在线视频免费观看| 国产另类ts人妖一区二区| 欧美精品高清视频| 亚洲免费电影在线| 国产91丝袜在线观看| 精品国产一区二区三区久久影院| 亚洲一二三四区不卡| 99国产精品视频免费观看| 日韩欧美综合在线| 一区二区日韩av| 91亚洲男人天堂| 国产精品欧美极品| 国产一区999| 精品福利在线导航| 日本不卡的三区四区五区| 欧美系列在线观看| **网站欧美大片在线观看| 国产精品18久久久久久vr| 精品国产自在久精品国产| 日本亚洲一区二区| 欧美精选一区二区| 午夜精品久久久久久久99水蜜桃| 91香蕉视频污在线| 亚洲视频一区二区免费在线观看| 国产成人综合精品三级| 久久久美女毛片| 国产一区二区三区不卡在线观看| 日韩欧美在线1卡| 麻豆91免费看| 日韩欧美在线网站| 激情综合色播激情啊| 精品免费日韩av| 精品午夜一区二区三区在线观看| 日韩欧美一级特黄在线播放| 蜜臀99久久精品久久久久久软件| 日韩无一区二区| 韩国三级电影一区二区| 国产午夜精品一区二区| 粉嫩绯色av一区二区在线观看| 中文字幕不卡三区| 91免费观看国产| 亚洲永久精品大片| 欧美日韩日日夜夜| 免费三级欧美电影| 国产三级一区二区三区| 成人夜色视频网站在线观看| 亚洲人成小说网站色在线 | 中文字幕一区二区三区四区不卡| 波多野结衣中文字幕一区二区三区| 中文字幕亚洲不卡| 在线精品视频小说1| 日韩电影在线观看电影| 精品国产免费久久| 99久久久无码国产精品| 一个色妞综合视频在线观看| 欧美日本高清视频在线观看| 日本中文字幕一区| 国产日韩欧美一区二区三区综合| 成人av一区二区三区| 亚洲成a天堂v人片| 精品美女在线播放| 91麻豆国产精品久久| 蜜臀va亚洲va欧美va天堂| 久久蜜桃av一区精品变态类天堂|