linux电源管理--syscore

本文介绍了Linux电源管理中syscore框架的位置、数据结构及接口,以及在系统挂起、恢复和关闭过程中的使用场景。syscore.c驱动文件包含了注册和回调函数的实现,suspend和resume回调在睡眠唤醒时调用,shutdown回调在系统关闭或重启时触发。
摘要由CSDN通过智能技术生成

目录

框架位置

数据结构及接口

原型实现解析

使用场景


框架位置

相关实现在drivers\base\syscore.c中

函数声明在include\linux\syscore_ops.h中。

依赖宏CONFIG_PM_SLEEP的使能

数据结构及接口

在头文件中,声明了函数原型以及相关结构体:

struct syscore_ops {
	struct list_head node;
	int (*suspend)(void);
	void (*resume)(void);
	void (*shutdown)(void);
};
extern void register_syscore_ops(struct syscore_ops *ops);
extern void unregister_syscore_ops(struct syscore_ops *ops);
#ifdef CONFIG_PM_SLEEP
extern int syscore_suspend(void);
extern void syscore_resume(void);
#endif
extern void syscore_shutdown(void);
#endif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值