Extending the Rasbian Kernel (Linux Kernel 3.10.28) for Arm / Raspberry PI - How to correctly add own system calls?

三世轮回 提交于 2019-12-06 12:03:15
user3786097

_NR_syscalls defined in arch/arm/include/asm/unistd.h file this value will always be __NR_last_syscall+1. Hence in your case _NR_syscalls should be modified to 381, but this change will also give the same error because of padding in syscall table. Hence define it to 384. This slove the compilation error. Below changes are not necessary:

include/uapi/asm-generic/unistd.h

#define __NR_helloworld 274
__SYSCALL(__NR_helloworld, sys_helloworld)

#define __NR_syscalls 275

arch/x86/syscalls/syscall_32.tbl

351     i386    helloworld              sys_helloworld
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!