[Xenomai] Question about syscall

ニャン星人 1173264124 at qq.com
Wed Dec 23 05:01:03 CET 2015

Hi, I am reading the source code about xenomai syscall. And I have some question about xenomai syscall. For example, when I call function open which is defined in file rtdm.c,it would call xenomai syscall by using "fd = XENOMAI_SYSCALL2( sc_cobalt_open, path, oflag);". sc_cobalt_open is a macro like "#define sc_cobalt_open    75" defined in file syscall.h. After interrupt requested, system would handle the irq. By using 75 and array cobalt_syscalls which is defined in \kernel\cobalt\posix\syscall.c, the irq handle function could be found in cobalt_syscalls[75]. After reading source code, I found cobalt_syscalls[75] is a function pointer. cobalt_syscalls[75] and cobalt_open point to the same function.
     At this point, it is clear that function pointer cobalt_##name  initialize the array cobalt_syscalls. But I can't find where cobalt_##name like cobalt_open defined in.
     All in all, I just want to figure out the map about syscall from user-function to kernel-function, like open->fd = XENOMAI_SYSCALL2( sc_cobalt_open, path, oflag);->static inline int rtdm_open(const char *path, int oflag, ...)
     Thanks for your help.

More information about the Xenomai mailing list