linux kernel struct 之 machine_ops

linux-4.9.37/arch/x86/include/asm/reboot.h

用于定义机器操作的结构体,主要用于重启和关机操作。‌

struct machine_ops {
    void (*restart)(char *cmd);
    void (*halt)(void);
    void (*power_off)(void);
    void (*shutdown)(void);
    void (*crash_shutdown)(struct pt_regs *);
    void (*emergency_restart)(void);
};

/home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver/log_to_file.c: In function 'log_all_console_init': /home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver/log_to_file.c:105:20: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] orig_tty_write = kp.addr; ^ /home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver/log_to_file.c:112:41: error: passing argument 4 of 'proc_create' from incompatible pointer type [-Werror=incompatible-pointer-types] proc_create("console_log", 0, NULL, &console_log_fops); ^ In file included from /home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver/log_to_file.c:5:0: ./include/linux/proc_fs.h:109:24: note: expected 'const struct proc_ops *' but argument is of type 'const struct file_operations *' struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct proc_ops *proc_ops); ^~~~~~~~~~~ cc1: some warnings being treated as errors scripts/Makefile.build:286: recipe for target '/home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver/log_to_file.o' failed make[2]: *** [/home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver/log_to_file.o] Error 1 Makefile:1845: recipe for target '/home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver' failed make[1]: *** [/home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/driver] Error 2 make[1]: Leaving directory '/home/332641/IMOU/SmartLock/Kernel/Linux5.10AD100/src' Makefile:7: recipe for target 'all' failed make: *** [all] Error 2
最新发布
07-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值