I'm a beginner C and Linux developer so I'm sorry if this sounds confusing.
I managed to create a very simple system call successfully by updating the syscall_64.tbl, adding asmlinkage method definition to syscalls.h, adding the folder to main makefile and creating a makefile which has only one line:
obj-y := syscall.o
No problems until this, I compiled Linux source code and it worked. I want to build a more advanced system call. So I added a function to vmx.c(which is in arch/x86/kvm):
void myFunction(void){
//Some code
}
EXPORT_SYMBOL(myFunction);
and defined it in vmx.h(It is in arch/x86/include/asm):
void myFunction(void);
Now the problem begins. I included vmx.h to my syscall.c file and called this function. I'm getting an "undefined reference to myFunction" when I try to compile Linux source code. What am I doing wrong? This is my syscall.c:
#include <linux/kernel.h>
#include <linux/syscalls.h>
#include <asm/vmx.h>
asmlinkage long sys_customsyscall(const char *test)
{
printk(KERN_ALERT "Test: %s,\n", test);
myFunction();
return 0;
}

syscall.ccompilation in the make output? Can you edit your question to show what superfolder'smakefiledid you include your directory in and how? You have made a good, illustrative of how to add stuff to the linux kernel and so I upvoted you, but to solve your problem it's better to have all data at view. No need to include the whole superfolder's makefile, just the directory name and the including line with two or three lines of context.