title: How to call function only defined in .c file properly? (kernel development)
body: <p>Recently I try to modify some code in linux kernel and my goal is to add customize <a href="https://en.wikipedia.org/wiki/VDSO" rel="nofollow noreferrer">vdso</a>.</p>
  <p>In my plan, both <code>update_vdso_data</code> (function in <code>kernel/time/vsyscall.c</code>) and <code>vepoll_reg.c</code> ( my new vdso implementation under <code>arch/x86/entry/vdso/</code> ) will call function defined in <code>fs/eventpoll.c</code>. I didn't find any header defined function I needed in <code>eventpoll.c</code>, as a result, I just include .c file in them and didn't modify <code>makefile</code>.</p>
  <p>When I build the kernel, their came up a lot of warning and error messages.</p>
  <pre><code>  CC      kernel/time/vsyscall.o
  In file included from ./arch/x86/include/asm/ptrace.h:94,
                   from ./arch/x86/include/asm/math_emu.h:5,
                   from ./arch/x86/include/asm/processor.h:13,
                   from ./arch/x86/include/asm/timex.h:5,
                   from ./include/linux/timex.h:65,
                   from ./include/linux/time32.h:13,
                   from ./include/linux/time.h:73,
                   from ./include/linux/ktime.h:24,
                   from ./include/linux/hrtimer_defs.h:5,
                   from ./include/linux/hrtimer.h:15,
                   from ./arch/x86/include/asm/vdso/vsyscall.h:7,
                   from ./include/vdso/vsyscall.h:7,
                   from arch/x86/entry/vdso/vepoll_reg.c:2:
  ./arch/x86/include/asm/paravirt.h: In function ‘ep_remove’:
  ./arch/x86/include/asm/paravirt_types.h:539:3: warning: asm operand 3 probably doesn’t match constraints
    539 |   asm volatile(pre     \
        |   ^~~
  ./arch/x86/include/asm/paravirt_types.h:555:2: note: in expansion of macro ‘____PVOP_VCALL’
    555 |  ____PVOP_VCALL(op.func, CLBR_RET_REG,    \
        |  ^~~~~~~~~~~~~~
  ./arch/x86/include/asm/paravirt_types.h:580:2: note: in expansion of macro ‘__PVOP_VCALLEESAVE’
    580 |  __PVOP_VCALLEESAVE(op, &quot;&quot;, &quot;&quot;, PVOP_CALL_ARG1(arg1))
        |  ^~~~~~~~~~~~~~~~~~
  ./arch/x86/include/asm/paravirt.h:559:2: note: in expansion of macro ‘PVOP_VCALLEE1’
    559 |  PVOP_VCALLEE1(lock.queued_spin_unlock, lock);
        |  ^~~~~~~~~~~~~
  ./arch/x86/include/asm/paravirt_types.h:539:3: warning: asm operand 3 probably doesn’t match constraints
    539 |   asm volatile(pre     \
        |   ^~~
  ./arch/x86/include/asm/paravirt_types.h:555:2: note: in expansion of macro ‘____PVOP_VCALL’
    555 |  ____PVOP_VCALL(op.func, CLBR_RET_REG,    \
        |  ^~~~~~~~~~~~~~
  ./arch/x86/include/asm/paravirt_types.h:569:2: note: in expansion of macro ‘__PVOP_VCALLEESAVE’
    569 |  __PVOP_VCALLEESAVE(op, &quot;&quot;, &quot;&quot;)
        |  ^~~~~~~~~~~~~~~~~~
  ./arch/x86/include/asm/paravirt.h:663:2: note: in expansion of macro ‘PVOP_VCALLEE0’
    663 |  PVOP_VCALLEE0(irq.irq_enable);
        |  ^~~~~~~~~~~~~
  ./arch/x86/include/asm/paravirt_types.h:539:3: error: impossible constraint in ‘asm’
    539 |   asm volatile(pre     \
        |   ^~~
  </code></pre>
  <p>I guess this is the result I include file improperly. My question is that are there better ways to call function which didn't defined in .h file?</p>