您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ suspend_prepare函数代码示例

51自学网 2021-06-03 08:33:47
  C++
这篇教程C++ suspend_prepare函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中suspend_prepare函数的典型用法代码示例。如果您正苦于以下问题:C++ suspend_prepare函数的具体用法?C++ suspend_prepare怎么用?C++ suspend_prepare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了suspend_prepare函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: enter_state

/** *	enter_state - Do common work of entering low-power state. *	@state:		pm_state structure for state we're entering. * *	Make sure we're the only ones trying to enter a sleep state. Fail *	if someone has beat us to it, since we don't want anything weird to *	happen when we wake up. *	Then, do the setup for suspend, enter the state, and cleaup (after *	we've woken up). */int enter_state(suspend_state_t state){	int error;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	run_suspend();		printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	error = suspend_prepare();	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	error = suspend_devices_and_enter(state); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish();	run_resume(); Unlock:	mutex_unlock(&pm_mutex);	return error;}
开发者ID:AvengerMoJo,项目名称:apc-8750,代码行数:45,


示例2: enter_state

static int enter_state(suspend_state_t state){	int error;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	if (state == PM_SUSPEND_DISK) {		error = pm_suspend_disk();		goto Unlock;	}	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	if ((error = suspend_prepare(state)))		goto Unlock;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	error = suspend_enter(state);	pr_debug("PM: Finishing wakeup./n");	suspend_finish(state); Unlock:	mutex_unlock(&pm_mutex);	return error;}
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:27,


示例3: enter_state

static int enter_state(u32 state){	int error;	if (down_trylock(&pm_sem))		return -EBUSY;	/* Suspend is hard to get right on SMP. */	if (num_online_cpus() != 1) {		error = -EPERM;		goto Unlock;	}	if (state == PM_SUSPEND_DISK) {		error = pm_suspend_disk();		goto Unlock;	}	pr_debug("PM: Preparing system for suspend/n");	if ((error = suspend_prepare(state)))		goto Unlock;	pr_debug("PM: Entering state./n");	error = suspend_enter(state);	pr_debug("PM: Finishing up./n");	suspend_finish(state); Unlock:	up(&pm_sem);	return error;}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:31,


示例4: enter_state

