Registering a system call with Linux Kernel3.0.7.


I am trying to register a simple system call with my ARM Linux Kernel 3.0.7
running on my Beagle BoardxM. I did the following changes to register the system

  1. In the file ‘/arch/arm/kernel/calls.S’, added an entry for my
    system call, function name

  2. In the file ‘/arch/arm/include/asm/unistd.h’, added the
    following entry
    #define __NR_fnc_name (__NR_SYSCALL_BASE + 110)

  3. In the file ‘linux/include/linux/syscalls.h’, added the line
    asmlinkage long sys_fnc_name(void); to the system call list
    just before the int kernel_execve… line

  4. In the folder ‘/arch/arm/kernel/’ added ‘My_syscall.c’ file and in the
    corresponding Makefile appended ‘My_syscall.o’ at the end of ‘obj-y’

/*My_syscall.c */
#include <linux/syscall.h>

asmlinkage long sys_fnc_name(void)
return 10;

  1. After tht started cross-compiling and building the kernel, however at the end
    the following error popped up:

GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
arch/arm/kernel/built-in.o: In function __sys_trace_return': io.c:(.text+0x9fc): undefined reference to sys_fnc_name’
make: *** [.tmp_vmlinux1] Error 1

Here, it says, ‘undefined reference to ‘sys_fnc_name’’, but its already been defined or
do i need to add somewhere else to resolve this issue…?