在内核中添加函数,自己用的一个比较简单的。
1)在linux/kernel/sched.c中添加函数
long my_sched_setscheduler(pid_t pid, int policy, struct sched_param *param)
{
return setscheduler(pid, policy, param);
}
2)修改 .../arch/mips/kernel/mips_ksyms.c
extern long my_sched_setscheduler(pid_t pid, int policy, struct sched_param *param);
EXPORT_SYMBOL(my_sched_setscheduler);
//------------------------------------------
If we want export some symbol in Kernel that is not in a module such as xxxx in the /arch/ppc/fec.c.
Firstly, define the xxxx in the fec.c;
Secondly, make a new file which contain the "extern" define the xxxx(for example, extern int xxxx);
Lastly, in the ppc_ksyms.c we includes the new file, and add the EXPORT_SYMBOL(xxxx).
Then we can use the xxxx.
1)在linux/kernel/sched.c中添加函数
long my_sched_setscheduler(pid_t pid, int policy, struct sched_param *param)
{
return setscheduler(pid, policy, param);
}
2)修改 .../arch/mips/kernel/mips_ksyms.c
extern long my_sched_setscheduler(pid_t pid, int policy, struct sched_param *param);
EXPORT_SYMBOL(my_sched_setscheduler);
//------------------------------------------
If we want export some symbol in Kernel that is not in a module such as xxxx in the /arch/ppc/fec.c.
Firstly, define the xxxx in the fec.c;
Secondly, make a new file which contain the "extern" define the xxxx(for example, extern int xxxx);
Lastly, in the ppc_ksyms.c we includes the new file, and add the EXPORT_SYMBOL(xxxx).
Then we can use the xxxx.