This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Attempt to use kernel headers from user space



Hello ,

I am trying to compile a driver and need to include some kernel includes.

I therefor have set my include path to "~/ti-sdk-am3517-evm-05.02.00.00/psp/linux-2.6.37-psp04.02.00.07/include"

However at compilation it comes with the warning "Attempt to use kernel headers from user space", but the psp is not user space according to me

What am i doing wrong??

Regards

Marcel

  • marcel:

    See this article that discusses usage of kernel headers in a user-space application.

    http://kernelnewbies.org/KernelHeaders

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

  • Michael,

    This only applies when building applications on the host platform.

    My problem is there when I am cross compiling for Cortex.

    Regards

    Marcel

  • Are you cross compiling kernel driver or user space application?

    Looking at your error, I believe you are trying to build/cross-compile user-space application. You have to include "~/ti-sdk-am3517-evm-05.02.00.00/psp/linux-2.6.37-psp04.02.00.07/usr/include"

    And to install header files in usr/ issue command command "make headers_install" at your kernel home directory.

    Thanks,

    Vaibhav

  • I am trying to build a driver for the target,

    Meanwhile I got rid of this error by defining __kernel__ but now I get conflicting type error

    In file included from ~/ti-sdk-am3517-evm-05.02.00.00/psp/linux-2.6.37-psp04.02.00.07/include/linux/kernel.h:15,
                     from RTCdrv.c:31:
    ~/ti-sdk-am3517-evm-05.02.00.00/psp/linux-2.6.37-psp04.02.00.07include/linux/types.h:21: error: conflicting types for '__kernel_dev_t'
    ~/ti-sdk-am3517-evm-05.02.00.00/psp/linux-2.6.37-psp04.02.00.07include/asm/posix_types.h:22: error: previous declaration of '__kernel_dev_t' was here
    ~/ti-sdk-am3517-evm-05.02.00.00/psp/linux-2.6.37-psp04.02.00.07/include/linux/types.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'timer_t'
    ~/ti-sdk-am3517-evm-05.02.00.00/psp/linux-2.6.37-psp04.02.00.07/include/linux/types.h:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'clockid_t'