/** *	enter_state - Do common work of entering low-power state. *	@state:		pm_state structure for state we're entering. * *	Make sure we're the only ones trying to enter a sleep state. Fail *	if someone has beat us to it, since we don't want anything weird to *	happen when we wake up. *	Then, do the setup for suspend, enter the state, and cleaup (after *	we've woken up). */int enter_state(suspend_state_t state){	int error;	struct task_struct *cpu_task;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	/*	 * Assure that previous started thread is completed before	 * attempting to suspend again.	 */	error = wait_for_completion_timeout(&second_cpu_complete,					    msecs_to_jiffies(500));	WARN_ON(error == 0);#ifdef CONFIG_PM_SYNC_CTRL	if (pm_sync_active) {;		sys_sync();;	}#else;	sys_sync();;#endif	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	error = suspend_prepare();	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish(); Unlock:	cpu_task = kthread_run(plug_secondary_cpus,			       NULL, "cpu-plug");	BUG_ON(IS_ERR(cpu_task));	mutex_unlock(&pm_mutex);	return error;}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:65,


示例5: enter_state

/** * enter_state - Do common work needed to enter system sleep state. * @state: System sleep state to enter. * * Make sure that no one else is trying to put the system into a sleep state. * Fail if that's not the case.  Otherwise, prepare for system suspend, make the * system enter the given sleep state and clean up after wakeup. */static int enter_state(suspend_state_t state){	int error;	if (state == PM_SUSPEND_FREEZE) {#ifdef CONFIG_PM_DEBUG		if (pm_test_level != TEST_NONE && pm_test_level <= TEST_CPUS) {			pr_warning("PM: Unsupported test mode for freeze state,"				   "please choose none/freezer/devices/platform./n");			return -EAGAIN;		}#endif	} else if (!valid_state(state)) {		return -EINVAL;	}	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	if (state == PM_SUSPEND_FREEZE)		freeze_begin();#ifdef CONFIG_HAS_EARLYSUSPEND	if (suspendsync)		suspend_sys_sync_queue();#else	if (suspendsync) {		printk(KERN_INFO "PM: Syncing filesystems ... ");		sys_sync();		printk("done./n");	}#endif	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state].label);	error = suspend_prepare(state);	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state].label);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish(); Unlock:	mutex_unlock(&pm_mutex);	return error;}
开发者ID:sombree,项目名称:Hulk-Kernel-V2,代码行数:60,


示例6: enter_state

/** * enter_state - Do common work needed to enter system sleep state. * @state: System sleep state to enter. * * Make sure that no one else is trying to put the system into a sleep state. * Fail if that's not the case.  Otherwise, prepare for system suspend, make the * system enter the given sleep state and clean up after wakeup. */static int enter_state(suspend_state_t state){	int error;	trace_suspend_resume(TPS("suspend_enter"), state, true);	if (state == PM_SUSPEND_TO_IDLE) {#ifdef CONFIG_PM_DEBUG		if (pm_test_level != TEST_NONE && pm_test_level <= TEST_CPUS) {			pr_warn("Unsupported test mode for suspend to idle, please choose none/freezer/devices/platform./n");			return -EAGAIN;		}#endif	} else if (!valid_state(state)) {		return -EINVAL;	}	if (!mutex_trylock(&system_transition_mutex))		return -EBUSY;	if (state == PM_SUSPEND_TO_IDLE)		s2idle_begin();#ifndef CONFIG_SUSPEND_SKIP_SYNC	trace_suspend_resume(TPS("sync_filesystems"), 0, true);	pr_info("Syncing filesystems ... ");	ksys_sync();	pr_cont("done./n");	trace_suspend_resume(TPS("sync_filesystems"), 0, false);#endif	pm_pr_dbg("Preparing system for sleep (%s)/n", mem_sleep_labels[state]);	pm_suspend_clear_flags();	error = suspend_prepare(state);	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	trace_suspend_resume(TPS("suspend_enter"), state, false);	pm_pr_dbg("Suspending system (%s)/n", mem_sleep_labels[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	events_check_enabled = false;	pm_pr_dbg("Finishing wakeup./n");	suspend_finish(); Unlock:	mutex_unlock(&system_transition_mutex);	return error;}
开发者ID:guribe94,项目名称:linux,代码行数:60,


示例7: enter_state

/** * enter_state - Do common work needed to enter system sleep state. * @state: System sleep state to enter. * * Make sure that no one else is trying to put the system into a sleep state. * Fail if that's not the case.  Otherwise, prepare for system suspend, make the * system enter the given sleep state and clean up after wakeup. */static int enter_state(suspend_state_t state){	int error;	trace_suspend_resume(TPS("suspend_enter"), state, true);	if (state == PM_SUSPEND_FREEZE) {#ifdef CONFIG_PM_DEBUG		if (pm_test_level != TEST_NONE && pm_test_level <= TEST_CPUS) {			pr_warning("PM: Unsupported test mode for suspend to idle,"				   "please choose none/freezer/devices/platform./n");			return -EAGAIN;		}#endif	} else if (!valid_state(state)) {		return -EINVAL;	}	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	if (state == PM_SUSPEND_FREEZE)		freeze_begin();	trace_suspend_resume(TPS("sync_filesystems"), 0, true);	printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");	trace_suspend_resume(TPS("sync_filesystems"), 0, false);	pr_debug("PM: Preparing system for sleep (%s)/n", pm_states[state]);	error = suspend_prepare(state);	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	trace_suspend_resume(TPS("suspend_enter"), state, false);	pr_debug("PM: Suspending system (%s)/n", pm_states[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish(); Unlock:	mutex_unlock(&pm_mutex);	return error;}
开发者ID:Seagate,项目名称:SMR_FS-EXT4,代码行数:57,


示例8: enter_state

/** * enter_state - Do common work needed to enter system sleep state. * @state: System sleep state to enter. * * Make sure that no one else is trying to put the system into a sleep state. * Fail if that's not the case.  Otherwise, prepare for system suspend, make the * system enter the given sleep state and clean up after wakeup. */static int enter_state(suspend_state_t state){    int error;    if (!valid_state(state))        return -ENODEV;    if (!mutex_trylock(&pm_mutex))        return -EBUSY;    if (state == PM_SUSPEND_FREEZE)        freeze_begin();#ifndef CONFIG_ARCH_HI3630    printk(KERN_INFO "PM: Syncing filesystems ... ");    sys_sync();    printk("done./n");#else    hisi_sys_sync_queue();#endif    pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);    error = suspend_prepare(state);    if (error)        goto Unlock;    if (suspend_test(TEST_FREEZER))        goto Finish;    pr_debug("PM: Entering %s sleep/n", pm_states[state]);    pm_restrict_gfp_mask();    error = suspend_devices_and_enter(state);    pm_restore_gfp_mask();Finish:    pr_debug("PM: Finishing wakeup./n");    suspend_finish();Unlock:    mutex_unlock(&pm_mutex);    return error;}
开发者ID:herryfan,项目名称:kernel-huawei-h60,代码行数:53,


示例9: enter_state

/** * enter_state - Do common work needed to enter system sleep state. * @state: System sleep state to enter. * * Make sure that no one else is trying to put the system into a sleep state. * Fail if that's not the case.  Otherwise, prepare for system suspend, make the * system enter the given sleep state and clean up after wakeup. */static int enter_state(suspend_state_t state){	int error;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	if (state == PM_SUSPEND_FREEZE)		freeze_begin();	printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	error = suspend_prepare(state);	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	pr_debug("PM: Finishing wakeup./n");#ifdef CONFIG_MACH_LGE	start_monitor_blocking(suspend_monitor_id,		jiffies + usecs_to_jiffies(3000000));#endif	suspend_finish();#ifdef CONFIG_MACH_LGE	end_monitor_blocking(suspend_monitor_id);#endif Unlock:	mutex_unlock(&pm_mutex);	return error;}
开发者ID:AbdulrahmanAmir,项目名称:Dorimanx-LG-G2-D802-Kernel,代码行数:52,


示例10: enter_state

/** *	enter_state - Do common work of entering low-power state. *	@state:		pm_state structure for state we're entering. * *	Make sure we're the only ones trying to enter a sleep state. Fail *	if someone has beat us to it, since we don't want anything weird to *	happen when we wake up. *	Then, do the setup for suspend, enter the state, and cleaup (after *	we've woken up). */int enter_state(suspend_state_t state){	int error;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	error = suspend_prepare();	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;		meson_lock_min_cpufreq(336000);	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask();	meson_lock_min_cpufreq(0); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish(); Unlock: 		mutex_unlock(&pm_mutex);#ifdef CONFIG_SUSPEND_WATCHDOG	extern void disable_watchdog(void);	disable_watchdog();#endif   		return error;}
开发者ID:abazad,项目名称:7300-kern,代码行数:51,


示例11: enter_state

/** *	enter_state - Do common work of entering low-power state. *	@state:		pm_state structure for state we're entering. * *	Make sure we're the only ones trying to enter a sleep state. Fail *	if someone has beat us to it, since we don't want anything weird to *	happen when we wake up. *	Then, do the setup for suspend, enter the state, and cleaup (after *	we've woken up). */int enter_state(suspend_state_t state){	int error;	struct timer_list timer;	struct pm_wd_data data;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	error = suspend_prepare();	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	pm_wd_add_timer(&timer, &data, 15);	pr_debug("PM: Finishing wakeup./n");	suspend_finish();	pm_wd_del_timer(&timer); Unlock:	mutex_unlock(&pm_mutex);	return error;}
开发者ID:InhyukYee,项目名称:PeanutButterWolf,代码行数:50,


示例12: enter_state

/** *	enter_state - Do common work of entering low-power state. *	@state:		pm_state structure for state we're entering. * *	Make sure we're the only ones trying to enter a sleep state. Fail *	if someone has beat us to it, since we don't want anything weird to *	happen when we wake up. *	Then, do the setup for suspend, enter the state, and cleaup (after *	we've woken up). */int enter_state(suspend_state_t state){    int error;    if (!valid_state(state))        return -ENODEV;    if (!mutex_trylock(&pm_mutex))        return -EBUSY;#ifdef CONFIG_MSM_SM_EVENT    sm_set_system_state (SM_STATE_SUSPEND);    sm_add_event(SM_POWER_EVENT | SM_POWER_EVENT_SUSPEND, SM_EVENT_START, 0, NULL, 0);#endif    suspend_sys_sync_queue();    pr_info("PM: Preparing system for %s sleep/n", pm_states[state]);    error = suspend_prepare();    if (error)        goto Unlock;    if (suspend_test(TEST_FREEZER))        goto Finish;    pr_info("PM: Entering %s sleep/n", pm_states[state]);    pm_restrict_gfp_mask();    error = suspend_devices_and_enter(state);    pm_restore_gfp_mask();Finish:    pr_info("PM: Finishing wakeup./n");    suspend_finish();Unlock:    mutex_unlock(&pm_mutex);#ifdef CONFIG_MSM_SM_EVENT    sm_add_event(SM_POWER_EVENT | SM_POWER_EVENT_RESUME, SM_EVENT_END, 0, NULL, 0);#endif    return error;}
开发者ID:emreharbutoglu,项目名称:gp-peak-kernel,代码行数:50,


示例13: enter_state

/** *	enter_state - Do common work of entering low-power state. *	@state:		pm_state structure for state we're entering. * *	Make sure we're the only ones trying to enter a sleep state. Fail *	if someone has beat us to it, since we don't want anything weird to *	happen when we wake up. *	Then, do the setup for suspend, enter the state, and cleaup (after *	we've woken up). */int enter_state(suspend_state_t state){	int error;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;	resume_from_deep_suspend = 0;	printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	warn_timeout(SUSPEND_PREPARE_TIMEOUT,			error = suspend_prepare()		);	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish(); Unlock:	mutex_unlock(&pm_mutex);	return error;}
开发者ID:HuChundong,项目名称:Endeavor3.1.10,代码行数:48,


示例14: enter_state

int enter_state(suspend_state_t state){    int error;    if (!valid_state(state))        return -ENODEV;    if (!mutex_trylock(&pm_mutex))        return -EBUSY;#if 0//ndef PA_THERM#if !defined(CONFIG_MACH_APQ8064_J1D) && !defined(CONFIG_MACH_APQ8064_J1KD)    pm8xxx_adc_unconfigure();#endif#endif    suspend_sys_sync_queue();    pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);    error = suspend_prepare();    if (error)        goto Unlock;    if (suspend_test(TEST_FREEZER))        goto Finish;    pr_debug("PM: Entering %s sleep/n", pm_states[state]);    pm_restrict_gfp_mask();    error = suspend_devices_and_enter(state);    pm_restore_gfp_mask();Finish:    pr_debug("PM: Finishing wakeup./n");    suspend_finish();Unlock:    mutex_unlock(&pm_mutex);    return error;}
开发者ID:regit66,项目名称:android_kernel_lge_geehrc,代码行数:38,


示例15: enter_state

int enter_state(suspend_state_t state){	int error;	int dock=0;	int retries=3;		if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;		printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");#ifdef CONFIG_ASUSEC	if (gpio_get_value(TEGRA_GPIO_PX5)==0){		dock=1;		hub_suspended=0;////		nousb=1;//		printk("mutex+/n");//		mutex_lock(&usb_mutex);		if (nousb==1) {			printk("usb wait1/n");			msleep(500);		}		asusec_close_keyboard();////		asusec_suspend_hub_callback2();/*		while (!hub_suspended) {			asusec_suspend_hub_callback();			if (retries-- == 0)				break;			if (!hub_suspended) {				stop_dock();				msleep(500);				asusec_resume(0);				msleep(500);//				printk("try to restart asusec/n");//				reload_asusec();			}		}*/		//		printk("mutex-/n");//		mutex_unlock(&usb_mutex);/*		if (!hub_suspended) {			stop_dock();			printk("Dock problem/n");			if (failed_dock < 3) {				printk("aborted suspend/n");				failed_dock++;				asusec_resume(0);				error=999;//				nousb=0;				goto Unlock;			}		} */		//		nousb=0;		failed_dock=0;		msleep(2000);	//		cpu_down(1);	}#endif	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	error = suspend_prepare();	if (error) {		if (dock==1) {			asusec_resume(0);		}		goto Unlock;	}	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	pm_restrict_gfp_mask();	error = suspend_devices_and_enter(state);	pm_restore_gfp_mask(); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish(); Unlock://	asusec_resume(0);	mutex_unlock(&pm_mutex);	return error;}
开发者ID:corvusmod,项目名称:kernel_asus_tf101-lumpy,代码行数:90,


示例16: enter_state

/** *	enter_state - Do common work of entering low-power state. *	@state:		pm_state structure for state we're entering. * *	Make sure we're the only ones trying to enter a sleep state. Fail *	if someone has beat us to it, since we don't want anything weird to *	happen when we wake up. *	Then, do the setup for suspend, enter the state, and cleaup (after *	we've woken up). */static int enter_state(suspend_state_t state){	int error;	extern unsigned long set1_gpio;	extern unsigned long set2_gpio;	if (!valid_state(state))		return -ENODEV;	if (!mutex_trylock(&pm_mutex))		return -EBUSY;#ifdef CONFIG_CPU_FREQ#ifdef SLEEP_CPUFREQ_CONSERVATIVE	// change cpufreq governor to performance	// if conservative governor#ifdef SLEEP_CPUFREQ_MANUAL_SET	if(is_userspace_gov())	{		g_cpuspeed = s5pc110_getspeed(0);		printk("userspace cpu speed %d /n",g_cpuspeed);		userSpaceGovernor=true;    	}	else if(is_conservative_gov())	{		s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_5, 0);		gbGovernorTransition=true;	}#else//SLEEP_CPUFREQ_MANUAL_SET	if(is_conservative_gov()) {		s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_5, 0);		gbGovernorTransition = true;		gpio_set_value(set2_gpio, 0);  		gpio_set_value(set1_gpio, 1);	}#endif//SLEEP_CPUFREQ_MANUAL_SET	#else//SLEEP_CPUFREQ_CONSERVATIVE	cpufreq_direct_set_policy(0, "userspace");	cpufreq_direct_store_scaling_setspeed(0, "800000", 0);#endif//SLEEP_CPUFREQ_CONSERVATIVE#endif//CONFIG_CPU_FREQ	printk(KERN_INFO "PM: Syncing filesystems ... ");	sys_sync();	printk("done./n");	pr_debug("PM: Preparing system for %s sleep/n", pm_states[state]);	error = suspend_prepare();	if (error)		goto Unlock;	if (suspend_test(TEST_FREEZER))		goto Finish;	pr_debug("PM: Entering %s sleep/n", pm_states[state]);	error = suspend_devices_and_enter(state); Finish:	pr_debug("PM: Finishing wakeup./n");	suspend_finish(); Unlock:	mutex_unlock(&pm_mutex);#ifdef CONFIG_CPU_FREQ#ifdef SLEEP_CPUFREQ_CONSERVATIVE#ifdef SLEEP_CPUFREQ_MANUAL_SET	if(userSpaceGovernor)	{		s5pc110_pm_target(g_cpuspeed);		printk("recover userspace cpu speed %d /n",g_cpuspeed);		g_cpuspeed=0;		userSpaceGovernor=false;	}	if(gbGovernorTransition)	{		s5pc110_unlock_dvfs_high_level(DVFS_LOCK_TOKEN_5);		gbGovernorTransition=false;	}	#else//SLEEP_CPUFREQ_MANUAL_SET	// change cpufreq to original one	if(gbGovernorTransition) {		s5pc110_unlock_dvfs_high_level(DVFS_LOCK_TOKEN_5);		gbGovernorTransition = false;	}#endif//SLEEP_CPUFREQ_MANUAL_SET	#else//SLEEP_CPUFREQ_CONSERVATIVE	cpufreq_direct_set_policy(0, "conservative");#endif//SLEEP_CPUFREQ_CONSERVATIVE#endif//CONFIG_CPU_FREQ	return error;//.........这里部分代码省略.........
开发者ID:mohamagihad,项目名称:linux-2.6.29,代码行数:101,



注:本文中的suspend_prepare函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ suspend_set_ops函数代码示例
C++ suspend_freeze_processes函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。